[cfe-dev] Clang accepts x86 specific options when cross compiling for arm

Khem Raj via cfe-dev cfe-dev at lists.llvm.org
Wed Jul 26 17:41:55 PDT 2017


Hi

I am compiling a package which pokes at compiler for -msse4.2 option and
if compiler accepts it then it happily adds the intel specific
intrinsics to code path. This works fine in cross compile environment
with gcc since gcc when configure for cross compiling for arm targets
rejects this option however with clang, configured for multiple targets

LLVM_TARGETS_TO_BUILD = "AArch64;ARM;Mips;PowerPC;X86"

it happily accepts -msse4.2 when called to cross compile for arm.

arm-bec-linux-gnueabi-clang -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard
-mcpu=cortex-a7 -mlittle-endian -march=armv7a
--sysroot=/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-gnueabi/leveldb/1.20+gitAUTOINC+a53934a3ae-r0/recipe-sysroot
 -O2 -msse4.2
clang-5.0: error: no input files

I believe it would be better if clang could cross check for target
options and error out and flag these kind of incompatible combinations

may be there is already an option to do so, I would be happy to know
since this would fix my issue once for all.

Thanks
-Khem

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170726/d0df7670/attachment.sig>


More information about the cfe-dev mailing list