llvm-project/compiler-rt/lib/xray
Dimitry Andric d849f8fd8f Fix XRayTest link on FreeBSD (and likely NetBSD too)
Summary:
As reported on llvm-testers, during 8.0.0-rc1 testing I got errors while
building of `XRayTest`, during `check-all`:

```
[100%] Generating XRayTest-x86_64-Test
/home/dim/llvm/8.0.0/rc1/Phase3/Release/llvmCore-8.0.0-rc1.obj/./lib/libLLVMSupport.a(Signals.cpp.o): In function `llvm::sys::PrintStackTrace(llvm::raw_ostream&)':
Signals.cpp:(.text._ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x24): undefined reference to `backtrace'
Signals.cpp:(.text._ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x254): undefined reference to `llvm::itaniumDemangle(char const*, char*, unsigned long*, int*)'
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [projects/compiler-rt/lib/xray/tests/unit/CMakeFiles/TXRayTest-x86_64-Test.dir/build.make:73: projects/compiler-rt/lib/xray/tests/unit/XRayTest-x86_64-Test] Error 1
gmake[3]: Target 'projects/compiler-rt/lib/xray/tests/unit/CMakeFiles/TXRayTest-x86_64-Test.dir/build' not remade because of errors.
gmake[2]: *** [CMakeFiles/Makefile2:33513: projects/compiler-rt/lib/xray/tests/unit/CMakeFiles/TXRayTest-x86_64-Test.dir/all] Error 2
gmake[2]: Target 'CMakeFiles/check-all.dir/all' not remade because of errors.
gmake[1]: *** [CMakeFiles/Makefile2:737: CMakeFiles/check-all.dir/rule] Error 2
gmake[1]: Target 'check-all' not remade because of errors.
gmake: *** [Makefile:277: check-all] Error 2
[Release Phase3] check-all failed
```

This is because the `backtrace` function requires `-lexecinfo` on BSD
platforms.  To fix this, detect the `execinfo` library in
`cmake/config-ix.cmake`, and add it to the unit test link flags.

Additionally, since the code in `sys::PrintStackTrace` makes use of
`itaniumDemangle`, also add `-lLLVMDemangle`.  (Note that this is more
of a general problem with libLLVMSupport, but I'm looking for a quick
fix now so it can be merged to the 8.0 branch.)

Reviewers: dberris, hans, mgorny, samsonov

Reviewed By: dberris

Subscribers: krytarowski, delcypher, erik.pilkington, #sanitizers, emaste, llvm-commits

Differential Revision: https://reviews.llvm.org/D57181

llvm-svn: 352234
2019-01-25 19:36:47 +00:00
..
tests Fix XRayTest link on FreeBSD (and likely NetBSD too) 2019-01-25 19:36:47 +00:00
CMakeLists.txt [XRay] Use preallocated memory for XRay profiling 2018-12-07 06:23:06 +00:00
weak_symbols.txt [XRay][compiler-rt][Darwin] Minimal XRay build support in Darwin 2017-11-28 11:49:22 +00:00
xray_AArch64.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_allocator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_always_instrument.txt [XRay][compiler-rt][NFC] Add example always/never instrument files. 2017-06-28 04:44:36 +00:00
xray_arm.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_basic_flags.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_basic_flags.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_basic_flags.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_basic_logging.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_basic_logging.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_buffer_queue.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_buffer_queue.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_defs.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_fdr_controller.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_fdr_flags.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_fdr_flags.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_fdr_flags.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_fdr_log_records.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_fdr_log_writer.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_fdr_logging.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_fdr_logging.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_flags.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_flags.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_flags.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_function_call_trie.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_init.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_interface.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_interface_internal.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_log_interface.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_mips.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_mips64.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_never_instrument.txt [XRay][compiler-rt][NFC] Add example always/never instrument files. 2017-06-28 04:44:36 +00:00
xray_powerpc64.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_powerpc64.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_profile_collector.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_profile_collector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_profiling.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_profiling_flags.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_profiling_flags.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_profiling_flags.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_recursion_guard.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_segmented_array.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_trampoline_AArch64.S Add NO_EXEC_STACK_DIRECTIVE to xray assembly files. 2017-03-15 21:18:47 +00:00
xray_trampoline_arm.S Add NO_EXEC_STACK_DIRECTIVE to xray assembly files. 2017-03-15 21:18:47 +00:00
xray_trampoline_mips.S Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_trampoline_mips64.S Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_trampoline_powerpc64.cc Re-commit r295017, since we have a potential fix of the tests, r295248, landed. 2017-02-15 22:40:29 +00:00
xray_trampoline_powerpc64_asm.S [XRay] Fix XRay PPC return value bug. 2017-05-10 16:28:21 +00:00
xray_trampoline_x86_64.S Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_tsc.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_utils.cc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_utils.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
xray_x86_64.cc [XRay] Support for Fuchsia 2018-11-22 02:00:44 +00:00
xray_x86_64.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00