On 2018-03-09 17:11, Aaron M. Ucko wrote: > Good question. Copying the LLVM maintainers accordingly.
The problems started with 0.13-12 where we switched the buildsystem from autotools to cmake. >From the 0.13-11 buildlog: ... checking build system type... x86_64-pc-linux-gnux32 checking host system type... x86_64-pc-linux-gnux32 checking target system type... x86_64-pc-linux-gnux32 ... /usr/lib/llvm-3.8/bin/clang -I/usr/include/x86_64-linux-gnux32 --target=x86_64-pc-linux-gnux32 -march=westmere -D_CL_DISABLE_HALF ... ... >From the 0.13-12 buildlog: ... -- llvm-config's LLVM_HOST_TARGET is: x86_64-pc-linux-gnu ... /usr/bin/clang-3.8 --target=x86_64-pc-linux-gnu -D_CL_DISABLE_HALF -march= ... ... >From the 1.1~rc2-1 buildlog: ... -- llvm-config's LLVM_HOST_TARGET is: x86_64-pc-linux-gnu ... /usr/bin/clang-4.0 --target=x86_64-pc-linux-gnu -D_CL_DISABLE_HALF -march=x86-64 ... ... The LLVM_HOST_TARGET setting comes from llvm-config-4.0 --host-target: cmake/LLVM.cmake: run_llvm_config(LLVM_HOST_TARGET --host-target) which seems to return a wrong value on x32. Due to lack of a x32 porterbox I cannot test this myself. at least on an amd64 host --target=x86_64-pc-linux-gnux32 seems to do the right thing: $ clang-4.0 --target=x86_64-pc-linux-gnux32 -march=x86-64 -c -x c /dev/null -o o.o $ file o.o o.o: ELF 32-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped Andreas