When libc++ is used to build CLANG, its XRay libraries libclang_rt.xray-*.a have dependencies on libc++. Therefore, libc++ is needed to link and run XRay test cases. For Linux -rpath is also needed to specify where to load libc++. This change sets macro LLVM_LIBCXX_USED to 1 if libc++ is actually used in the build. XRay tests then check the flag and add -L<llvm_shlib_dir> -lc++ and -Wl,-rpath=<llvm_shlib_dir> if needed.
Details
- Reviewers
hubert.reinterpretcast jasonliu sfertile EricWF amyk dberris - Commits
- rZORG2af83d046dad: Add libc++ to link XRay test cases if libc++ is used to build CLANG
rZORG9c1d86a05013: Add libc++ to link XRay test cases if libc++ is used to build CLANG
rG2af83d046dad: Add libc++ to link XRay test cases if libc++ is used to build CLANG
rG9c1d86a05013: Add libc++ to link XRay test cases if libc++ is used to build CLANG
rCRT360060: Add libc++ to link XRay test cases if libc++ is used to build CLANG
rG865a39d328c2: Add libc++ to link XRay test cases if libc++ is used to build CLANG
rL360060: Add libc++ to link XRay test cases if libc++ is used to build CLANG
Diff Detail
- Repository
- rL LLVM
Event Timeline
The test updates make sense given the current Clang driver behaviour; however, I think there is a question as to whether the Clang driver should be updated to add -lc++, etc. as necessary when it "automatically" links in compiler-rt libraries with such dependencies.
Thanks @xingxue for the off-list discussion. I agree that the Clang driver behaviour is a larger design question over packaging that should be a separate discussion at a later time. I'm good with this change to the tests, but I'd like to see if the other reviewers have comments to add.
@xingxue, I believe that you have had a good number of patches committed into the project already (rCXX195144, rL356104, rCRT356844). Please go ahead with requesting commit access, and commit this patch when you are ready.
@hubert.reinterpretcast, @dberris, thanks for the review! I will commit once I get the permission.