This is an archive of the discontinued LLVM Phabricator instance.

[libcxxabi] Allow target flags to affect configuration tests.
ClosedPublic

Authored by EricWF on Jun 1 2016, 4:15 PM.

Details

Summary

This patch changes the libc++abi CMake so that it adds certain target flags like '-m32' or '--gcc-toolchain' before including config-ix.cmake.
Since these flags can affect things like check_library_exists([...]) they needed to be added before the tests are performed.

Additionally this patch adds LIBCXXABI_BUILD_32_BITS which defaults to LLVM_BUILD_32_BITS.

This patch fixes:

https://llvm.org/bugs/show_bug.cgi?id=27950
https://llvm.org/bugs/show_bug.cgi?id=27959

Diff Detail

Event Timeline

EricWF updated this revision to Diff 59299.Jun 1 2016, 4:15 PM
EricWF retitled this revision from to [libcxxabi] Allow target flags to affect configuration tests..
EricWF updated this object.
EricWF added reviewers: danalbert, jroelofs, bcraig, compnerd.
EricWF added a subscriber: cfe-commits.
EricWF updated this revision to Diff 59308.Jun 1 2016, 4:44 PM

Add missing declaration for LIBCXXABI_TARGET_TRIPLE option.

compnerd added inline comments.Jun 1 2016, 5:55 PM
CMakeLists.txt
201

Why not handle this like libunwind? Alternative, we could duplicate this into libunwind. But we should behave similarly across the two I think.

219

No CMAKE_LINKER_FLAGS like libunwind/libc++?

234

This should be "--sysroot=${LIBCXXABI_SYSROOT}"

EricWF updated this revision to Diff 59327.Jun 1 2016, 6:21 PM
EricWF marked an inline comment as done.

Address review comments

  • Add '=' in sysroot flag.
EricWF added inline comments.Jun 1 2016, 6:24 PM
CMakeLists.txt
201

I just forgot to copy/paste it. I'll check it in.

219

CMAKE_LINKER_FLAGS isn't a thing. libunwind and libc++ both use <PROJECT>_LINK_FLAGS.

Also CMAKE_COMPILE_FLAGS is not a CMake variable either. (which I did replace in libunwind).

EricWF added inline comments.Jun 1 2016, 6:26 PM
CMakeLists.txt
201

Done in r271462.

EricWF accepted this revision.Jun 1 2016, 7:23 PM
EricWF added a reviewer: EricWF.

Accepting after speaking to @compnerd.

This revision is now accepted and ready to land.Jun 1 2016, 7:23 PM
EricWF closed this revision.Jun 1 2016, 7:25 PM