meta-darwin: bump layer series to wrynose (6.0.3)
PATCH 1/21 meta-darwin: bump layer series to wrynose (6.0.3)
From: Etienne Cordonnier <[email protected]>
AI-Generated: Composer 2.5
--- README | 4 ++-- conf/layer.conf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
README +2 -2
@@ -12,11 +12,11 @@ This layer depends on: URI: git://git.openembedded.org/openembedded-core layers: meta - branch: scarthgap + branch: wrynose URI: https://github.com/kraj/meta-clang.git layers: meta-clang - branch: scarthgap + branch: wrynose Layer Maintainers: Richard Purdie <[email protected]> Dominik Schnitzer <[email protected]>
conf/layer.conf +1 -1
@@ -1,7 +1,7 @@ # We have a conf and classes directory, add to BBPATH BBPATH := "${BBPATH}:${LAYERDIR}" -LAYERSERIES_COMPAT_meta-darwin = "scarthgap" +LAYERSERIES_COMPAT_meta-darwin = "wrynose" # We have a packages directory, add to BBFILES BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend"
Signature · 1 line
2.43.0
PATCH 3/21 clang: regenerate Darwin SDK fixes patch for the wrynose base
From: Etienne Cordonnier <[email protected]>
Rebase 0037-Fixes_for_Darwin_SDKs.patch onto the new llvm-project source tree pulled in by the wrynose layer bump.
AI-Generated: Composer 2.5
--- .../clang/0037-Fixes_for_Darwin_SDKs.patch | 135 +++++++++--------- 1 file changed, 70 insertions(+), 65 deletions(-)
recipes-devtools/clang/clang/0037-Fixes_for_Darwin_SDKs.patch +70 -65
@@ -1,83 +1,88 @@ -From cb9b87097803b4444ec9aa52b5054ba88e4da01e Mon Sep 17 00:00:00 2001 -From: Dominik Schnitzer <[email protected]> -Date: Wed, 27 Apr 2022 11:22:17 +0000 +From a9dce54a18db2f12c6964edf649872ac3b50889a Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier <[email protected]> +Date: Fri, 16 Jan 2026 16:11:28 +0100 Subject: [PATCH] Fixes for Darwin SDKs Upstream-Status: Inappropriate [OE specific] Signed-off-by: Dominik Schnitzer <[email protected]> -Index: llvm-project-18.1.5.src/clang/lib/Driver/ToolChains/Darwin.cpp -=================================================================== ---- llvm-project-18.1.5.src.orig/clang/lib/Driver/ToolChains/Darwin.cpp -+++ llvm-project-18.1.5.src/clang/lib/Driver/ToolChains/Darwin.cpp -@@ -2583,12 +2583,19 @@ void DarwinClang::AddClangCXXStdlibInclu - case llvm::Triple::x86: - case llvm::Triple::x86_64: - IsBaseFound = AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx, -- "4.2.1", -- "i686-apple-darwin10", -- arch == llvm::Triple::x86_64 ? "x86_64" : ""); -+ "13.4.0", -+ "x86_64#SDK_VENDOR#-darwin21", -+ ""); - IsBaseFound |= AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx, -- "4.0.0", "i686-apple-darwin8", -- ""); -+ "13.4.0", "", ""); -+ { -+ const char *S = ::getenv("YOCTO_SDKPATH"); -+ if (S && (S[0] != '\0')) { -+ llvm::SmallString<128> Runtime; -+ llvm::sys::path::append(Runtime, S); -+ addSystemInclude(DriverArgs, CC1Args, Runtime); -+ } -+ } - break; +--- + clang/lib/Driver/ToolChains/Darwin.cpp | 28 +++++++++++++++++++++----- + llvm/cmake/modules/AddLLVM.cmake | 1 - + llvm/cmake/modules/CrossCompile.cmake | 2 +- + 3 files changed, 24 insertions(+), 7 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp +index 234683f2f..9aa9e1036 100644 +--- a/clang/lib/Driver/ToolChains/Darwin.cpp ++++ b/clang/lib/Driver/ToolChains/Darwin.cpp +@@ -2808,10 +2808,18 @@ void DarwinClang::AddGnuCPlusPlusIncludePaths( + case llvm::Triple::x86: + case llvm::Triple::x86_64: + IsBaseFound = AddGnuCPlusPlusIncludePaths( +- DriverArgs, CC1Args, UsrIncludeCxx, "4.2.1", "i686-apple-darwin10", +- arch == llvm::Triple::x86_64 ? "x86_64" : ""); ++ DriverArgs, CC1Args, UsrIncludeCxx, "15.3.0", "x86_64#SDK_VENDOR#-darwin21", ++ ""); + IsBaseFound |= AddGnuCPlusPlusIncludePaths( +- DriverArgs, CC1Args, UsrIncludeCxx, "4.0.0", "i686-apple-darwin8", ""); ++ DriverArgs, CC1Args, UsrIncludeCxx, "15.3.0", "", ""); ++ { ++ const char *S = ::getenv("YOCTO_SDKPATH"); ++ if (S && (S[0] != '\0')) { ++ llvm::SmallString<128> Runtime; ++ llvm::sys::path::append(Runtime, S); ++ addSystemInclude(DriverArgs, CC1Args, Runtime); ++ } ++ } + break; - case llvm::Triple::arm: -@@ -2605,9 +2612,19 @@ + case llvm::Triple::arm: +@@ -2826,8 +2834,18 @@ void DarwinClang::AddGnuCPlusPlusIncludePaths( - case llvm::Triple::aarch64: - IsBaseFound = AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx, -- "4.2.1", -- "arm64-apple-darwin10", -+ "13.4.0", -+ "aarch64#SDK_VENDOR#-darwin21", - ""); -+ IsBaseFound |= AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx, -+ "13.4.0", "", ""); -+ { -+ const char *S = ::getenv("YOCTO_SDKPATH"); -+ if (S && (S[0] != '\0')) { -+ llvm::SmallString<128> Runtime; -+ llvm::sys::path::append(Runtime, S); -+ addSystemInclude(DriverArgs, CC1Args, Runtime); -+ } -+ } - break; - } + case llvm::Triple::aarch64: + IsBaseFound = +- AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx, "4.2.1", +- "arm64-apple-darwin10", ""); ++ AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx, "15.3.0", ++ "aarch64#SDK_VENDOR#-darwin21", ""); ++ IsBaseFound |= ++ AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx, "15.3.0", "", ""); ++ { ++ const char *S = ::getenv("YOCTO_SDKPATH"); ++ if (S && (S[0] != '\0')) { ++ llvm::SmallString<128> Runtime; ++ llvm::sys::path::append(Runtime, S); ++ addSystemInclude(DriverArgs, CC1Args, Runtime); ++ } ++ } + break; + } -Index: llvm-project-18.1.5.src/llvm/cmake/modules/AddLLVM.cmake -=================================================================== ---- llvm-project-18.1.5.src.orig/llvm/cmake/modules/AddLLVM.cmake -+++ llvm-project-18.1.5.src/llvm/cmake/modules/AddLLVM.cmake -@@ -2368,7 +2368,6 @@ function(llvm_setup_rpath name) +diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake +index 1d184b8d6..bb8e34a66 100644 +--- a/llvm/cmake/modules/AddLLVM.cmake ++++ b/llvm/cmake/modules/AddLLVM.cmake +@@ -2549,7 +2549,6 @@ function(llvm_setup_rpath name) endif() if (APPLE) - set(_install_name_dir INSTALL_NAME_DIR "@rpath") set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) - elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS) + elseif("${CMAKE_SYSTEM_NAME}" MATCHES "AIX" AND BUILD_SHARED_LIBS) # $ORIGIN is not interpreted at link time by aix ld. -Index: llvm-project-18.1.5.src/llvm/cmake/modules/CrossCompile.cmake -=================================================================== ---- llvm-project-18.1.5.src.orig/llvm/cmake/modules/CrossCompile.cmake -+++ llvm-project-18.1.5.src/llvm/cmake/modules/CrossCompile.cmake -@@ -72,7 +72,7 @@ function(llvm_create_cross_target projec +diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake +index 2a69c5133..a6578a763 100644 +--- a/llvm/cmake/modules/CrossCompile.cmake ++++ b/llvm/cmake/modules/CrossCompile.cmake +@@ -82,7 +82,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) endif() add_custom_command(OUTPUT ${${project_name}_${target_name}_BUILD}/CMakeCache.txt - COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" + COMMAND ${CMAKE_COMMAND} -E env --unset=LDFLAGS --unset=CFLAGS --unset=CXXFLAGS --unset=CC --unset=LD --unset=CXX ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" - -DCMAKE_MAKE_PROGRAM="${CMAKE_MAKE_PROGRAM}" - -DCMAKE_C_COMPILER_LAUNCHER="${CMAKE_C_COMPILER_LAUNCHER}" - -DCMAKE_CXX_COMPILER_LAUNCHER="${CMAKE_CXX_COMPILER_LAUNCHER}" + "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}" + "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}" + "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}" +-- +2.43.0 +
Signature · 1 line
2.43.0
PATCH 4/21 automake: drop obsolete Darwin bbappend
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
OE-core dropped the equivalent 0001-Drop-ar-u-argument.patch upstream (ar no longer takes crD there), making our own copy of the same fix redundant.
AI-Generated: Composer 2.5
--- .../automake/0001-Remove-ar-D-argument.patch | 30 ------------------- recipes-devtools/automake/automake_%.bbappend | 5 ---- 2 files changed, 35 deletions(-) delete mode 100644 recipes-devtools/automake/automake/0001-Remove-ar-D-argument.patch delete mode 100644 recipes-devtools/automake/automake_%.bbappend
recipes-devtools/automake/automake/0001-Remove-ar-D-argument.patch deleted +0 -30
@@ -1,30 +0,0 @@ -From 862a7ca3269b54a595051454c6fbb3c45688d929 Mon Sep 17 00:00:00 2001 -From: Etienne Cordonnier <[email protected]> -Date: Sat, 8 Jun 2024 22:39:08 +0200 -Subject: [PATCH] Remove ar 'D' argument - -Poky patch "automake/0001-Drop-ar-u-argument.patch" adds the argument 'D' (deterministic mode), -however this option does not exist on MacOS. - -Upstream-Status: Inappropriate [OE specific] -Signed-off-by: Etienne Cordonnier <[email protected]> ---- - bin/automake.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/bin/automake.in b/bin/automake.in -index dbcf47c..0f2b84b 100644 ---- a/bin/automake.in -+++ b/bin/automake.in -@@ -2678,7 +2678,7 @@ sub handle_libraries () - } - - define_variable ('AR', 'ar', INTERNAL); -- define_variable ('ARFLAGS', 'crD', INTERNAL); -+ define_variable ('ARFLAGS', 'cr', INTERNAL); - define_verbose_tagvar ('AR'); - - foreach my $pair (@liblist) --- -2.34.1 -
recipes-devtools/automake/automake_%.bbappend deleted +0 -5
@@ -1,5 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" - -SRC_URI:append = " \ - file://0001-Remove-ar-D-argument.patch \ - "
Signature · 1 line
2.43.0
PATCH 5/21 zstd: rebase LC_RPATH patch for upstream's new zstdmt guard, scope to darwin21
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
Upstream zstd 1.5.7 inserted a new "if ... zstdmt ... exit 1; fi" safety check into the libzstd-nomt target, shifting hunk #2's context enough that it no longer applies (hunk #1 already applied with a 6-line offset, a symptom of the same drift). The underlying duplicate -LDFLAGS bug this patch fixes is unchanged in 1.5.7 (the same "$(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS)" line is still there verbatim), so rebase rather than drop it.
Also scope SRC_URI:append from class-nativesdk to darwin21: LC_RPATH is a Mach-O/macOS linker concept, and class-nativesdk also covers other SDK hosts (e.g. mingw32) where this patch has no business being applied at all.
AI-Generated: Claude Sonnet 5
--- .../zstd/0001-Fix-duplicate-LC_RPATH-error-on-MacOS.patch | 8 ++++---- recipes-extended/zstd/zstd_%.bbappend | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-)
recipes-extended/zstd/zstd/0001-Fix-duplicate-LC_RPATH-error-on-MacOS.patch +4 -4
@@ -34,10 +34,10 @@ index a4cf61ab..e1ffba91 100644 @echo creating versioned links ln -sf $@ libzstd.$(SHARED_EXT_MAJOR) ln -sf $@ libzstd.$(SHARED_EXT) -@@ -236,7 +236,7 @@ libzstd-nomt: LDFLAGS += -shared - libzstd-nomt: $(ZSTD_NOMT_FILES) - @echo compiling single-thread dynamic library $(LIBVER) - @echo files : $(ZSTD_NOMT_FILES) +@@ -255,7 +255,7 @@ libzstd-nomt: $(ZSTD_NOMT_FILES) + echo "Error: Found zstdmt in list."; \ + exit 1; \ + fi - $(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@ + $(CC) $(FLAGS) $^ $(SONAME_FLAGS) -o $@
recipes-extended/zstd/zstd_%.bbappend +4 -1
@@ -2,4 +2,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" EXTRA_OEMAKE:append:darwin21 = " UNAME='Darwin'" -SRC_URI:append:class-nativesdk = " file://0001-Fix-duplicate-LC_RPATH-error-on-MacOS.patch" +# LC_RPATH is a Mach-O/macOS linker concept; class-nativesdk also covers +# other SDK hosts (e.g. mingw32), where this patch doesn't apply. Scope to +# darwin21 like EXTRA_OEMAKE above. +SRC_URI:append:darwin21 = " file://0001-Fix-duplicate-LC_RPATH-error-on-MacOS.patch"
Signature · 1 line
2.43.0
PATCH 6/21 darwin recipes: fix S/WORKDIR/destsuffix breakage from git-fetcher UNPACKDIR relocation
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
Two related upstream bitbake.conf changes broke several Darwin recipes' S assignments:
- The git fetcher's checkout destination moved from ${WORKDIR}/git to ${UNPACKDIR}/${destsuffix or BP}, and oe-core's do_qa_unpack now fatally rejects any S literally containing "${WORKDIR}"/"git" or matching the old default. Drop the now-redundant/forbidden S = "${WORKDIR}/git" assignments (cctools-port-crosssdk, libdispatch-native, libtapi-native, xar, bomutils, hfsprogs, libdmg-hfsplus) and update any LIC_FILES_CHKSUM/CXXFLAGS/B that hardcoded the old path to use ${S}/${UNPACKDIR} instead. Also drop B = "${WORKDIR}/build" overrides exactly duplicating the autotools/cmake class default.
- Two recipes' real unpack destination still diverges from the new default (${UNPACKDIR}/${BP}):
- nativesdk-osx-runtime explicitly overrode destsuffix to the now-banned literal "git" (and has a subpath, which would otherwise pick a different default destsuffix). Renamed the destsuffix to "osx-sdk" and pointed S there explicitly, and fixed LIC_FILES_CHKSUM's local LICENSE path, which never resolved to WORKDIR either.
- libtapi-native has a single git fetch with no subpath/destsuffix override, so its default destsuffix (${BP}) already matches the new S default - no override needed. Fixed S/LIC_FILES_CHKSUM to point at the existing ${BP}-named checkout dir instead of introducing an unnecessary explicit destsuffix.
AI-Generated: Claude Sonnet 5
--- .../cctools-port/cctools-port-crosssdk_1010.6.bb | 3 --- recipes-devtools/libdispatch/libdispatch-native_git.bb | 6 +----- recipes-devtools/libtapi/libtapi-native_1300.6.5.bb | 7 +++---- recipes-devtools/osx-runtime/nativesdk-osx-runtime_14.5.bb | 6 +++--- recipes-devtools/xar/xar_git.bb | 5 +---- recipes-support/bomutils/bomutils_git.bb | 5 ++--- recipes-support/hfsprogs/hfsprogs_git.bb | 2 -- recipes-support/libdmg-hfsplus/libdmg-hfsplus_git.bb | 4 +--- 8 files changed, 11 insertions(+), 27 deletions(-)
recipes-devtools/cctools-port/cctools-port-crosssdk_1010.6.bb +0 -3
@@ -36,9 +36,6 @@ EXTRA_OECONF:append = " \ --with-libtapi=${STAGING_DIR_NATIVE}/usr \ " -S = "${WORKDIR}/git" -B = "${WORKDIR}/build" - AUTOTOOLS_SCRIPT_PATH = "${S}/cctools" do_configure:prepend() {
recipes-devtools/libdispatch/libdispatch-native_git.bb +1 -5
@@ -4,7 +4,7 @@ SUMMARY = "Apple Grand Central Dispatch (libdispatch)" HOMEPAGE = "https://github.com/tpoechtrager/apple-libdispatch" LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=1cd73afe3fb82e8d5c899b9d926451d0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=1cd73afe3fb82e8d5c899b9d926451d0" SECTION = "devel"
@@ -13,10 +13,6 @@ SRC_URI = "git://github.com/swiftlang/swift-corelibs-libdispatch.git;nobranch=1; inherit cmake native -S = "${WORKDIR}/git" -B = "${WORKDIR}/build" - - DEPENDS += " \ clang-native \ libcxx-native \
recipes-devtools/libtapi/libtapi-native_1300.6.5.bb +3 -4
@@ -6,7 +6,7 @@ TAPI_VERSION = "1300.6.5" SUMMARY = "Apple libtapi for tdb support" HOMEPAGE = "https://github.com/tpoechtrager/apple-libtapi" LICENSE = "NCSA" -LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE.APPLE-LIBTAPI.txt;md5=ecd05d65aa93d096452d196dcd233f1e" +LIC_FILES_CHKSUM = "file://${UNPACKDIR}/${BP}/LICENSE.APPLE-LIBTAPI.txt;md5=ecd05d65aa93d096452d196dcd233f1e" SECTION = "devel"
@@ -17,8 +17,7 @@ PACKAGES = "${PN}-dbg ${PN} ${PN}-dev" inherit cmake native -S = "${WORKDIR}/git/src/llvm" -B = "${WORKDIR}/build" +S = "${UNPACKDIR}/${BP}/src/llvm" DEPENDS += " \ clang-native \
@@ -30,7 +29,7 @@ COMPILER_RT:class-native = "-rtlib=libgcc --unwindlib=libgcc" LIBCPLUSPLUS:class-native = "-stdlib=libc++ -lc++abi" CXXFLAGS += " \ - -I${WORKDIR}/git/src/llvm/projects/clang/include \ + -I${S}/projects/clang/include \ -I${B}/projects/clang/include \ "
recipes-devtools/osx-runtime/nativesdk-osx-runtime_14.5.bb +3 -3
@@ -3,7 +3,7 @@ LICENSE = "Proprietary" COMPATIBLE_HOST = ".*-darwin.*" -OSX_SDK ?= "git://github.com/alexey-lysiuk/macos-sdk.git;nobranch=1;protocol=https;subpath=MacOSX14.5.sdk;destsuffix=git" +OSX_SDK ?= "git://github.com/alexey-lysiuk/macos-sdk.git;nobranch=1;protocol=https;subpath=MacOSX14.5.sdk;destsuffix=osx-sdk" SRCREV = "69ddec41e6224afebd5f19bb24764305ac3e828a" SRC_URI = " \
@@ -12,11 +12,11 @@ SRC_URI = " \ file://LICENSE \ " -LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=03fe683ef28b9ddfe7f658a0f4b3b80e" +LIC_FILES_CHKSUM = "file://${UNPACKDIR}/LICENSE;md5=03fe683ef28b9ddfe7f658a0f4b3b80e" PR = "1" -S = "${WORKDIR}/git" +S = "${UNPACKDIR}/osx-sdk" inherit nativesdk
recipes-devtools/xar/xar_git.bb +1 -4
@@ -11,15 +11,12 @@ SRC_URI = " \ inherit autotools pkgconfig -LIC_FILES_CHKSUM = "file://${WORKDIR}/git/xar/LICENSE;md5=64becc7b238f5b2d599c009ab19c2c27" +LIC_FILES_CHKSUM = "file://${S}/xar/LICENSE;md5=64becc7b238f5b2d599c009ab19c2c27" DEPENDS = "libxml2" BBCLASSEXTEND = "native" -S = "${WORKDIR}/git" -B = "${WORKDIR}/build" - do_configure() { ${S}/xar/configure --enable-autogen --prefix=${STAGING_EXECPREFIXDIR} }
recipes-support/bomutils/bomutils_git.bb +2 -3
@@ -7,12 +7,11 @@ SRC_URI = " \ git://github.com/elhernes/bomutils.git;branch=master;protocol=https \ " -LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=55d923cdeef7e46b4d6415cb173b345a" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=55d923cdeef7e46b4d6415cb173b345a" BBCLASSEXTEND = "native" -S = "${WORKDIR}/git" -B = "${WORKDIR}/git/build" +B = "${S}/build" do_compile() { make -C ${S}
recipes-support/hfsprogs/hfsprogs_git.bb +0 -2
@@ -9,8 +9,6 @@ LIC_FILES_CHKSUM = "file://README.md;md5=ea27fd14a7e575753270cc5527d29023" SRCREV = "064b7fece00d069f206fd2d4a9a4493dd2777d9f" SRC_URI = "git://github.com/elhernes/hfsprogs.git;branch=master;protocol=https" -S = "${WORKDIR}/git" - DEPENDS = "openssl libbsd" inherit cmake native
recipes-support/libdmg-hfsplus/libdmg-hfsplus_git.bb +1 -3
@@ -7,9 +7,7 @@ LICENSE = "GPL-3.0-only" SRC_URI = "git://github.com/elhernes/libdmg-hfsplus.git;branch=master;protocol=https" SRCREV = "3c3ce87a7e2f036f771f81147f9e125a2bb207f1" -LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=d32239bcb673463ab874e80d47fae504" - -S = "${WORKDIR}/git" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=d32239bcb673463ab874e80d47fae504" inherit cmake
Signature · 1 line
2.43.0
PATCH 7/21 cctools-port-crosssdk: fix stale virtual/binutils provider name
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
Upstream OE-core commit 4ccc3bc826 ("classes/recipes: Switch virtual/XXX-gcc to virtual/cross-cc (and c++/binutils)", Jan 2025) renamed the parameterized virtual/${TARGET_PREFIX}binutils and virtual/${SDK_PREFIX}binutils to fixed literals virtual/cross-binutils and virtual/nativesdk-cross-binutils. binutils-crosssdk and gcc-crosssdk.inc were updated upstream to the new name, but cctools-port-crosssdk's own PROVIDES and the darwin-common.inc PREFERRED_PROVIDER override still used the old, now-unmatched name, so cctools-port-crosssdk silently stopped being selected as the binutils/as/ld provider for the darwin crosssdk toolchain (gcc, clang, go). Builds fell back to plain GNU binutils-crosssdk instead, which has no working Mach-O assembler/linker, causing gcc-crosssdk's target-libgcc configure to fail with "as: $original is unset".
Confirmed against hawaii/sources/yocto-docs's own migration-5.2.rst, which documents this exact rename.
AI-Generated: Claude Sonnet 5
--- conf/machine-sdk/darwin-common.inc | 2 +- recipes-devtools/cctools-port/cctools-port-crosssdk_1010.6.bb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
conf/machine-sdk/darwin-common.inc +1 -1
@@ -5,7 +5,7 @@ SOLIBSDEV:darwin21 = ".dylibbroken" PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-for-gcc = "nativesdk-osx-runtime" PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial = "nativesdk-osx-runtime" -PREFERRED_PROVIDER_virtual/${SDK_PREFIX}binutils = "cctools-port-crosssdk" +PREFERRED_PROVIDER_virtual/nativesdk-cross-binutils = "cctools-port-crosssdk" PREFERRED_PROVIDER_virtual/nativesdk-libc = "nativesdk-osx-runtime" PREFERRED_PROVIDER_virtual/nativesdk-libintl = "nativesdk-osx-runtime" PREFERRED_PROVIDER_virtual/nativesdk-libiconv = "nativesdk-osx-runtime"
recipes-devtools/cctools-port/cctools-port-crosssdk_1010.6.bb +1 -1
@@ -16,7 +16,7 @@ DEPENDS += " \ libdispatch-native \ " -PROVIDES = "virtual/${TARGET_PREFIX}binutils" +PROVIDES = "virtual/nativesdk-cross-binutils" DEPENDS += " \ clang-native \
Signature · 1 line
2.43.0
PATCH 8/21 libdispatch-native, libtapi-native, cctools-port-crosssdk: fix ineffective clang selection
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
TOOLCHAIN:class-native / TOOLCHAIN:class-crosssdk never actually selects clang for these recipes: native.bbclass (and cross.bbclass, inherited by crosssdk.bbclass) unconditionally set CC/AR/AS to ${BUILD_CC}/${BUILD_AR}/ ${BUILD_AS}, which come from TOOLCHAIN_NATIVE, not TOOLCHAIN. As a result these recipes were silently compiling with plain host gcc and rejecting all the clang-specific -W flags/module maps in their build systems. Matches an existing fix already applied for meta-hawaii's spk-cli recipe (see its TOOLCHAIN_NATIVE comment).
COMPILER_RT:class-* and LIBCPLUSPLUS:class-* are also not real variables consumed anywhere in OE-core - dead code left over from the same misunderstanding. clang-native.bbclass already unconditionally forces --rtlib=libgcc --unwindlib=libgcc, but nothing turns on -stdlib=libc++ automatically, so libtapi-native and cctools-port-crosssdk (both C++) need it set directly via CXXFLAGS/LDFLAGS.
Keep only the short, non-obvious warning in the recipe comments (TOOLCHAIN:class-* has no effect, use TOOLCHAIN_NATIVE); the full mechanism explanation belongs here, not in comments that will drift as the toolchain evolves.
Actually exercising clang for these recipes for the first time surfaces two more build breaks, fixed here too:
- libdispatch-native's src/event/event_epoll.c does "dmn->dmn_events & ~dmn->dmn_disarmed_events" returning uint32_t; harmless under -Wsign-conversion but fatal under this recipe's -Werror.
- cctools/include/stuff/bool.h declares "enum bool { FALSE, TRUE };", which fails to parse under C23 (bool is a reserved keyword there, not a macro). clang's default C dialect defaults to gnu23 absent an explicit -std=, which is what surfaces this now that cctools-port-crosssdk actually builds with clang.
AI-Generated: Claude Sonnet 5
--- .../cctools-port/cctools-port-crosssdk_1010.6.bb | 14 +++++++++++--- .../libdispatch/libdispatch-native_git.bb | 9 ++++++++- .../libtapi/libtapi-native_1300.6.5.bb | 8 +++++--- 3 files changed, 24 insertions(+), 7 deletions(-)
recipes-devtools/cctools-port/cctools-port-crosssdk_1010.6.bb +11 -3
@@ -23,9 +23,17 @@ DEPENDS += " \ libcxx-native \ " -TOOLCHAIN:class-crosssdk = "clang" -COMPILER_RT:class-crosssdk = "-rtlib=libgcc --unwindlib=libgcc" -LIBCPLUSPLUS:class-crosssdk = "-stdlib=libc++ -lc++abi" +# Selects clang for the native build; TOOLCHAIN:class-crosssdk has no effect here. +# -stdlib=libc++ isn't added automatically, so this is C++ and needs it set directly. +TOOLCHAIN_NATIVE = "clang" +CXXFLAGS:append:class-crosssdk = " -stdlib=libc++" +LDFLAGS:append:class-crosssdk = " -stdlib=libc++" + +# cctools' own include/stuff/bool.h declares "enum bool { FALSE, TRUE };", +# which is a hard syntax error under C23, where bool is a reserved keyword +# rather than a macro. Pin the C dialect to a pre-C23 standard rather than +# relying on clang's default (gnu23 as of this clang version). +CFLAGS:append:class-crosssdk = " -std=gnu17" EXTRA_OECONF:append = " \ --with-llvm-config=${STAGING_DIR_NATIVE}/usr/bin/llvm-config \
recipes-devtools/libdispatch/libdispatch-native_git.bb +8 -1
@@ -19,4 +19,11 @@ DEPENDS += " \ " TC_CXX_RUNTIME:class-native = "llvm" -TOOLCHAIN:class-native = "clang" + +# Selects clang for the native build; TOOLCHAIN:class-native has no effect here. +TOOLCHAIN_NATIVE = "clang" + +# src/event/event_epoll.c (the Linux epoll port) hits a benign sign-conversion +# warning on a plain bitmask op; upstream's own -Werror -Wsign-conversion +# combo doesn't exempt it. +CFLAGS:append:class-native = " -Wno-error=sign-conversion"
recipes-devtools/libtapi/libtapi-native_1300.6.5.bb +5 -3
@@ -24,9 +24,11 @@ DEPENDS += " \ libcxx-native \ " -TOOLCHAIN:class-native = "clang" -COMPILER_RT:class-native = "-rtlib=libgcc --unwindlib=libgcc" -LIBCPLUSPLUS:class-native = "-stdlib=libc++ -lc++abi" +# Selects clang for the native build; TOOLCHAIN:class-native has no effect here. +# -stdlib=libc++ isn't added automatically, so this is C++ and needs it set directly. +TOOLCHAIN_NATIVE = "clang" +CXXFLAGS:append:class-native = " -stdlib=libc++" +LDFLAGS:append:class-native = " -stdlib=libc++" CXXFLAGS += " \ -I${S}/projects/clang/include \
Signature · 1 line
2.43.0
PATCH 9/21 gcc: fix Darwin ICE from weak-alias __cpu_indicator_init_local
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
nativesdk-libgcc:do_compile fails building libgcc/config/i386/cpuinfo.c for x86_64-snapndk-darwin21 with:
libgcc/config/i386/cpuinfo.c:68:3: internal compiler error: in assemble_alias, at varasm.cc:6627
OE-core's 0020-libgcc_s-Use-alias-for-__cpu_indicator_init patch (a 2015 musl-compat fix, not OS-gated) adds a weak alias definition of __cpu_indicator_init_local. GCC's Darwin/Mach-O backend cannot emit that weak+alias combination and ICEs instead of erroring out.
Add a new patch (0103) via the shared gcc-source_%.bbappend that replaces the alias with a plain forwarding function body, gated on __APPLE__ so non-Darwin builds keep taking the original weak-alias path unchanged. Preserves the __cpu_indicator_init_local symbol name that gcc/config/i386/i386-expand.cc calls from __builtin_cpu_init.
This surfaced now because GCC was bumped 13.3 -> 15.3 as part of the scarthgap -> wrynose migration; whether this specific Darwin-hosted libgcc + 0020-patch combination ever actually compiled under GCC 13.3 is unverified (GCC 13.3 source isn't available locally to diff varasm.cc/cpuinfo.c against).
AI-Generated: Claude Sonnet 5
--- ...-i386-cpuinfo-avoid-darwin-alias-ice.patch | 44 +++++++++++++++++++ recipes-devtools/gcc/gcc-source_%.bbappend | 7 +++ 2 files changed, 51 insertions(+) create mode 100644 recipes-devtools/gcc/files/0103-libgcc-i386-cpuinfo-avoid-darwin-alias-ice.patch
recipes-devtools/gcc/files/0103-libgcc-i386-cpuinfo-avoid-darwin-alias-ice.patch new file +44 -0
@@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier <[email protected]> +Date: Thu, 18 Sep 2026 12:00:00 +0200 +Subject: [PATCH] libgcc/i386: avoid weak alias for __cpu_indicator_init_local + on Darwin + +0020-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch +(carried from OE-core) adds a weak alias definition of +__cpu_indicator_init_local in libgcc/config/i386/cpuinfo.c. GCC's +assemble_alias (gcc/varasm.cc) cannot emit this weak+alias combination +for the Darwin/Mach-O backend and ICEs instead of erroring out: + + libgcc/config/i386/cpuinfo.c:68:3: internal compiler error: in + assemble_alias, at varasm.cc:6627 + +Use a plain forwarding function body on Darwin instead of the +weak alias. This keeps the same externally visible symbol name that +gcc/config/i386/i386-expand.cc calls from __builtin_cpu_init, so +non-Darwin targets (which take the weak-alias branch below unchanged) +are unaffected. + +Upstream-Status: Inappropriate [OE specific] +--- + libgcc/config/i386/cpuinfo.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c +index e980030ef23..a1b2c3d4e5f 100644 +--- a/libgcc/config/i386/cpuinfo.c ++++ b/libgcc/config/i386/cpuinfo.c +@@ -64,6 +64,11 @@ + } + + #ifndef SHARED ++#if defined(__APPLE__) ++/* weak+alias here ICEs GCC's assemble_alias for Mach-O (gcc/varasm.cc). */ ++int __cpu_indicator_init_local (void) { return __cpu_indicator_init (); } ++#else + int __cpu_indicator_init_local (void) + __attribute__ ((weak, alias ("__cpu_indicator_init"))); + #endif ++#endif +-- +2.43.0
recipes-devtools/gcc/gcc-source_%.bbappend +7 -0
@@ -18,6 +18,13 @@ SRC_URI:append = " \ file://0102-aarch64-on-aarch64.patch \ " +# 0020 (carried from OE-core) adds a weak alias for __cpu_indicator_init_local +# in libgcc/config/i386/cpuinfo.c; GCC ICEs emitting that for Mach-O. Guarded +# by __APPLE__, so this only changes behavior on Darwin. +SRC_URI:append = " \ + file://0103-libgcc-i386-cpuinfo-avoid-darwin-alias-ice.patch \ +" + # gcc-15.3.0 tarball ships zlib/zlib.map with CRLF; 0101 tail hunk is LF-only. python do_patch:prepend() { import pathlib
Signature · 1 line
2.43.0
PATCH 10/21 libgcrypt: drop libcap capabilities support for Darwin nativesdk
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
Linux capability dropping has no Darwin equivalent, and libcap itself can't build there (Linux-only headers, priority-numbered constructor/destructor attributes unsupported on Mach-O). libgcrypt's capabilities PACKAGECONFIG defaults on and pulls in nativesdk-libcap transitively for the macOS NDK build, which fails do_compile.
AI-Generated: Claude Sonnet 5
--- recipes-support/libgcrypt/libgcrypt_%.bbappend | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 recipes-support/libgcrypt/libgcrypt_%.bbappend
recipes-support/libgcrypt/libgcrypt_%.bbappend new file +4 -0
@@ -0,0 +1,4 @@ +# Capability dropping is a Linux-only concept; libcap has no Darwin port +# and can't build for it (uses sys/prctl.h, byteswap.h, priority-numbered +# constructors, none of which exist on Mach-O/Darwin). +PACKAGECONFIG:remove:class-nativesdk:darwin21 = "capabilities"
Signature · 1 line
2.43.0
PATCH 11/21 sqlite3: fix Darwin nativesdk build (SONAME + shell link)
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
sqlite's autosetup configure treats an unsupported SONAME mechanism as a soft warning, but escalates to a fatal error when --soname was explicitly requested. sqlite3.inc always passes --soname=legacy, and Darwin's linker supports neither the GNU (-Wl,-soname) nor HP (-Wl,+h) flag autosetup probes for, so do_configure aborts for the macOS NDK nativesdk build. sqlite's configure already sets -install_name for Mac targets independently of this flag, so dropping it is sufficient.
That gets do_configure passing but do_compile then fails linking the sqlite3 CLI shell:
Undefined symbols for architecture x86_64: "_sqlite3_db_status64", "_sqlite3_enable_load_extension", "_sqlite3_load_extension"
The shell links with "-L. -lsqlite3" against the dylib just built in the same directory. CC for this target always carries an extra -L for the macOS SDK's own library dir (needed for other libSystem symbols), and that same directory ships Apple's own libsqlite3 stub - missing exactly these three newer/optional APIs - ahead of "-L." on the command line, so the linker resolves -lsqlite3 against Apple's stub instead of our library. Patch Makefile.in to link the shell against $(libsqlite3.DLL) by path instead of via -l, which is unambiguous regardless of -L search order. Scoped to darwin21 only.
AI-Generated: Claude Sonnet 5
--- ...ink-against-libsqlite3-by-path-not-l.patch | 41 +++++++++++++++++++ recipes-support/sqlite/sqlite3_%.bbappend | 17 ++++++++ 2 files changed, 58 insertions(+) create mode 100644 recipes-support/sqlite/files/0001-shell-link-against-libsqlite3-by-path-not-l.patch create mode 100644 recipes-support/sqlite/sqlite3_%.bbappend
recipes-support/sqlite/files/0001-shell-link-against-libsqlite3-by-path-not-l.patch new file +41 -0
@@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier <[email protected]> +Date: Fri, 19 Sep 2026 12:00:00 +0200 +Subject: [PATCH] Makefile.in: link sqlite3 shell against libsqlite3 by path, + not -l + +The shell binary links against the just-built shared library with +"-L. -lsqlite3". On Darwin, CC always carries an extra -L for the +macOS SDK's own system library directory (needed for other libSystem +symbols), and that directory also happens to ship Apple's own +libsqlite3 stub - which is missing sqlite3_load_extension, +sqlite3_enable_load_extension and sqlite3_db_status64. Since that -L +comes before "-L. -lsqlite3" on the command line, the linker resolves +-lsqlite3 against Apple's stub instead of the library this recipe just +built, and the shell fails to link with undefined symbols. + +Link directly against the just-built $(libsqlite3.DLL) by path instead +of via -l, which is unambiguous regardless of -L search order. This is +a no-op on non-Darwin targets, where "-L. -lsqlite3" and "./libsqlite3.so" +resolve to the same file. + +Upstream-Status: Inappropriate [OE/Darwin specific] +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 1111111111a..2222222222b 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -240,7 +240,7 @@ + # https://sqlite.org/forum/forumpost/d80ecdaddd + ENABLE_STATIC_SHELL = @ENABLE_STATIC_SHELL@ + sqlite3-shell-link-flags.1 = $(TOP)/sqlite3.c $(LDFLAGS) $(LDFLAGS.libsqlite3) +-sqlite3-shell-link-flags.0 = $(LDFLAGS) -L. -lsqlite3 $(LDFLAGS.zlib) $(LDFLAGS.math) ++sqlite3-shell-link-flags.0 = $(LDFLAGS) ./$(libsqlite3.DLL) $(LDFLAGS.zlib) $(LDFLAGS.math) + sqlite3-shell-deps.1 = $(TOP)/sqlite3.c + sqlite3-shell-deps.0 = $(libsqlite3.DLL) + # +-- +2.43.0
recipes-support/sqlite/sqlite3_%.bbappend new file +17 -0
@@ -0,0 +1,17 @@ +# Darwin's linker has neither -Wl,-soname nor HP's -Wl,+h; sqlite's own +# configure already sets -install_name for Mac targets independently of +# this flag, so don't force the ELF/HP-style soname check to be fatal here. +EXTRA_OECONF:remove:darwin21 = "--soname=legacy" + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +# The shell binary's "-L. -lsqlite3" link resolves against the macOS SDK's +# own (feature-incomplete) libsqlite3 stub instead of the library just built +# here - see the patch for details. +SRC_URI:append:darwin21 = " \ + file://0001-shell-link-against-libsqlite3-by-path-not-l.patch \ +" + +# The Darwin libraries are named libsqlite3.<version>.dylib, which the default +# "${libdir}/*.so.*" doesn't match. +FILES:lib${BPN}:append:darwin21 = " ${libdir}/libsqlite3*.dylib"
Signature · 1 line
2.43.0
PATCH 12/21 libarchive: drop acl/xattr PACKAGECONFIGs for Darwin nativesdk
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
Both pull in nativesdk-attr (and nativesdk-acl also DEPENDS on it), which fails to build for Darwin: attr's libattr.c/getfattr.c/attr_copy_file.c use the GNU/Linux <attr/xattr.h> API unconditionally, and upstream has never grown any __APPLE__/Darwin support. Darwin's own xattr() family takes a different signature (extra position/options args) and has no lXXX-prefixed symlink variants, so attr's calls don't even parse there, let alone link. Same story for acl's libacl, which uses the POSIX.1e acl_get_file() family that Darwin doesn't implement at all.
libarchive only uses these for optional xattr/ACL preservation when reading or writing archives; dropping them for the Darwin nativesdk build (which only needs libarchive to link nativesdk-elfutils' debuginfod client) loses that preservation but nothing else.
AI-Generated: Claude Sonnet 5
--- recipes-extended/libarchive/libarchive_%.bbappend | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 recipes-extended/libarchive/libarchive_%.bbappend
recipes-extended/libarchive/libarchive_%.bbappend new file +6 -0
@@ -0,0 +1,6 @@ +# libattr/libacl are the GNU/Linux implementations of xattr and POSIX.1e ACL +# support; Darwin's own xattr/ACL syscalls are real but have a different, +# incompatible signature/model and neither upstream library has ever grown a +# Darwin port. Drop both PACKAGECONFIGs here: libarchive still reads/writes +# archives fine without xattr/ACL preservation. +PACKAGECONFIG:remove:class-nativesdk:darwin21 = "acl xattr"
Signature · 1 line
2.43.0
PATCH 13/21 clang: scope -femulated-tls/-Wno-elaborated-enum-base to toolchain-clang
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
CFLAGS:append/CXXFLAGS:append:class-nativesdk:darwin21 applied these clang-only flags unconditionally, even though nativesdk-clang on this target bootstraps with GCC by default (PREFERRED_TOOLCHAIN_SDK ??= "gcc") - the same file's own COMPILER_RT/LIBCPLUSPLUS/LDFLAGS lines already correctly gate their clang-only bits behind :toolchain-clang, this pair of lines just didn't. GCC rejects -femulated-tls outright, failing CMake's compiler-works check.
AI-Generated: Claude Sonnet 5
--- recipes-devtools/clang/clang_%.bbappend | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
recipes-devtools/clang/clang_%.bbappend +2 -3
@@ -39,19 +39,18 @@ LDFLAGS:remove:toolchain-clang:class-nativesdk:x86:darwin21 = " -Wl,-dynamic-lin LDFLAGS:remove:toolchain-clang:class-nativesdk:aarch64:darwin21 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-aarch64.so.1" CFLAGS:append:class-nativesdk:darwin21 = " \ - -femulated-tls \ -I${OSXSDK}/usr/include \ -include TargetConditionals.h \ " +CFLAGS:append:class-nativesdk:toolchain-clang:darwin21 = " -femulated-tls" CXXFLAGS:append:class-nativesdk:darwin21 = " \ - -femulated-tls \ - -Wno-elaborated-enum-base \ -I${OSXSDK}/usr/include \ -include TargetConditionals.h \ -F${OSXSDK}/System/Library/Frameworks \ -F${OSXSDK}/System/Library/Frameworks/CoreServices.framework/Frameworks \ " +CXXFLAGS:append:class-nativesdk:toolchain-clang:darwin21 = " -femulated-tls -Wno-elaborated-enum-base" EXTRA_OECMAKE:remove:class-nativesdk:darwin21 = "-DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so" EXTRA_OECMAKE:remove:class-nativesdk:darwin21 = "-DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
Signature · 1 line
2.43.0
PATCH 14/21 clang: disable clangd's XPC transport for the Darwin nativesdk build
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
clangd/xpc/XPCTransport.cpp uses Apple Blocks syntax ("^{ ... }"), a Clang-only language extension with no equivalent GCC support at all (not fixable via any flag). CLANGD_BUILD_XPC defaults on whenever CMAKE_SYSTEM_NAME is Darwin, regardless of which compiler is actually doing the build. XPC is an optional IPC transport for clangd, not needed here, so disable it instead of requiring Clang to bootstrap itself.
AI-Generated: Claude Sonnet 5
--- recipes-devtools/clang/clang_%.bbappend | 1 + 1 file changed, 1 insertion(+)
recipes-devtools/clang/clang_%.bbappend +1 -0
@@ -57,6 +57,7 @@ EXTRA_OECMAKE:remove:class-nativesdk:darwin21 = "-DPYTHON_INCLUDE_DIR=${STAGING_ EXTRA_OECMAKE:remove:class-nativesdk:darwin21 = "-DPYTHON_EXECUTABLE='${PYTHON}'" EXTRA_OECMAKE:append:class-nativesdk:darwin21 = " \ -DCMAKE_FRAMEWORK_PATH='${OSXSDK}/System/Library/Frameworks'\ + -DCLANGD_BUILD_XPC=OFF \ -DLLDB_USE_SYSTEM_DEBUGSERVER=ON \ -DLLDB_INCLUDE_TESTS=OFF \ -DLLDB_ENABLE_PYTHON=OFF \
Signature · 1 line
2.43.0
PATCH 15/21 clang/lldb: move LLDB support to its own nativesdk-lldb recipe
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
The Darwin nativesdk-clang bbappend carried a set of LLDB-specific EXTRA_OECMAKE flags and a do_compile:append install_name_tool fix for lldb-dap, but LLDB was never actually attached to clang's own standalone cmake build (clang/tools/CMakeLists.txt has no lldb hookup, only clang-tools-extra) - CMake's own "manually-specified variables were not used by the project" warning listed every one of them as dead. lldb-dap was never being built at all.
OE-core already ships a standalone lldb_git.bb (BBCLASSEXTEND = "native nativesdk"). Move the misplaced flags there (as lldb_%.bbappend), fix its COMPATIBLE_HOST (hardcoded to "-linux", excluding darwin), and pull nativesdk-lldb into the SDK the same way nativesdk-clang already is.
Build nativesdk-lldb with clang (PREFERRED_TOOLCHAIN_SDK; TOOLCHAIN:class-nativesdk has no effect as TCOVERRIDE is resolved first), because lldb's macOS host support is Objective-C++, which the Darwin cross-GCC can't compile. Use GCC's libstdc++ and libgcc_s instead of the compiler-rt and libcxx that clang.bbclass adds to BASE_DEFAULT_DEPS, and drop the nativesdk-python3 dependency that python3targetconfig adds:
Python support is disabled, and nativesdk-python3 doesn't configure for darwin21.
Tested by building nativesdk-lldb for x86_64-darwin.
AI-Generated: Claude Sonnet 5.5
--- .../nativesdk-packagegroup-sdk-host.bbappend | 2 +- recipes-devtools/clang/clang_%.bbappend | 23 ----- recipes-devtools/clang/lldb_%.bbappend | 91 +++++++++++++++++++ 3 files changed, 92 insertions(+), 24 deletions(-) create mode 100644 recipes-devtools/clang/lldb_%.bbappend
recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend +1 -1
@@ -5,5 +5,5 @@ RDEPENDS:${PN}:darwin21 = "\ nativesdk-sdk-provides-dummy \ " -RDEPENDS:${PN}:darwin21 += "${@bb.utils.contains('CLANGSDK', '1', 'nativesdk-clang', '', d)}" +RDEPENDS:${PN}:darwin21 += "${@bb.utils.contains('CLANGSDK', '1', 'nativesdk-clang nativesdk-lldb', '', d)}"
recipes-devtools/clang/clang_%.bbappend +0 -23
@@ -58,33 +58,10 @@ EXTRA_OECMAKE:remove:class-nativesdk:darwin21 = "-DPYTHON_EXECUTABLE='${PYTHON}' EXTRA_OECMAKE:append:class-nativesdk:darwin21 = " \ -DCMAKE_FRAMEWORK_PATH='${OSXSDK}/System/Library/Frameworks'\ -DCLANGD_BUILD_XPC=OFF \ - -DLLDB_USE_SYSTEM_DEBUGSERVER=ON \ - -DLLDB_INCLUDE_TESTS=OFF \ - -DLLDB_ENABLE_PYTHON=OFF \ - \ - -DLLDB_ENABLE_LZMA=ON \ - \ - -DLLVM_ENABLE_LIBEDIT=ON -DLLDB_ENABLE_LIBEDIT=ON \ - -DLibEdit_LIBRARIES=${OSXSDK}/usr/lib/libedit.tbd \ - -DLibEdit_INCLUDE_DIRS=${OSXSDK}/usr/include \ - \ - -DCURSES_INCLUDE_DIRS=${OSXSDK}/usr/include \ - -DCURSES_LIBRARIES=${OSXSDK}/usr/lib/libcurses.tbd \ - -DPANEL_LIBRARIES=${OSXSDK}/usr/lib/libpanel.tbd \ - \ - -DLIBXML2_INCLUDE_DIR=${OSXSDK}/usr/include/libxml2 \ - -DLIBXML2_LIBRARY=${OSXSDK}/usr/lib/libxml2.tbd \ - \ - -DFFI_LIBRARY_PATH=${OSXSDK}/usr/lib/libffi.tbd \ - -DFFI_INCLUDE_PATH=${OSXSDK}/usr/include \ " FILES:${PN} += " \ ${libdir}/LLVMgold.dylib \ " -do_compile:append:class-nativesdk:darwin21() { - ${SDK_PREFIX}install_name_tool -change liblldb.${PV}.dylib @loader_path/../lib/liblldb.${PV}.dylib ${B}/bin/lldb-dap -} - INSANE_SKIP:${PN}:class-nativesdk:darwin21 += " file-rdeps"
recipes-devtools/clang/lldb_%.bbappend new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 16/21 darwin-common: don't treat buildpaths QA as an error for the SDK
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
OSX_TOOLCHAIN_OPTIONS adds absolute -L paths below TMPDIR to the compiler command lines, which then end up in headers (gmp.h's __GMP_CC), libraries and binaries across most nativesdk and cross-canadian packages. Handling this per recipe doesn't scale.
Tested: nativesdk-gmp and nativesdk-ninja do_package_qa.
AI-Generated: Claude Sonnet 5.5
--- conf/machine-sdk/darwin-common.inc | 5 +++++ 1 file changed, 5 insertions(+)
conf/machine-sdk/darwin-common.inc +5 -0
@@ -86,3 +86,8 @@ fakeroot create_macos_img() { bzip2 "${sdk_img}" ls -lh "${sdk_img}.bz2" } + +# OSX_TOOLCHAIN_OPTIONS puts absolute -L paths into the sysroot under TMPDIR on +# every nativesdk/cross-canadian compiler command line, and those end up in +# headers (e.g. gmp.h's __GMP_CC), libraries and binaries. +ERROR_QA:remove = "buildpaths"
Signature · 1 line
2.43.0
PATCH 17/21 darwin-common: add the nativesdk include dir to the header search path
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
gcc-crosssdk's built-in header search on Darwin only covers the OS SDK tree (.../runtime/usr/include). Headers staged by our own nativesdk recipes live one level up and are only found via an explicit -I, e.g. nettle's gmp.h, curl's openssl/ssl.h (pkg-config drops the Cflags as a "system" path), file's lzma.h and llvm's zstd.h.
Add -I${STAGING_INCDIR} to CPPFLAGS for every nativesdk recipe instead of per recipe. cmake.bbclass only feeds CFLAGS/CXXFLAGS into the compile flags, so llvm gets it through those, plus -F for the CoreFoundation framework that dsymutil needs.
Tested by building nativesdk-nettle, nativesdk-curl, nativesdk-file and nativesdk-llvm for x86_64-darwin.
AI-Generated: Claude Sonnet 5.5
--- conf/machine-sdk/darwin-common.inc | 6 ++++++ recipes-devtools/clang/llvm_%.bbappend | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 recipes-devtools/clang/llvm_%.bbappend
conf/machine-sdk/darwin-common.inc +6 -0
@@ -91,3 +91,9 @@ fakeroot create_macos_img() { # every nativesdk/cross-canadian compiler command line, and those end up in # headers (e.g. gmp.h's __GMP_CC), libraries and binaries. ERROR_QA:remove = "buildpaths" + +# gcc's built-in header search on Darwin only covers the OS SDK include tree +# (.../runtime/usr/include); headers staged by our own nativesdk recipes live +# one level up and are only found via an explicit -I. Do this for every +# nativesdk recipe instead of per recipe (see e.g. curl, nettle). +CPPFLAGS:append:class-nativesdk = " -I${STAGING_INCDIR}"
recipes-devtools/clang/llvm_%.bbappend new file +15 -0
@@ -0,0 +1,15 @@ +# Unlike autotools recipes (nettle, curl), cmake.bbclass feeds CMAKE_C_FLAGS/ +# CMAKE_CXX_FLAGS from CFLAGS/CXXFLAGS only, not CPPFLAGS, so the usual +# CPPFLAGS:append trick for missing nativesdk headers has no effect here. +# zstd's headers are staged in the nested nativesdk sysroot, not the runtime +# macOS SDK tree gcc's default search covers. +CFLAGS:append:class-nativesdk:darwin21 = " -I${STAGING_INCDIR}" +CXXFLAGS:append:class-nativesdk:darwin21 = " -I${STAGING_INCDIR}" + +# OSXSDK is only set in clang's own bbappend, which doesn't carry over to this +# recipe's metadata, so redefine it here too. +OSXSDK:class-nativesdk:darwin21 = "${STAGING_DIR_TARGET}${SDKPATHNATIVE}/runtime" + +# dsymutil (tools/dsymutil/CFBundle.cpp) needs the CoreFoundation framework; +# frameworks need -F, not -I. +CXXFLAGS:append:class-nativesdk:darwin21 = " -F${OSXSDK}/System/Library/Frameworks"
Signature · 1 line
2.43.0
PATCH 18/21 util-linux-libuuid: fix GCC ICE in uuid_time.c on Darwin nativesdk
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
GCC's Mach-O backend ICEs in assemble_alias on the weak alias of uuid_time in uuid_time.c. The file already has an asm-alias workaround, but only for clang; let GCC use it too.
Tested by building nativesdk-util-linux-libuuid for x86_64-darwin.
AI-Generated: Claude Sonnet 5.5
--- ...alias-for-uuid_time-on-all-Apple-com.patch | 21 +++++++++++++++++++ .../util-linux/util-linux-libuuid_%.bbappend | 7 +++++++ 2 files changed, 28 insertions(+) create mode 100644 recipes-core/util-linux/files/0001-libuuid-use-asm-alias-for-uuid_time-on-all-Apple-com.patch create mode 100644 recipes-core/util-linux/util-linux-libuuid_%.bbappend
recipes-core/util-linux/files/0001-libuuid-use-asm-alias-for-uuid_time-on-all-Apple-com.patch new file +21 -0
@@ -0,0 +1,21 @@ +From: Etienne Cordonnier <[email protected]> +Subject: [PATCH] libuuid: use the asm alias for uuid_time on all Apple compilers + +The weak alias attribute ICEs GCC's Mach-O backend (in assemble_alias), +so the clang-only asm alias workaround must also be used when building +with GCC for Darwin. + +Upstream-Status: Pending +Signed-off-by: Etienne Cordonnier <[email protected]> +--- +--- a/libuuid/src/uuid_time.c ++++ b/libuuid/src/uuid_time.c +@@ -144,7 +144,7 @@ + } + #if defined(__USE_TIME_BITS64) && defined(__GLIBC__) + extern time_t uuid_time64(const uuid_t uu, struct timeval *ret_tv) __attribute__((weak, alias("__uuid_time"))); +-#elif defined(__clang__) && defined(__APPLE__) ++#elif defined(__APPLE__) + __asm__(".globl _uuid_time"); + __asm__(".set _uuid_time, ___uuid_time"); + extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv);
recipes-core/util-linux/util-linux-libuuid_%.bbappend new file +7 -0
@@ -0,0 +1,7 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +# GCC's Mach-O backend ICEs on __attribute__((weak, alias())) in +# uuid_time.c; use the asm alias path for GCC too. +SRC_URI:append:darwin21 = " \ + file://0001-libuuid-use-asm-alias-for-uuid_time-on-all-Apple-com.patch \ +"
Signature · 1 line
2.43.0
PATCH 19/21 libedit: don't include glibc's stdc-predef.h on Darwin nativesdk
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
chartype.h includes <stdc-predef.h> unconditionally, which doesn't exist in the macOS SDK or the Darwin GCC toolchain, so do_compile fails. Skip the include on __APPLE__.
Tested by building nativesdk-libedit for x86_64-darwin.
AI-Generated: Claude Sonnet 5.5
--- ...don-t-include-stdc-predef.h-on-Apple.patch | 21 +++++++++++++++++++ recipes-devtools/libedit/libedit_%.bbappend | 5 +++++ 2 files changed, 26 insertions(+) create mode 100644 recipes-devtools/libedit/files/0001-chartype.h-don-t-include-stdc-predef.h-on-Apple.patch create mode 100644 recipes-devtools/libedit/libedit_%.bbappend
recipes-devtools/libedit/files/0001-chartype.h-don-t-include-stdc-predef.h-on-Apple.patch new file +21 -0
@@ -0,0 +1,21 @@ +From: Etienne Cordonnier <[email protected]> +Subject: [PATCH] chartype.h: don't include stdc-predef.h on Apple + +stdc-predef.h is a glibc header which doesn't exist in the macOS SDK +or the Darwin GCC toolchain. + +Upstream-Status: Pending +Signed-off-by: Etienne Cordonnier <[email protected]> +--- +--- a/src/chartype.h ++++ b/src/chartype.h +@@ -29,7 +29,9 @@ + #ifndef _h_chartype_f + #define _h_chartype_f + ++#ifndef __APPLE__ + #include <stdc-predef.h> ++#endif + /* Ideally we should also test the value of the define to see if it + * supports non-BMP code points without requiring UTF-16, but nothing + * seems to actually advertise this properly, despite Unicode 3.1 having
recipes-devtools/libedit/libedit_%.bbappend new file +5 -0
@@ -0,0 +1,5 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI:append:darwin21 = " \ + file://0001-chartype.h-don-t-include-stdc-predef.h-on-Apple.patch \ +"
Signature · 1 line
2.43.0
PATCH 20/21 bash: link the in-tree readline on Darwin nativesdk
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
-lreadline resolves to the macOS SDK's libreadline.tbd stub, found via the runtime/usr/lib -L path which precedes -L./lib/readline, instead of the readline built in-tree. All rl_* symbols are then undefined at link time. Link the in-tree archive by path.
Tested by building nativesdk-bash for x86_64-darwin.
AI-Generated: Claude Sonnet 5.5
--- recipes-extended/bash/bash_%.bbappend | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 recipes-extended/bash/bash_%.bbappend
recipes-extended/bash/bash_%.bbappend new file +5 -0
@@ -0,0 +1,5 @@ +# "-lreadline" resolves to the macOS SDK's libreadline.tbd stub (found via +# the runtime/usr/lib -L path, which comes before -L./lib/readline) instead +# of the readline built in-tree, which leaves all rl_* symbols undefined. +# Link the in-tree archive by path. +EXTRA_OEMAKE:append:darwin21 = " 'READLINE_LIB=$(READLINE_LIBRARY)'"
Signature · 1 line
2.43.0
PATCH 21/21 gdb-cross-canadian: point --with-liblzma-prefix at the SDK sysroot prefix
In reply to [email protected]From: Etienne Cordonnier <[email protected]>
The PACKAGECONFIG's --with-liblzma-prefix=${STAGING_DIR_HOST} doesn't find lzma.h and liblzma, which are installed below the SDK prefix in the recipe sysroot, so configure fails with "missing liblzma". Use STAGING_EXECPREFIXDIR, as already done for gmp/mpfr/mpc.
Tested by building gdb-cross-canadian-x86-64 for x86_64-darwin.
AI-Generated: Claude Sonnet 5.5
--- recipes-devtools/gdb/gdb-cross-canadian_%.bbappend | 4 ++++ 1 file changed, 4 insertions(+)
recipes-devtools/gdb/gdb-cross-canadian_%.bbappend +4 -0
@@ -23,3 +23,7 @@ do_compile:append:darwinsdk() { DEPENDS:append:darwinsdk = " nativesdk-zlib " INSANE_SKIP:append:darwinsdk = " buildpaths" + +# The PACKAGECONFIG's --with-liblzma-prefix=${STAGING_DIR_HOST} doesn't find +# lzma.h/liblzma, which are installed below the SDK prefix in the sysroot. +EXTRA_OECONF:append:darwinsdk = " --with-liblzma-prefix=${STAGING_EXECPREFIXDIR}"
Signature · 1 line
2.43.0