-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'
Description
on aarch64 darwin using the -mpopcnt flag will result in a warning on clang 16 and error on clang 19.1.3. however, if a linker flag trails the file name no warning / error is generated. eg:
$ clang -mpopcnt hello.c -lc
$ ./a.out
hello worldhowever, re-ordering the command line so the file name comes after -lc will generate the expected error
$ clang -mpopcnt -lc hello.c
clang: error: unsupported option '-mpopcnt' for target 'aarch64-apple-darwin'this behavior is not seen with all link flags, eg -flat_namespace always will generate an error, but when used in conjunction with -Wl will not generate an error (as do other flags, like -v)
$ clang -mpopcnt -flat_namespace hello.c
clang: error: unsupported option '-mpopcnt' for target 'aarch64-apple-darwin'
$ clang -mpopcnt hello.c -flat_namespace
clang: error: unsupported option '-mpopcnt' for target 'aarch64-apple-darwin'
$ clang -mpopcnt -Wl,-flat_namespace hello.c
clang: error: unsupported option '-mpopcnt' for target 'aarch64-apple-darwin'
$ clang -mpopcnt hello.c -Wl,-flat_namespace
$ ./a.out
hello world$ clang -v
clang version 19.1.3
Target: aarch64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /nix/store/6b4vxqc16xq1nq8jhdsylfml244vah22-clang-19.1.3/binMetadata
Metadata
Assignees
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'