Fix 1834#1858
Merged
Merged
Conversation
…rossbario#1834) Fixes cross-compilation of the NVX CFFI extensions (e.g. Buildroot/Yocto targeting aarch64 on an x86-64 host), which failed because the cross toolchain was handed the host-only -march=native flag: cc1: error: unknown value 'native' for '-march' Changes (implementing the design agreed in PR crossbario#1835): - get_compile_args(): the portable, safe architecture baseline is now the default for ALL build contexts (wheels, local source installs, and cross-compilation). -march=native is no longer the implicit default for local source builds; it is available opt-in via AUTOBAHN_ARCH_TARGET=native (build host == run host only). An unknown/cross target arch emits no -march flag, letting the toolchain defaults / distro CFLAGS decide. - Detect the TARGET architecture via sysconfig.get_platform() instead of platform.machine() (which reports the build host under cross-compilation). Approach contributed by @jameshilliard in PR crossbario#1835. - is_building_wheel() is retained for backward compatibility but no longer gates the default (documented as such). - Add src/autobahn/nvx/test/test_compile_args.py covering the default-safe / opt-in-native behavior, the arch->flag mapping, target detection, and the unknown-target (no -march) cross-compile case. Thanks to @jameshilliard for the original report (crossbario#1834) and PR crossbario#1835. Note: This work was completed with AI assistance (Claude Code).
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1834, also see the discussion on #1835 - which is superseeded by this new PR