diff --git a/meta-python/recipes-devtools/python/python3-autobahn/0001-Skip-march-guessing-for-external-cross-toolchains.patch b/meta-python/recipes-devtools/python/python3-autobahn/0001-Skip-march-guessing-for-external-cross-toolchains.patch new file mode 100644 index 0000000000..8f2e8f0d01 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-autobahn/0001-Skip-march-guessing-for-external-cross-toolchains.patch @@ -0,0 +1,88 @@ +From c677aa7a80fd551abb391a8f6abd28dc9f5c43a2 Mon Sep 17 00:00:00 2001 +From: Leon Anavi +Date: Mon, 20 Jul 2026 15:52:32 +0300 +Subject: [PATCH] Skip -march guessing for external cross toolchains + +Don't add -march flag when CC/CROSS_COMPILE names an external cross +toolchain (Yocto/OpenEmbedded, Buildroot, ...). These already +inject the correct target. Avoid issues such as an unknown value +'x86-64-v2' for '-march' when cross compiling for ARM machine. + +Upstream-Status: Pending [https://github.com/crossbario/autobahn-python/pull/1934] + +Signed-off-by: Leon Anavi +--- + src/autobahn/nvx/_compile_args.py | 36 ++++++++++++++++++++++++++++--- + 1 file changed, 33 insertions(+), 3 deletions(-) + +diff --git a/src/autobahn/nvx/_compile_args.py b/src/autobahn/nvx/_compile_args.py +index 2a35ab31..173e5fd4 100644 +--- a/src/autobahn/nvx/_compile_args.py ++++ b/src/autobahn/nvx/_compile_args.py +@@ -81,6 +81,10 @@ CIBUILDWHEEL : str, optional + AUDITWHEEL_PLAT : str, optional + Set by auditwheel/manylinux builds. Indicates wheel build. + ++CC, CROSS_COMPILE : str, optional ++ If either names a triplet-prefixed compiler (e.g. "aarch64-poky-linux-gcc"), ++ an external cross toolchain is assumed and no -march flag is added. ++ + Examples + -------- + +@@ -212,9 +216,6 @@ def get_compile_args(): + # But default codegen is already optimized for current arch + return ["/O2", "/W3"] + +- # GCC/Clang on POSIX (Linux, macOS, *BSD) +- machine = _get_target_machine() +- + # Base flags for all POSIX platforms + base_args = [ + "-std=c99", +@@ -233,6 +234,14 @@ def get_compile_args(): + # deployments). It is NOT safe for distributed wheels or cross-compilation. + return base_args + ["-march=native"] + ++ if _is_external_toolchain(): ++ # Cross toolchain (Yocto/OpenEmbedded, Buildroot, ...) already sets its ++ # own -march/-mtune; don't second-guess it (#1930). ++ return base_args ++ ++ # GCC/Clang on POSIX (Linux, macOS, *BSD) ++ machine = _get_target_machine() ++ + # Default for everyone (AUTOBAHN_ARCH_TARGET unset or "safe"): a portable + # baseline architecture. Defaulting to "safe" rather than -march=native is + # what makes cross-compilation work out of the box - a cross toolchain +@@ -248,6 +257,27 @@ def get_compile_args(): + return base_args + + ++def _is_external_toolchain(): ++ """ ++ True if ``CC`` or ``CROSS_COMPILE`` names a triplet-prefixed compiler (e.g. ++ ``aarch64-poky-linux-gcc``), the convention used by externally managed ++ toolchains such as Yocto/OpenEmbedded and Buildroot. ++ ++ Returns ++ ------- ++ bool ++ True if an externally managed cross toolchain is detected. ++ """ ++ for var in ("CC", "CROSS_COMPILE"): ++ value = os.environ.get(var, "") ++ if not value: ++ continue ++ exe = os.path.basename(value.split()[0]) ++ if "-" in exe: ++ return True ++ return False ++ ++ + def _get_target_machine(): + """ + Return the *target* machine architecture for the build. +-- +2.43.0 + diff --git a/meta-python/recipes-devtools/python/python3-autobahn_26.6.1.bb b/meta-python/recipes-devtools/python/python3-autobahn_26.7.1.bb similarity index 77% rename from meta-python/recipes-devtools/python/python3-autobahn_26.6.1.bb rename to meta-python/recipes-devtools/python/python3-autobahn_26.7.1.bb index f9239b4904..7829a0e149 100644 --- a/meta-python/recipes-devtools/python/python3-autobahn_26.6.1.bb +++ b/meta-python/recipes-devtools/python/python3-autobahn_26.7.1.bb @@ -3,7 +3,9 @@ HOMEPAGE = "http://crossbar.io/autobahn" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=49165a577911c4178e915dc26e2802a3" -SRC_URI[sha256sum] = "66b27e066a8ea265541eb07fd964e3116e2b8f51d797eea8a46b55c07fd81a07" +SRC_URI += "file://0001-Skip-march-guessing-for-external-cross-toolchains.patch" + +SRC_URI[sha256sum] = "c6949a2c6eb95fb1c218837dbda0a59abbbebafb8b11098551c01a7061dfd245" CVE_PRODUCT = "autobahn"