This is an archive of the discontinued LLVM Phabricator instance.

Add option to disable linking of libcxx into fuzzer
Needs ReviewPublic

Authored by pirama on Mar 15 2018, 12:33 PM.

Details

Summary

The ability to partially link libcxx into fuzzer does not work for cross
compilations. CMAKE_EXE_LINKER_FLAGS, etc are not passed to the custom CMake
invocation and cross-compiling libcxx without a libcxxabi, as is done here, has
further issues as well.

Add an option to disable linking of libcxx into fuzzer. The default for this
option is to link libcxx.

Event Timeline

pirama created this revision.Mar 15 2018, 12:33 PM
Herald added a reviewer: EricWF. · View Herald Transcript
Herald added subscribers: Restricted Project, delcypher, mgorny. · View Herald Transcript

Can you elaborate on the further issues with cross-compiling libcxx without a libcxxabi you mentioned in your commit message? I'd like to improve the build to handle all cases.

CMakeLists.txt
41

This should be probably called COMPILER_RT_FUZZER_LINK_LIBCXX for consistency with other options.

pirama updated this revision to Diff 138654.Mar 15 2018, 5:11 PM

Change name of option to COMPILER_RT_FUZZER_LINK_LIBCXX.

pirama marked an inline comment as done.Mar 15 2018, 5:16 PM

Can you elaborate on the further issues with cross-compiling libcxx without a libcxxabi you mentioned in your commit message? I'd like to improve the build to handle all cases.

The built libcxx had references to some symbols from libcxxabi (__cxa_guard_acquire, I think). I'll reproduce the error tomorrow and report back.

Ping...

Can you elaborate on the further issues with cross-compiling libcxx without a libcxxabi you mentioned in your commit message? I'd like to improve the build to handle all cases.

The built libcxx had references to some symbols from libcxxabi (__cxa_guard_acquire, I think). I'll reproduce the error tomorrow and report back.

I haven't reproduced the error yet (because had a bunch of local changes/fixes before I hit the brickwall). Nonetheless, I think this option can help in the intermediate time when we haven't been able to cross-compile libcxx using CMake (for Android).