llvm-mos-sdk
llvm-mos-sdk copied to clipboard
Common platform with CMake errors unless `CMAKE_TRY_COMPILE_TARGET_TYPE` is set to static library
This issue seems to be triggered under specific circumstances:
-
LLVM_MOS_PLATFORM
is set tocommon
-
CMAKE_TRY_COMPILE_TARGET_TYPE
is not set toSTATIC_LIBRARY
I am unable to upload the repro project onto GitHub, so here's the Google Drive link instead.
Log
[main] Configuring folder: mos-test
[driver] Removing /home/atirut/Projects/mos-test/build/CMakeCache.txt
[driver] Removing /home/atirut/Projects/mos-test/build/CMakeFiles
[proc] Executing command: /usr/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -S/home/atirut/Projects/mos-test -B/home/atirut/Projects/mos-test/build -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-common-clang: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-common-clang)
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-common-clang++: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-common-clang++)
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-common-clang: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-common-clang)
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-common-clang: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-common-clang)
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-common-clang++: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-common-clang++)
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-common-clang: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-common-clang)
[cmake] -- The C compiler identification is unknown
[cmake] -- The CXX compiler identification is unknown
[cmake] -- Detecting C compiler ABI info
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-clang: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-clang)
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-clang++: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-clang++)
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-clang: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-clang)
[cmake] -- Detecting C compiler ABI info - failed
[cmake] -- Check for working C compiler: /home/atirut/Programs/llvm-mos/bin/mos-common-clang
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-clang: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-clang)
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-clang++: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-clang++)
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-clang: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-clang)
[cmake] -- Check for working C compiler: /home/atirut/Programs/llvm-mos/bin/mos-common-clang - broken
[cmake] CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
[cmake] The C compiler
[cmake]
[cmake] "/home/atirut/Programs/llvm-mos/bin/mos-common-clang"
[cmake]
[cmake] is not able to compile a simple test program.
[cmake]
[cmake] It fails with the following output:
[cmake]
[cmake] Change Dir: /home/atirut/Projects/mos-test/build/CMakeFiles/CMakeTmp
[cmake]
[cmake] Run Build Command(s):/usr/bin/ninja-build cmTC_b1fc4 && [1/2] Building C object CMakeFiles/cmTC_b1fc4.dir/testCCompiler.c.obj
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-common-clang: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-common-clang)
[cmake] [2/2] Linking C executable cmTC_b1fc4
[cmake] FAILED: cmTC_b1fc4
[cmake] : && /home/atirut/Programs/llvm-mos/bin/mos-common-clang CMakeFiles/cmTC_b1fc4.dir/testCCompiler.c.obj -o cmTC_b1fc4 && :
[cmake] /home/atirut/Programs/llvm-mos/bin/mos-common-clang: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/mos-common-clang)
[cmake] /home/atirut/Programs/llvm-mos/bin/ld.lld: /lib64/libtinfo.so.6: no version information available (required by /home/atirut/Programs/llvm-mos/bin/ld.lld)
[cmake] ld.lld: error: cannot find linker script link.ld
[cmake] clang-16: error: ld.lld command failed with exit code 1 (use -v to see invocation)
[cmake] ninja: build stopped: subcommand failed.
[cmake]
[cmake]
[cmake]
[cmake]
[cmake]
[cmake] CMake will not be able to correctly generate this project.
[cmake] Call Stack (most recent call first):
[cmake] CMakeLists.txt:6 (project)
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "/home/atirut/Projects/mos-test/build/CMakeFiles/CMakeOutput.log".
[cmake] See also "/home/atirut/Projects/mos-test/build/CMakeFiles/CMakeError.log".
Note: error still occurs after updating to latest version
Can you provide some more information about what you're trying to do here? From the logs, it doesn't look like this issue is about the CMake build of the SDK itself, and it'll be difficult to diagnose this properly without the ability to reproduce the issue.
I played around with it a bit and it looks like this only happens with the common target. I will update this issue accordingly.
@mysterymath I have updated the issue and added a reproduction project. Are you able to reproduce the issue?
Ah, I see what's going on here; yep, this is a bug, and your diagnosis is correct. I think we should probably try to set CMAKE_TRY_COMPILE_TARGET_TYPE for incomplete targets like common.