diff mbox series

[meta-darwin] Add GDB and CLANG (conditionally) to the SDK builds

Message ID 20260120170459.95161-1-dev@qinc.tv
State New
Headers show
Series [meta-darwin] Add GDB and CLANG (conditionally) to the SDK builds | expand

Commit Message

Eric L. Hernes Jan. 20, 2026, 5:04 p.m. UTC
From: "Eric L. Hernes" <eric@qinc.tv>

GDB and CLANG are not included in the SDK builds on Darwin. This patch
adds them. GDB is added to the packagegroup files.  I had to disable
some of the advanced options for gdb to get a compile.

CLANG is added conditionally from the `CLANGSDK=1` variable.  This
also was missing from the *packagegroup* files.

commit f68c74645010c413601ed4766f702c93e8b111f7
Author: Eric L. Hernes <ehernes@portrait.com>
Date:   Mon Jan 19 11:45:13 2026 -0600

    patches to enable CLANGSDK and gdb on darwinsdk builds

commit da00745de4531722df9b955892c5835a7c26c03f
Author: Eric L. Hernes <ehernes@portrait.com>
Signed-off-by: Eric L. Hernes <eric@qinc.tv>
Date:   Mon Jan 19 09:54:57 2026 -0600

    additional patch for gcc to build on arm64 build for arm64 host
---
 .../openssl/openssl_%.bbappend                | 25 +++++++++++++++++++
 .../nativesdk-packagegroup-sdk-host.bbappend  |  3 +++
 .../packagegroup-cross-canadian.bbappend      |  5 ++++
 .../gdb/gdb-cross-canadian_%.bbappend         | 19 ++++++++++++++
 4 files changed, 52 insertions(+)
 create mode 100644 recipes-connectivity/openssl/openssl_%.bbappend
 create mode 100644 recipes-devtools/gdb/gdb-cross-canadian_%.bbappend
diff mbox series

Patch

diff --git a/recipes-connectivity/openssl/openssl_%.bbappend b/recipes-connectivity/openssl/openssl_%.bbappend
new file mode 100644
index 0000000..befbc64
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl_%.bbappend
@@ -0,0 +1,25 @@ 
+
+do_configure:darwin21 () {
+	target=darwin64-arm64-cc
+
+	useprefix=${prefix}
+	if [ "x$useprefix" = "x" ]; then
+		useprefix=/
+	fi
+	# WARNING: do not set compiler/linker flags (-I/-D etc.) in EXTRA_OECONF, as they will fully replace the
+	# environment variables set by bitbake. Adjust the environment variables instead.
+	PERLEXTERNAL="$(realpath ${S}/external/perl/Text-Template-*/lib)"
+	test -d "$PERLEXTERNAL" || bberror "PERLEXTERNAL '$PERLEXTERNAL' not found!"
+	HASHBANGPERL="/usr/bin/env perl" PERL=perl PERL5LIB="$PERLEXTERNAL" \
+	perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} ${DEPRECATED_CRYPTO_FLAGS} --prefix=$useprefix --openssldir=${libdir}/ssl-3 --libdir=${libdir} $target
+	perl ${B}/configdata.pm --dump
+}
+
+RDEPENDS:remove:${PN}-misc = "perl"
+RDEPENDS:remove:${PN}-ptest = "openssl-bin"
+RDEPENDS:remove:${PN}-ptest = "perl"
+RDEPENDS:remove:${PN}-ptest = "perl-modules"
+RDEPENDS:remove:${PN}-ptest = "bash"
+RDEPENDS:remove:${PN}-ptest = "sed"
+RDEPENDS:remove:${PN}-ptest = "openssl-engines"
+RDEPENDS:remove:${PN}-ptest = "openssl-ossl-module-legacy"
diff --git a/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend b/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
index 170a8c1..d1191e7 100644
--- a/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
+++ b/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
@@ -4,3 +4,6 @@  RDEPENDS:${PN}:darwin21 = "\
     nativesdk-bison \
     nativesdk-sdk-provides-dummy \
     "
+
+RDEPENDS:${PN}:darwin21 += "${@bb.utils.contains('CLANGSDK', '1', 'nativesdk-clang', '', d)}"
+
diff --git a/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend b/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend
index de29f47..4e46eae 100644
--- a/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend
+++ b/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend
@@ -1,9 +1,14 @@ 
 # Use indirection to stop these being expanded prematurely
 BINUTILS = "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}"
 GCC = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+GDB = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+CLANG = "clang-cross-canadian-${TRANSLATED_TARGET_ARCH}"
 
 RDEPENDS:${PN}:darwinsdk = "\
     ${@all_multilib_tune_values(d, 'BINUTILS')} \
     ${@all_multilib_tune_values(d, 'GCC')} \
+    ${GDB} \
     meta-environment-${MACHINE} \
     "
+
+RDEPENDS:${PN}:darwinsdk += "${@bb.utils.contains('CLANGSDK', '1', '${CLANGCROSSCANADIANDEPS}', '', d)}"
diff --git a/recipes-devtools/gdb/gdb-cross-canadian_%.bbappend b/recipes-devtools/gdb/gdb-cross-canadian_%.bbappend
new file mode 100644
index 0000000..99dac80
--- /dev/null
+++ b/recipes-devtools/gdb/gdb-cross-canadian_%.bbappend
@@ -0,0 +1,19 @@ 
+PACKAGECONFIG:remove = "python"
+PACKAGECONFIG:remove = "debuginfod"
+
+EXTRA_OECONF:append:darwinsdk = " \
+    --with-gmp=${STAGING_EXECPREFIXDIR} \
+    --with-mpft=${STAGING_EXECPREFIXDIR} \
+    --with-mpc=${STAGING_EXECPREFIXDIR} \
+"
+
+EXTRA_OECONF:remove:darwinsdk = "--disable-gas"
+EXTRA_OECONF:remove:darwinsdk = "--disable-binutils"
+EXTRA_OECONF:remove:darwinsdk = "--disable-ld"
+EXTRA_OECONF:remove:darwinsdk = "--disable-gold"
+EXTRA_OECONF:remove:darwinsdk = "--with-system-readline"
+
+# Remove -rpath-link and -rpath
+LDFLAGS:darwinsdk = "${BUILDSDK_LDFLAGS}"
+
+INSANE_SKIP:append:darwin21 = " buildpaths"