Skip to content

Fix 1834#1858

Merged
oberstet merged 3 commits into
crossbario:masterfrom
oberstet:fix_1834
Jun 16, 2026
Merged

Fix 1834#1858
oberstet merged 3 commits into
crossbario:masterfrom
oberstet:fix_1834

Conversation

@oberstet

Copy link
Copy Markdown
Contributor

fixes #1834, also see the discussion on #1835 - which is superseeded by this new PR

oberstet added 3 commits June 16, 2026 12:48
…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).
@oberstet oberstet merged commit 70b4b42 into crossbario:master Jun 16, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Incorrect machine is detected while cross compiling

1 participant