Skip to content

build: silence GCC -Wpsabi notes on 32-bit ARM NIF builds - #333

Merged
cocoa-xu merged 1 commit into
mainfrom
cx/arm32-wno-psabi
Jul 20, 2026
Merged

build: silence GCC -Wpsabi notes on 32-bit ARM NIF builds#333
cocoa-xu merged 1 commit into
mainfrom
cx/arm32-wno-psabi

Conversation

@cocoa-xu

Copy link
Copy Markdown
Owner

What

On 32-bit ARM (armv7l, armv6), GCC emits -Wpsabi notes when compiling the std::vector<int64_t> get_list/get_tuple helpers in the NIF:

note: parameter passing for argument of type std::vector<long long int>::iterator ... changed in GCC 7.1

These report the historic AAPCS ABI change introduced in GCC 7.1. They are harmless as long as the whole NIF is compiled with a single toolchain (always the case), but GCC writes them to stderr, so the Actions UI paints the otherwise-green precompile jobs with red Error: annotations.

Fix

Add -Wno-psabi to the evision target's warning flags, scoped to 32-bit ARM only:

if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi")
endif()

MATCHES "arm" covers armv6/armv7l; the 4-byte-pointer clause excludes arm64; aarch64 never matches the string. Every other arch is untouched.

Validation

Reproduced against the exact CI compiler (arm-linux-gnueabihf-g++ 9.4, ubuntu:20.04):

  • default -Wall -Wextra: 2 psabi notes per TU, exit 0 (never a hard error)
  • with -Wno-psabi: 0 notes, exit 0
  • armv7l cross-configure: predicate resolves TRUE, -Wno-psabi reaches the compile line, full rebuild yields 0 notes
  • string match verified across the matrix: armv6/armv7l TRUE, aarch64 FALSE, arm64 excluded by the pointer-size clause

The flag is accepted as a no-op by GCC 13/15 and Apple clang 17, so newer-toolchain and macOS builds are unaffected.

Opening as draft.

Compiling the vector<int64_t> get_list/get_tuple helpers with GCC 9 on
armv7l and armv6 emits "parameter passing ... changed in GCC 7.1" notes.
They report the historic AAPCS ABI change and are harmless when the NIF
is built with a single toolchain (always the case here), but GCC writes
them to stderr so the Actions UI flags the otherwise-green job in red.

Scope -Wno-psabi to 32-bit ARM (processor matches arm with a 4-byte
pointer), leaving aarch64/arm64 and every other arch untouched. Verified
against arm-linux-gnueabihf-g++ 9.4: the notes drop from 8/10 to 0.
@cocoa-xu
cocoa-xu marked this pull request as ready for review July 20, 2026 13:39
@cocoa-xu
cocoa-xu merged commit 6ea5882 into main Jul 20, 2026
6 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.

1 participant