This is an archive of the discontinued LLVM Phabricator instance.

[Fuzzer] Use a custom macro to build internal version of libc++
ClosedPublic

Authored by phosek on Jan 19 2018, 6:53 PM.

Details

Summary

add_custom_libcxx uses the just built compiler and installs the
built libc++, e.g. for testing, neither of which is desirable in
case of Fuzzer where the libc++ should be built using the host
compiler and it's only linked into the libFuzzer and should never
be installed. This change introduces add_internal_libcxx which
allows building such version of libc++.

Diff Detail

Repository
rL LLVM

Event Timeline

phosek created this revision.Jan 19 2018, 6:53 PM
Herald added subscribers: Restricted Project, llvm-commits, mgorny. · View Herald Transcript
vitalybuka added inline comments.Jan 19 2018, 7:04 PM
cmake/Modules/AddCompilerRT.cmake
511 ↗(On Diff #130744)

maybe we can just call here

add_internal_libcxx(
C_COMPILER=...
CXX_COMPILER=...
INSTALL_COMMAND=....
)

vitalybuka accepted this revision.Jan 19 2018, 7:06 PM

either way LGTM

This revision is now accepted and ready to land.Jan 19 2018, 7:06 PM

Thanks for getting to this so quickly. However, it still fails when cross compiling. I'm trying to debug it now.

Looks like the problem is that you aren't passing all the required parameters expected when cross compiling, e.g., CMAKE_SYSROOT, etc.

Doesn't look like any other active code is using these macros. I'm happy to test, but plan to disable the fuzzer for the time being.

phosek updated this revision to Diff 130746.Jan 19 2018, 8:18 PM
phosek marked an inline comment as done.
This revision was automatically updated to reflect the committed changes.

Thanks for adding CMAKE_SYSROOT, but it's still not passing all the required variables. I'll just disable it for now and followup later with a full list in a separate patch.

Thanks again...