[libc-commits] [PATCH] D130586: [cmake] Use `CMAKE_INSTALL_LIBDIR` too
Nathan Chancellor via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu Aug 18 15:12:14 PDT 2022
nathanchance added a comment.
I can no longer do a two stage build on Fedora after this change.
$ cmake \
-B build/stage1 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=$(command -v clang) \
-DCMAKE_CXX_COMPILER=$(command -v clang++) \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_TARGETS_TO_BUILD=host \
-DLLVM_USE_LINKER=$(command -v ld.lld) \
-G Ninja \
-S llvm
...
$ ninja -C build/stage1
...
$ cmake \
-B build/stage2 \
-DCLANG_TABLEGEN=$PWD/build/stage1/bin/clang-tblgen \
-DCMAKE_AR=$PWD/build/stage1/bin/llvm-ar \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=$PWD/build/stage1/bin/clang \
-DCMAKE_CXX_COMPILER=$PWD/build/stage1/bin/clang++ \
-DCMAKE_RANLIB=$PWD/build/stage1/bin/llvm-ranlib \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_TABLEGEN=$PWD/build/stage1/bin/llvm-tblgen \
-DLLVM_TARGETS_TO_BUILD=host \
-DLLVM_USE_LINKER=$PWD/build/stage1/bin/ld.lld \
-G Ninja \
-S llvm
...
-- Performing Test LLVM_LIBSTDCXX_MIN
-- Performing Test LLVM_LIBSTDCXX_MIN - Failed
CMake Error at cmake/modules/CheckCompilerVersion.cmake:88 (message):
libstdc++ version must be at least 7.1.
Call Stack (most recent call first):
cmake/config-ix.cmake:15 (include)
CMakeLists.txt:810 (include)
...
$ cat build/stage2/CMakeFiles/CMakeError.log
Checking whether the ASM compiler is GNU using "--version" did not match "(GNU assembler)|(GCC)|(Free Software Foundation)":
clang version 16.0.0 (https://github.com/llvm/llvm-project f7a33090a91015836497c75f173775392ab0304d)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/nathan/cbl/src/llvm-project/build/stage1/bin
Performing C++ SOURCE FILE Test LLVM_LIBSTDCXX_MIN failed with the following output:
Change Dir: /home/nathan/cbl/src/llvm-project/build/stage2/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/ninja-build cmTC_caa1d && [1/2] Building CXX object CMakeFiles/cmTC_caa1d.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_caa1d.dir/src.cxx.o
/home/nathan/cbl/src/llvm-project/build/stage1/bin/clang++ -DLLVM_LIBSTDCXX_MIN -std=c++0x -std=c++17 -MD -MT CMakeFiles/cmTC_caa1d.dir/src.cxx.o -MF CMakeFiles/cmTC_caa1d.dir/src.cxx.o.d -o CMakeFiles/cmTC_caa1d.dir/src.cxx.o -c /home/nathan/cbl/src/llvm-project/build/stage2/CMakeFiles/CMakeTmp/src.cxx
In file included from /home/nathan/cbl/src/llvm-project/build/stage2/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/iosfwd:40:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/postypes.h:40:
In file included from /usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/cwchar:44:
/usr/include/wchar.h:35:10: fatal error: 'stddef.h' file not found
#include <stddef.h>
^~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
Source file was:
#include <iosfwd>
#if defined(__GLIBCXX__)
#if !defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE < 7
#error Unsupported libstdc++ version
#endif
#endif
int main() { return 0; }
$ fd stddef.h build/stage1
build/stage1/lib/clang/16.0.0/include/stddef.h
The parent commit is fine. If there is any further information I can provide or patches I can test, please let me know!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130586/new/
https://reviews.llvm.org/D130586
More information about the libc-commits
mailing list