While building LLVM 17.0.0 rc1 on Solaris/amd64, two test-suite tests FAILed to link, breaking the test-suite build:
FAILED: MicroBenchmarks/XRay/ReturnReference/retref-bench
[...]
Undefined first referenced
symbol in file
__xray_set_handler MicroBenchmarks/XRay/ReturnReference/CMakeFiles/retref-bench.dir/retref-bench.cc.o
__xray_patch MicroBenchmarks/XRay/ReturnReference/CMakeFiles/retref-bench.dir/retref-bench.cc.o
__xray_remove_handler MicroBenchmarks/XRay/ReturnReference/CMakeFiles/retref-bench.dir/retref-bench.cc.o
__xray_unpatch MicroBenchmarks/XRay/ReturnReference/CMakeFiles/retref-bench.dir/retref-bench.cc.o
ld: fatal: symbol referencing errors
FAILED: MicroBenchmarks/XRay/FDRMode/fdrmode-bench
[...]
Undefined first referenced
symbol in file
__xray_log_flushLog MicroBenchmarks/XRay/FDRMode/CMakeFiles/fdrmode-bench.dir/fdrmode-bench.cc.o
__xray_log_init_mode MicroBenchmarks/XRay/FDRMode/CMakeFiles/fdrmode-bench.dir/fdrmode-bench.cc.o
__xray_patch MicroBenchmarks/XRay/FDRMode/CMakeFiles/fdrmode-bench.dir/fdrmode-bench.cc.o
__xray_remove_customevent_handler MicroBenchmarks/XRay/FDRMode/CMakeFiles/fdrmode-bench.dir/fdrmode-bench.cc.o
__xray_unpatch MicroBenchmarks/XRay/FDRMode/CMakeFiles/fdrmode-bench.dir/fdrmode-bench.cc.o
__xray_log_finalize MicroBenchmarks/XRay/FDRMode/CMakeFiles/fdrmode-bench.dir/fdrmode-bench.cc.o
__xray_log_select_mode MicroBenchmarks/XRay/FDRMode/CMakeFiles/fdrmode-bench.dir/fdrmode-bench.cc.o
ld: fatal: symbol referencing errors
This is a regression from LLVM 16 and caused by problems of the MicroBenchmarks/XRay/CMakeLists.txt XRay checks. The build log shows
-- Performing Test COMPILER_HAS_FXRAY_INSTRUMENT
-- Performing Test COMPILER_HAS_FXRAY_INSTRUMENT - Success
-- Looking for include file xray/xray_interface.h
-- Looking for include file xray/xray_interface.h - found
-- XRay tests enabled
The first test obviously passed for a test-release.sh build: the just-built clang always supports the -fxray-instrument flag.
The test for xray/xray_interface.h always passes as well: the XRay headers are always installed, irrespective whether XRay is supported on a particular target. I believe this is something that should be fixed, thus avoiding the problem in the first place.
The cmake tests are thus at least incomplete, wrong in the worst case. They should check if an executable using XRay can be compiled and linked. This way, the hack in CMakeLists.txt to check for x86 && !darwin (which is practically guaranteed to become stale) can be avoided.
While building LLVM 17.0.0 rc1 on Solaris/amd64, two
test-suite
testsFAIL
ed to link, breaking thetest-suite
build:This is a regression from LLVM 16 and caused by problems of the
MicroBenchmarks/XRay/CMakeLists.txt
XRay checks. The build log showstest-release.sh
build: the just-builtclang
always supports the-fxray-instrument
flag.xray/xray_interface.h
always passes as well: the XRay headers are always installed, irrespective whether XRay is supported on a particular target. I believe this is something that should be fixed, thus avoiding the problem in the first place.CMakeLists.txt
to check forx86 && !darwin
(which is practically guaranteed to become stale) can be avoided.