This is an archive of the discontinued LLVM Phabricator instance.

[CMake] External compiler-rt-configure requires LLVMTestingSupport when including tests
ClosedPublic

Authored by sgraenitz on Jan 31 2019, 9:21 AM.

Details

Summary

Apparently LLVMTestingSupport must be built before llvm-config can be asked for it. Symptom with LLVM_INCLUDE_TESTS=ON is:

$ ./path/to/llvm-build/bin/llvm-config --ldflags --libs testingsupport
-L/path/to/llvm-build/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
llvm-config: error: component libraries and shared library

llvm-config: error: missing: /path/to/llvm-build/lib/libLLVMTestingSupport.a

With LLVMTestingSupport as dependency of compiler-rt-configure we get the expected behavior:

$ ./path/to/llvm-build/bin/llvm-config --ldflags --libs testingsupport
-L/path/to/llvm-build/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
-lLLVMTestingSupport -lLLVMSupport -lLLVMDemangle

Diff Detail

Event Timeline

sgraenitz created this revision.Jan 31 2019, 9:21 AM
sgraenitz added a reviewer: dberris.

FYI: Seems to be happening since D55891

dberris accepted this revision.Jan 31 2019, 2:09 PM

LGTM

Thanks!

This revision is now accepted and ready to land.Jan 31 2019, 2:09 PM
beanz added a subscriber: phosek.

@phosek, does LLVM’s runtime directory do this correctly?

At some point we should try and deprecate and remove this option in favor of the LLVM directory because the LLVM approach is much more complete and robust.

Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2019, 5:27 PM

@phosek, does LLVM’s runtime directory do this correctly?

At some point we should try and deprecate and remove this option in favor of the LLVM directory because the LLVM approach is much more complete and robust.

My 2¢: ideally compiler-rt used imported targets. Please see my note added in D55891.

mgorny added a comment.Feb 1 2019, 4:37 AM

Ideally we wouldn't introduce such a complex dependency for 2 test cases.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2019, 7:35 AM