This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Fix cross build when multiple targets are enabled.
AbandonedPublic

Authored by gberry on Sep 4 2015, 11:06 AM.

Details

Reviewers
samsonov
Summary

Fix cross build if COMPILER_RT_TEST_TARGET_ARCH is specified as a
different arch than LLVM_NATIVE_ARCH.

Diff Detail

Event Timeline

gberry updated this revision to Diff 34047.Sep 4 2015, 11:06 AM
gberry retitled this revision from to [compiler-rt] Fix cross build when multiple targets are enabled..
gberry updated this object.
gberry added a reviewer: samsonov.
gberry added a subscriber: llvm-commits.
samsonov edited edge metadata.Sep 4 2015, 2:13 PM

What is the exact cmake invocation you're using, and what are the errors you see? ${COMPILER_RT_TEST_TARGET_ARCH} is supposed to be used, well, in testing. It probably shouldn't affect the set of architectures we're targeting.

cmake/config-ix.cmake
177

This doesn't seem right - arch may be deduced to be i386

gberry added a comment.Sep 8 2015, 8:27 AM

Do you think x86|i[0-9]86 would be better?

gberry added a comment.Sep 8 2015, 8:30 AM

I share your concern about using COMPILER_RT_TEST_TARGET_ARCH, but unless I'm missing something that seems to be how the compiler-rt cmake build is set up.

For some background, I'm trying to build compiler-rt on x86_64-linux targeting aarch64-linux, with a toolchain that is configured to support both X86 and AArch64 targets.
Without my change, the compiler-rt cmake config thinks I'm trying to build for x86, no matter how I set up my compiler & flag cmake variables.

OK, we shouldn't really LLVM_NATIVE_ARCH either. I've submitted similar changes to this code in r247099, could you please check if they solve the problem for you?

gberry added a comment.Sep 9 2015, 8:28 AM

r247099 resolves the issue for us. Thanks!

gberry abandoned this revision.Sep 9 2015, 8:28 AM