system clang 16 (main, so: 14) use of -m32 on aarch64 gets "-triple" "armv4t-unknown-freebsd14.0"; armv7 native gets "-triple" "armv7-unknown-freebsd14.0-gnueabihf"

From: Mark Millard <marklmi_at_yahoo.com>
Date: Wed, 05 Jul 2023 02:23:41 UTC
I tried the following:

# cc -### -std=c11 -m32 main.c
FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
Target: arm-unknown-freebsd14.0
Thread model: posix
InstalledDir: /usr/bin
 "/usr/bin/cc" "-cc1" "-triple" "armv4t-unknown-freebsd14.0" "-emit-obj" "-mrelax-all" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "main.c" "-mrelocation-model" "static" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "arm7tdmi" "-target-feature" "+soft-float" "-target-feature" "+soft-float-abi" "-target-feature" "-vfp2" "-target-feature" "-vfp2sp" "-target-feature" "-vfp3" "-target-feature" "-vfp3d16" "-target-feature" "-vfp3d16sp" "-target-feature" "-vfp3sp" "-target-feature" "-fp16" "-target-feature" "-vfp4" "-target-feature" "-vfp4d16" "-target-feature" "-vfp4d16sp" "-target-feature" "-vfp4sp" "-target-feature" "-fp-armv8" "-target-feature" "-fp-armv8d16" "-target-feature" "-fp-armv8d16sp" "-target-feature" "-fp-armv8sp" "-target-feature" "-fullfp16" "-target-feature" "-fp64" "-target-feature" "-d32" "-target-feature" "-neon" "-target-feature" "-sha2" "-target-feature" "-aes" "-target-feature" "-dotprod" "-target-feature" "-fp16fml" "-target-feature" "-bf16" "-target-feature" "-mve" "-target-feature" "-mve.fp" "-target-feature" "-fpregs" "-target-feature" "+strict-align" "-target-abi" "aapcs-linux" "-msoft-float" "-mfloat-abi" "soft" "-Wunaligned-access" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debugger-tuning=gdb" "-fcoverage-compilation-dir=/usr/home/root/c_tests" "-resource-dir" "/usr/lib/clang/16" "-internal-isystem" "/usr/lib/clang/16/include" "-internal-externc-isystem" "/usr/include" "-std=c11" "-fdebug-compilation-dir=/usr/home/root/c_tests" "-ferror-limit" "19" "-fno-signed-char" "-fgnuc-version=4.2.1" "-fcolor-diagnostics" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "/tmp/main-cf3921.o" "-x" "c" "main.c"
 "/usr/local/bin/aarch64-unknown-freebsd14.0-ld" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "--hash-style=both" "--enable-new-dtags" "-o" "a.out" "/usr/lib/crt1.o" "/usr/lib/crti.o" "/usr/lib/crtbegin.o" "-L/usr/lib" "/tmp/main-cf3921.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/usr/lib/crtend.o" "/usr/lib/crtn.o"

Note the: "-triple" "armv4t-unknown-freebsd14.0"


By contrast, on armv7:

# cc -### -std=c11 -m32 main.c
FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
Target: armv7-unknown-freebsd14.0-gnueabihf
Thread model: posix
InstalledDir: /usr/bin
 "/usr/bin/cc" "-cc1" "-triple" "armv7-unknown-freebsd14.0-gnueabihf" "-emit-obj" "-mrelax-all" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "main.c" "-mrelocation-model" "static" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "cortex-a8" "-target-feature" "+vfp2" "-target-feature" "+vfp2sp" "-target-feature" "+vfp3" "-target-feature" "+vfp3d16" "-target-feature" "+vfp3d16sp" "-target-feature" "+vfp3sp" "-target-feature" "-fp16" "-target-feature" "-vfp4" "-target-feature" "-vfp4d16" "-target-feature" "-vfp4d16sp" "-target-feature" "-vfp4sp" "-target-feature" "-fp-armv8" "-target-feature" "-fp-armv8d16" "-target-feature" "-fp-armv8d16sp" "-target-feature" "-fp-armv8sp" "-target-feature" "-fullfp16" "-target-feature" "+fp64" "-target-feature" "+d32" "-target-feature" "+neon" "-target-feature" "-sha2" "-target-feature" "-aes" "-target-feature" "-fp16fml" "-target-feature" "+strict-align" "-target-abi" "aapcs-linux" "-mfloat-abi" "hard" "-Wunaligned-access" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debugger-tuning=gdb" "-fcoverage-compilation-dir=/usr/home/root/c_tests" "-resource-dir" "/usr/lib/clang/16" "-internal-isystem" "/usr/lib/clang/16/include" "-internal-externc-isystem" "/usr/include" "-std=c11" "-fdebug-compilation-dir=/usr/home/root/c_tests" "-ferror-limit" "19" "-fno-signed-char" "-fgnuc-version=4.2.1" "-fcolor-diagnostics" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "/tmp/main-bcccc4.o" "-x" "c" "main.c"
 "/usr/bin/ld" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "--hash-style=both" "--enable-new-dtags" "-o" "a.out" "/usr/lib/crt1.o" "/usr/lib/crti.o" "/usr/lib/crtbegin.o" "-L/usr/lib" "/tmp/main-bcccc4.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/usr/lib/crtend.o" "/usr/lib/crtn.o"

Note the: "-triple" "armv7-unknown-freebsd14.0-gnueabihf"


Also, for native armv7 without the -m32 :

# cc -### -std=c11 main.c
FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
Target: armv7-unknown-freebsd14.0-gnueabihf
Thread model: posix
InstalledDir: /usr/bin
 "/usr/bin/cc" "-cc1" "-triple" "armv7-unknown-freebsd14.0-gnueabihf" "-emit-obj" "-mrelax-all" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "main.c" "-mrelocation-model" "static" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "cortex-a8" "-target-feature" "+vfp2" "-target-feature" "+vfp2sp" "-target-feature" "+vfp3" "-target-feature" "+vfp3d16" "-target-feature" "+vfp3d16sp" "-target-feature" "+vfp3sp" "-target-feature" "-fp16" "-target-feature" "-vfp4" "-target-feature" "-vfp4d16" "-target-feature" "-vfp4d16sp" "-target-feature" "-vfp4sp" "-target-feature" "-fp-armv8" "-target-feature" "-fp-armv8d16" "-target-feature" "-fp-armv8d16sp" "-target-feature" "-fp-armv8sp" "-target-feature" "-fullfp16" "-target-feature" "+fp64" "-target-feature" "+d32" "-target-feature" "+neon" "-target-feature" "-sha2" "-target-feature" "-aes" "-target-feature" "-fp16fml" "-target-feature" "+strict-align" "-target-abi" "aapcs-linux" "-mfloat-abi" "hard" "-Wunaligned-access" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debugger-tuning=gdb" "-fcoverage-compilation-dir=/usr/home/root/c_tests" "-resource-dir" "/usr/lib/clang/16" "-internal-isystem" "/usr/lib/clang/16/include" "-internal-externc-isystem" "/usr/include" "-std=c11" "-fdebug-compilation-dir=/usr/home/root/c_tests" "-ferror-limit" "19" "-fno-signed-char" "-fgnuc-version=4.2.1" "-fcolor-diagnostics" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "/tmp/main-67ecf8.o" "-x" "c" "main.c"
 "/usr/bin/ld" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "--hash-style=both" "--enable-new-dtags" "-o" "a.out" "/usr/lib/crt1.o" "/usr/lib/crti.o" "/usr/lib/crtbegin.o" "-L/usr/lib" "/tmp/main-67ecf8.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/usr/lib/crtend.o" "/usr/lib/crtn.o"

Again the: "-triple" "armv7-unknown-freebsd14.0-gnueabihf"


I'm guessing that for FreeBSD aarch64 -m32 producing
"-triple" "armv4t-unknown-freebsd14.0" is inappropriate
and "-triple" "armv7-unknown-freebsd14.0-gnueabihf" should
be the default for aarch64's -m32 .

===
Mark Millard
marklmi at yahoo.com