LLVM is really big project and packaging its sub projects as separated packages is really useful.
Issue is that it still does not work like it should be.
Bolt build fails
opened 07:35PM - 07 Jun 23 UTC
build-problem
BOLT
I'm trying to build bolt using https://github.com/llvm/llvm-project//releases/do… wnload/llvmorg-16.0.5//bolt-16.0.5.src.tar.xz
I'm not sure but on first look it looks like no one have been trying to build bold out of that tar ball because cmake warns on missing projrect() and cmake fails
I'm building bolt using set of cmake params like below:
```spec
%build
%cmake \
-D BOLT_CLANG_EXE=%{_bindir}/clang \
-D BOLT_INCLUDE_DOCS=ON \
-D BOLT_INCLUDE_TESTS=ON \
-D BOLT_LLD_EXE=%{_bindir}/ld.lld \
-D BUILD_SHARED_LIBS=OFF \
-D CMAKE_SKIP_RPATH=ON \
-D LLVM_BUILD_UTILS=ON \
-D LLVM_DIR=%{_libdir}/cmake/llvm \
-D LLVM_EXTERNAL_LIT=%{_bindir}/lit \
-D LLVM_INCLUDE_TESTS=ON \
-D LLVM_LINK_LLVM_DYLIB=OFF \
-D LLVM_TABLEGEN_EXE=%{_bindir}/llvm-tblgen \
-D LLVM_TARGETS_TO_BUILD="X86;AArch64" \
%if 0%{?__isa_bits} == 64
-D LLVM_LIBDIR_SUFFIX=64 \
%else
-D LLVM_LIBDIR_SUFFIX= \
%endif
%{nil}
%cmake_build
```
and cmake fails with
```console
+ /usr/bin/cmake -B x86_64-redhat-linux-gnu -D BUILD_SHARED_LIBS=ON -D CMAKE_AR=/usr/bin/gcc-ar -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_FLAGS_RELEASE=-DNDEBUG -D CMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -D CMAKE_Fortran_FLAGS_RELEASE=-DNDEBUG -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_NM=/usr/bin/gcc-nm -D CMAKE_RANLIB=/usr/bin/gcc-ranlib -D CMAKE_VERBOSE_MAKEFILE=ON -D INCLUDE_INSTALL_DIR=/usr/include -D LIB_INSTALL_DIR=/usr/lib64 -D LIB_SUFFIX=64 -D SHARE_INSTALL_PREFIX=/usr/share -D SYSCONF_INSTALL_DIR=/etc -S . -D BOLT_CLANG_EXE=/usr/bin/clang -D BOLT_INCLUDE_DOCS=ON -D BOLT_INCLUDE_TESTS=ON -D BOLT_LLD_EXE=/usr/bin/ld.lld -D BUILD_SHARED_LIBS=OFF -D CMAKE_SKIP_RPATH=ON -D LLVM_BUILD_UTILS=ON -D LLVM_DIR=/usr/lib64/cmake/llvm -D LLVM_EXTERNAL_LIT=/usr/bin/lit -D LLVM_INCLUDE_TESTS=ON -D LLVM_LINK_LLVM_DYLIB=OFF -D LLVM_TABLEGEN_EXE=/usr/bin/llvm-tblgen -D 'LLVM_TARGETS_TO_BUILD=X86;AArch64' -D LLVM_LIBDIR_SUFFIX=64
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) in CMakeLists.txt:
cmake_minimum_required() should be called prior to this top-level project()
call. Please see the cmake-commands(7) manual for usage documentation of
both commands.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 13.1.1
-- The CXX compiler identification is GNU 13.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:22 (if):
Policy CMP0057 is not set: Support new IN_LIST if() operator. Run "cmake
--help-policy CMP0057" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
IN_LIST will be interpreted as an operator when the policy is set to NEW.
Since the policy is not set the OLD behavior will be used.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at CMakeLists.txt:22 (if):
if given arguments:
"clang" "IN_LIST" "LLVM_ENABLE_PROJECTS" "AND" "BOLT_CLANG_EXE"
Unknown arguments specified
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.26)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
```
Several other projects are not fully working (In this case I’ve attached even proposed patch but looks like one is interested)
opened 10:34PM - 18 Mar 23 UTC
cmake
packaging
As source tar ball I'm using https://github.com/llvm/llvm-project/releases/downl… oad/llvmorg-16.0.0/llvm-16.0.0.src.tar.xz and cmake fails on trying to check files outside of the surce tree.
```console
+ /usr/bin/cmake -B x86_64-redhat-linux-gnu -D BUILD_SHARED_LIBS=ON -D CMAKE_AR=/usr/bin/gcc-ar -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_FLAGS_RELEASE=-DNDEBUG -D CMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -D CMAKE_Fortran_FLAGS_RELEASE=-DNDEBUG -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_NM=/usr/bin/gcc-nm -D CMAKE_RANLIB=/usr/bin/gcc-ranlib -D CMAKE_VERBOSE_MAKEFILE=ON -D INCLUDE_INSTALL_DIR=/usr/include -D LIB_INSTALL_DIR=/usr/lib64 -D LIB_SUFFIX=64 -D SHARE_INSTALL_PREFIX=/usr/share -D SYSCONF_INSTALL_DIR=/etc -S . -D BUILD_SHARED_LIBS=OFF -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_MODULE_PATH=/usr/lib64/cmake/llvm -D CMAKE_SKIP_RPATH=ON -D LLVM_BUILD_DOCS=ON -D LLVM_BUILD_EXAMPLES=OFF -D LLVM_BUILD_EXTERNAL_COMPILER_RT=ON -D LLVM_BUILD_LLVM_DYLIB=ON -D LLVM_BUILD_RUNTIME=ON -D LLVM_BUILD_TESTS=ON -D LLVM_BUILD_TOOLS=ON -D LLVM_DYLIB_EXPORT_ALL=ON -D LLVM_ENABLE_DOXYGEN=OFF -D LLVM_ENABLE_FFI=ON -D LLVM_ENABLE_LIBCXX=OFF -D LLVM_ENABLE_LIBXML2=ON -D LLVM_ENABLE_RTTI=ON -D LLVM_ENABLE_SPHINX=ON -D LLVM_ENABLE_TERMINFO=ON -D LLVM_ENABLE_ZLIB=ON -D LLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR -D LLVM_EXTERNAL_LIT=/usr/bin/lit -D LLVM_INCLUDE_BENCHMARKS=OFF -D LLVM_INCLUDE_DOCS=ON -D LLVM_INCLUDE_EXAMPLES=ON -D LLVM_INCLUDE_TESTS=ON -D LLVM_INCLUDE_TOOLS=ON -D LLVM_INCLUDE_UTILS=ON -D LLVM_INSTALL_SPHINX_HTML_DIR=/usr/share/doc/llvm/html -D LLVM_INSTALL_TOOLCHAIN_ONLY=OFF -D LLVM_INSTALL_UTILS=ON -D LLVM_LINK_LLVM_DYLIB=ON -D LLVM_PARALLEL_LINK_JOBS=4 -D LLVM_TARGETS_TO_BUILD=all -D LLVM_TOOLS_INSTALL_DIR=bin -D LLVM_USE_PERF=ON -D LLVM_UTILS_INSTALL_DIR=/usr/bin -D LLVM_VERSION_SUFFIX= -D SPHINX_EXECUTABLE=/usr/bin/sphinx-build -D SPHINX_OUTPUT_HTML=ON -D SPHINX_OUTPUT_MAN=ON -D SPHINX_WARNINGS_AS_ERRORS=OFF -D LLVM_LIBDIR_SUFFIX=64 -D LLVM_BINUTILS_INCDIR=/usr/include
CMake Error at CMakeLists.txt:13 (include):
include could not find requested file:
/home/tkloczko/rpmbuild/BUILD/llvm-16.0.0.src/../cmake/Modules/CMakePolicy.cmake
-- The C compiler identification is GNU 13.0.1
-- The CXX compiler identification is GNU 13.0.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python3: /usr/bin/python3.8 (found suitable version "3.8.16", minimum required is "3.6") found components: Interpreter
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for link.h
-- Looking for link.h - found
-- Looking for malloc/malloc.h
-- Looking for malloc/malloc.h - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - found
-- Looking for sys/mman.h
-- Looking for sys/mman.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sysexits.h
-- Looking for sysexits.h - found
-- Looking for termios.h
-- Looking for termios.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for valgrind/valgrind.h
-- Looking for valgrind/valgrind.h - found
-- Looking for fenv.h
-- Looking for fenv.h - found
-- Looking for FE_ALL_EXCEPT
-- Looking for FE_ALL_EXCEPT - found
-- Looking for FE_INEXACT
-- Looking for FE_INEXACT - found
-- Looking for mach/mach.h
-- Looking for mach/mach.h - not found
-- Looking for CrashReporterClient.h
-- Looking for CrashReporterClient.h - not found
-- Looking for linux/magic.h
-- Looking for linux/magic.h - found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Looking for pthread_rwlock_init in pthread
-- Looking for pthread_rwlock_init in pthread - found
-- Looking for pthread_mutex_lock in pthread
-- Looking for pthread_mutex_lock in pthread - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for pfm_initialize in pfm
-- Looking for pfm_initialize in pfm - not found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- Looking for compress2
-- Looking for compress2 - found
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.10.3")
-- Looking for xmlReadMemory
-- Looking for xmlReadMemory - found
-- Looking for histedit.h
-- Looking for histedit.h - found
-- Found LibEdit: /usr/include (found version "2.11")
-- Performing Test Terminfo_LINKABLE
-- Performing Test Terminfo_LINKABLE - Success
-- Found Terminfo: /usr/lib64/libtinfo.so
-- Looking for xar_open in xar
-- Looking for xar_open in xar - not found
-- Looking for arc4random
-- Looking for arc4random - found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Looking for __register_frame
-- Looking for __register_frame - found
-- Looking for __deregister_frame
-- Looking for __deregister_frame - found
-- Looking for __unw_add_dynamic_fde
-- Looking for __unw_add_dynamic_fde - not found
-- Looking for _Unwind_Backtrace
-- Looking for _Unwind_Backtrace - found
-- Looking for getpagesize
-- Looking for getpagesize - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for setrlimit
-- Looking for setrlimit - found
-- Looking for isatty
-- Looking for isatty - found
-- Looking for futimens
-- Looking for futimens - found
-- Looking for futimes
-- Looking for futimes - found
-- Looking for sigaltstack
-- Looking for sigaltstack - found
-- Looking for mallctl
-- Looking for mallctl - not found
-- Looking for mallinfo
-- Looking for mallinfo - found
-- Looking for mallinfo2
-- Looking for mallinfo2 - found
-- Looking for malloc_zone_statistics
-- Looking for malloc_zone_statistics - not found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for posix_spawn
-- Looking for posix_spawn - found
-- Looking for pread
-- Looking for pread - found
-- Looking for sbrk
-- Looking for sbrk - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strerror_r
-- Looking for strerror_r - found
-- Looking for strerror_s
-- Looking for strerror_s - not found
-- Looking for setenv
-- Looking for setenv - found
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC - Failed
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC - Success
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - found
-- Looking for pthread_getname_np
-- Looking for pthread_getname_np - found
-- Looking for pthread_setname_np
-- Looking for pthread_setname_np - found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for dladdr
-- Looking for dladdr - found
-- Performing Test HAVE_FFI_CALL
-- Performing Test HAVE_FFI_CALL - Success
-- Found FFI: /usr/lib64/libffi.so
-- Looking for proc_pid_rusage
-- Looking for proc_pid_rusage - not found
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Success
-- Performing Test LLVM_HAS_ATOMICS
-- Performing Test LLVM_HAS_ATOMICS - Success
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG - Success
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Failed
-- Performing Test HAS_MAYBE_UNINITIALIZED
-- Performing Test HAS_MAYBE_UNINITIALIZED - Success
-- Native target architecture is X86
-- Threads enabled.
-- Doxygen disabled.
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- Found Python module pygments
-- Found Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- LLVM host triple: x86_64-unknown-linux-gnu
-- LLVM default target triple: x86_64-unknown-linux-gnu
CMake Warning at cmake/modules/HandleLLVMOptions.cmake:58 (message):
Job pooling is only available with Ninja generators.
Call Stack (most recent call first):
CMakeLists.txt:888 (include)
-- Performing Test C_SUPPORTS_FPIC
-- Performing Test C_SUPPORTS_FPIC - Success
-- Performing Test CXX_SUPPORTS_FPIC
-- Performing Test CXX_SUPPORTS_FPIC - Success
-- Building with -fPIC
-- Performing Test C_SUPPORTS_FNO_SEMANTIC_INTERPOSITION
-- Performing Test C_SUPPORTS_FNO_SEMANTIC_INTERPOSITION - Success
-- Performing Test CXX_SUPPORTS_FNO_SEMANTIC_INTERPOSITION
-- Performing Test CXX_SUPPORTS_FNO_SEMANTIC_INTERPOSITION - Success
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success
-- Performing Test C_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG
-- Performing Test C_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG - Failed
-- Performing Test CXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG
-- Performing Test CXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG - Failed
-- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
-- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
-- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG - Success
-- Performing Test CXX_SUPPORTS_REDUNDANT_MOVE_FLAG
-- Performing Test CXX_SUPPORTS_REDUNDANT_MOVE_FLAG - Success
-- Performing Test CXX_SUPPORTS_PESSIMIZING_MOVE_FLAG
-- Performing Test CXX_SUPPORTS_PESSIMIZING_MOVE_FLAG - Success
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG - Success
-- Performing Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR
-- Performing Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR - Failed
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Success
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL - Success
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Failed
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Failed
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Failed
-- Performing Test CXX_SUPPORTS_MISLEADING_INDENTATION_FLAG
-- Performing Test CXX_SUPPORTS_MISLEADING_INDENTATION_FLAG - Success
-- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
-- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Failed
-- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
-- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Success
-- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS
-- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS - Success
-- Performing Test C_SUPPORTS_FFUNCTION_SECTIONS
-- Performing Test C_SUPPORTS_FFUNCTION_SECTIONS - Success
-- Performing Test CXX_SUPPORTS_FFUNCTION_SECTIONS
-- Performing Test CXX_SUPPORTS_FFUNCTION_SECTIONS - Success
-- Performing Test C_SUPPORTS_FDATA_SECTIONS
-- Performing Test C_SUPPORTS_FDATA_SECTIONS - Success
-- Performing Test CXX_SUPPORTS_FDATA_SECTIONS
-- Performing Test CXX_SUPPORTS_FDATA_SECTIONS - Success
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
CMake Warning at cmake/modules/VersionFromVCS.cmake:49 (message):
Git not found. Version cannot be determined.
Call Stack (most recent call first):
CMakeLists.txt:1042 (get_source_info)
-- Linker detection: GNU ld
-- Performing Test HAS_WERROR_GLOBAL_CTORS
-- Performing Test HAS_WERROR_GLOBAL_CTORS - Failed
-- Looking for __x86_64__
-- Looking for __x86_64__ - found
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- Targeting AArch64
-- Targeting AMDGPU
-- Targeting ARM
-- Targeting AVR
-- Targeting BPF
-- Targeting Hexagon
-- Targeting Lanai
-- Targeting LoongArch
-- Targeting Mips
-- Targeting MSP430
-- Targeting NVPTX
-- Targeting PowerPC
-- Targeting RISCV
-- Targeting Sparc
-- Targeting SystemZ
-- Targeting VE
-- Targeting WebAssembly
-- Targeting X86
-- Targeting XCore
CMake Error at CMakeLists.txt:1176 (add_subdirectory):
add_subdirectory given source
"/home/tkloczko/rpmbuild/BUILD/llvm-16.0.0.src/../third-party/unittest"
which is not an existing directory.
-- Registering ExampleIRTransforms as a pass plugin (static build: OFF)
-- Registering Bye as a pass plugin (static build: OFF)
CMake Warning at cmake/modules/AddLLVM.cmake:1849 (message):
LLVM_EXTERNAL_LIT set to /usr/bin/lit, but the path does not exist.
Call Stack (most recent call first):
cmake/modules/AddLLVM.cmake:1894 (get_llvm_lit_path)
cmake/modules/AddLLVM.cmake:1984 (add_lit_target)
utils/lit/CMakeLists.txt:23 (add_lit_testsuite)
-- Sphinx enabled.
-- Found Sphinx: /usr/bin/sphinx-build
-- Configuring incomplete, errors occurred!
```
libcxx, libcxxabi circular build dependencies
opened 12:07PM - 22 May 22 UTC
libc++
libc++abi
build-problem
Trying to build unpatched `libcxx` it fails because it requires being built in a… monorepo layout with libcxxabi:
</details>
```console
+ /usr/bin/cmake -B x86_64-redhat-linux-gnu -D BUILD_SHARED_LIBS=ON -D CMAKE_AR=/usr/bin/gcc-ar -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_FLAGS_RELEASE=-DNDEBUG -D CMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -D CMAKE_Fortran_FLAGS_RELEASE=-DNDEBUG -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_NM=/usr/bin/gcc-nm -D CMAKE_RANLIB=/usr/bin/gcc-ranlib -D CMAKE_VERBOSE_MAKEFILE=ON -D INCLUDE_INSTALL_DIR=/usr/include -D LIB_INSTALL_DIR=/usr/lib64 -D LIB_SUFFIX=64 -D SHARE_INSTALL_PREFIX=/usr/share -D SYSCONF_INSTALL_DIR=/etc -S . -D CXX_ENABLE_RTTI=ON -D LIBCXXABI_USE_LLVM_UNWINDER=OFF -D LIBCXX_CXX_ABI_INCLUDE_PATHS=/usr/include -D LIBCXX_CXX_ABI=libcxxabi -D LIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON -D LIBCXX_ENABLE_ASSERTIONS=OFF -D LIBCXX_ENABLE_DEBUG_MODE_SUPPORT=OFF -D LIBCXX_ENABLE_EXCEPTIONS=ON -D LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF -D LIBCXX_ENABLE_SHARED=ON -D LIBCXX_ENABLE_STATIC_ABI_LIBRARY=OFF -D LIBCXX_ENABLE_STATIC=OFF -D LIBCXX_ENABLE_STDIN=ON -D LIBCXX_ENABLE_STDOUT=ON -D LIBCXX_ENABLE_THREADS=ON -D LIBCXX_ENABLE_WERROR=OFF -D LIBCXX_INCLUDE_TESTS=OFF -D LIBCXX_INSTALL_HEADERS=ON -D LIBCXX_INSTALL_LIBRARY=ON -D LIBCXX_INSTALL_SHARED_LIBRARY=ON -D LIBCXX_STANDALONE_BUILD=ON -D LIBCXX_USE_COMPILER_RT=OFF -D LLVM_EXTERNAL_LIT=/usr/bin/lit -D PYTHON_EXECUTABLE=/usr/bin/python3 -D PYTHONINTERP_FOUND=ON -D LIBCXX_LIBDIR_SUFFIX=64
CMake Error at CMakeLists.txt:5 (message):
libc++ now requires being built in a monorepo layout with libcxxabi
available
-- Configuring incomplete, errors occurred!
```
</details>
I found fedora patch
```patch
From fc46c464795f965c4cdbc321058f24191af8e40c Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Tue, 11 Aug 2020 07:55:18 -0700
Subject: [PATCH] [PATCH][libcxx] Remove monorepo requirement
---
libcxx/CMakeLists.txt | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 9bf1a02..5348a15 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -1,10 +1,3 @@
-# See https://libcxx.llvm.org/docs/BuildingLibcxx.html for instructions on how
-# to build libcxx with CMake.
-
-if (NOT IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../libcxxabi")
- message(FATAL_ERROR "libc++ now requires being built in a monorepo layout with libcxxabi available")
-endif()
-
#===============================================================================
# Setup Project
#===============================================================================
@@ -39,8 +32,6 @@
include(GNUInstallDirs)
if (LIBCXX_STANDALONE_BUILD)
- # Find the LLVM sources and simulate LLVM CMake options.
- include(HandleOutOfTreeLLVM)
find_package(Python3 COMPONENTS Interpreter)
if(NOT Python3_Interpreter_FOUND)
--
1.8.3.1
```
However it did not helped and looks like on building `libcxx` and `libcxxabi` usign non-nomo repo tar balls `libcxx` cmake passes without installed `libcxxabi` devel resources
<details>
```console
+ /usr/bin/cmake -B x86_64-redhat-linux-gnu -D BUILD_SHARED_LIBS=ON -D CMAKE_AR=/usr/bin/gcc-ar -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_FLAGS_RELEASE=-DNDEBUG -D CMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -D CMAKE_Fortran_FLAGS_RELEASE=-DNDEBUG -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_NM=/usr/bin/gcc-nm -D CMAKE_RANLIB=/usr/bin/gcc-ranlib -D CMAKE_VERBOSE_MAKEFILE=ON -D INCLUDE_INSTALL_DIR=/usr/include -D LIB_INSTALL_DIR=/usr/lib64 -D LIB_SUFFIX=64 -D SHARE_INSTALL_PREFIX=/usr/share -D SYSCONF_INSTALL_DIR=/etc -S . -D CXX_ENABLE_RTTI=ON -D LIBCXXABI_USE_LLVM_UNWINDER=OFF -D LIBCXX_CXX_ABI_INCLUDE_PATHS=/usr/include -D LIBCXX_CXX_ABI=libcxxabi -D LIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON -D LIBCXX_ENABLE_ASSERTIONS=OFF -D LIBCXX_ENABLE_DEBUG_MODE_SUPPORT=OFF -D LIBCXX_ENABLE_EXCEPTIONS=ON -D LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF -D LIBCXX_ENABLE_SHARED=ON -D LIBCXX_ENABLE_STATIC_ABI_LIBRARY=OFF -D LIBCXX_ENABLE_STATIC=OFF -D LIBCXX_ENABLE_STDIN=ON -D LIBCXX_ENABLE_STDOUT=ON -D LIBCXX_ENABLE_THREADS=ON -D LIBCXX_ENABLE_WERROR=OFF -D LIBCXX_INCLUDE_TESTS=OFF -D LIBCXX_INSTALL_HEADERS=ON -D LIBCXX_INSTALL_LIBRARY=ON -D LIBCXX_INSTALL_SHARED_LIBRARY=ON -D LIBCXX_STANDALONE_BUILD=ON -D LIBCXX_USE_COMPILER_RT=OFF -D LLVM_EXTERNAL_LIT=/usr/bin/lit -D PYTHON_EXECUTABLE=/usr/bin/python3 -D PYTHONINTERP_FOUND=ON -D LIBCXX_LIBDIR_SUFFIX=64
CMake Warning at CMakeLists.txt:24 (message):
The Standalone build is deprecated in this release. Please use one of the
ways described at https://libcxx.llvm.org/BuildingLibcxx.html for building
libc++.
-- The CXX compiler identification is GNU 12.1.1
-- The C compiler identification is GNU 12.1.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Could NOT find FFI (missing: FFI_LIBRARIES HAVE_FFI_CALL)
-- Could NOT find Terminfo (missing: Terminfo_LIBRARIES Terminfo_LINKABLE)
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-- Found Python3: /usr/bin/python3.8 (found version "3.8.13") found components: Interpreter
-- Performing Test LIBCXX_SUPPORTS_UNWINDLIB_NONE_FLAG
-- Performing Test LIBCXX_SUPPORTS_UNWINDLIB_NONE_FLAG - Failed
-- Looking for fopen in c
-- Looking for fopen in c - found
-- Looking for __gcc_personality_v0 in gcc_s
-- Looking for __gcc_personality_v0 in gcc_s - found
-- Performing Test LIBCXX_SUPPORTS_NOSTDLIBXX_FLAG
-- Performing Test LIBCXX_SUPPORTS_NOSTDLIBXX_FLAG - Failed
-- Performing Test LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG
-- Performing Test LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG - Success
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Looking for ccos in m
-- Looking for ccos in m - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for __atomic_fetch_add_8 in atomic
-- Looking for __atomic_fetch_add_8 in atomic - found
-- Looking for cxxabi.h in /usr/include
-- Looking for cxxabi.h in /usr/include - not found
CMake Warning at cmake/Modules/HandleLibCXXABI.cmake:77 (message):
Failed to find cxxabi.h in /usr/include
Call Stack (most recent call first):
cmake/Modules/HandleLibCXXABI.cmake:118 (setup_abi_lib)
CMakeLists.txt:511 (include)
-- Looking for __cxxabi_config.h in /usr/include
-- Looking for __cxxabi_config.h in /usr/include - not found
CMake Warning at cmake/Modules/HandleLibCXXABI.cmake:77 (message):
Failed to find __cxxabi_config.h in /usr/include
Call Stack (most recent call first):
cmake/Modules/HandleLibCXXABI.cmake:118 (setup_abi_lib)
CMakeLists.txt:511 (include)
-- Performing Test LIBCXX_SUPPORTS_FALIGNED_ALLOCATION_FLAG
-- Performing Test LIBCXX_SUPPORTS_FALIGNED_ALLOCATION_FLAG - Failed
-- Performing Test LIBCXX_SUPPORTS_NOSTDINCXX_FLAG
-- Performing Test LIBCXX_SUPPORTS_NOSTDINCXX_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
-- Performing Test LIBCXX_SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WALL_FLAG
-- Performing Test LIBCXX_SUPPORTS_WALL_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WEXTRA_FLAG
-- Performing Test LIBCXX_SUPPORTS_WEXTRA_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_W_FLAG
-- Performing Test LIBCXX_SUPPORTS_W_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WWRITE_STRINGS_FLAG
-- Performing Test LIBCXX_SUPPORTS_WWRITE_STRINGS_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WNO_UNUSED_PARAMETER_FLAG
-- Performing Test LIBCXX_SUPPORTS_WNO_UNUSED_PARAMETER_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WNO_LONG_LONG_FLAG
-- Performing Test LIBCXX_SUPPORTS_WNO_LONG_LONG_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG
-- Performing Test LIBCXX_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WEXTRA_SEMI_FLAG
-- Performing Test LIBCXX_SUPPORTS_WEXTRA_SEMI_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WUNDEF_FLAG
-- Performing Test LIBCXX_SUPPORTS_WUNDEF_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WFORMAT_NONLITERAL_FLAG
-- Performing Test LIBCXX_SUPPORTS_WFORMAT_NONLITERAL_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WNO_LITERAL_SUFFIX_FLAG
-- Performing Test LIBCXX_SUPPORTS_WNO_LITERAL_SUFFIX_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WNO_CXX14_COMPAT_FLAG
-- Performing Test LIBCXX_SUPPORTS_WNO_CXX14_COMPAT_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WNO_NOEXCEPT_TYPE_FLAG
-- Performing Test LIBCXX_SUPPORTS_WNO_NOEXCEPT_TYPE_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WNO_SUGGEST_OVERRIDE_FLAG
-- Performing Test LIBCXX_SUPPORTS_WNO_SUGGEST_OVERRIDE_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_WNO_ERROR_FLAG
-- Performing Test LIBCXX_SUPPORTS_WNO_ERROR_FLAG - Success
-- Performing Test LIBCXX_SUPPORTS_EHSC_FLAG
-- Performing Test LIBCXX_SUPPORTS_EHSC_FLAG - Failed
-- Performing Test LIBCXX_SUPPORTS_ZL_FLAG
-- Performing Test LIBCXX_SUPPORTS_ZL_FLAG - Failed
-- Performing Test LIBCXX_SUPPORTS_NODEFAULTLIB_FLAG
-- Performing Test LIBCXX_SUPPORTS_NODEFAULTLIB_FLAG - Failed
CMake Warning at benchmarks/CMakeLists.txt:7 (message):
The libc++ benchmarks are not available in a standalone build. Please
migrate to an official build as documented in
https://libcxx.llvm.org/BuildingLibcxx.html.
-- Configuring done
-- Generating done
```
</details>
However after that build fails on
<details>
```console
[ 92%] Building CXX object src/CMakeFiles/cxx_shared.dir/exception.cpp.o
cd /home/tkloczko/rpmbuild/BUILD/libcxx-14.0.3.src/x86_64-redhat-linux-gnu/src && /usr/bin/g++ -DNDEBUG -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -I/home/tkloczko/rpmbuild/BUILD/libcxx-14.0.3.src/x86_64-redhat-linux-gnu/include/c++build -I/home/tkloczko/rpmbuild/BUILD/libcxx-14.0.3.src/src -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -DNDEBUG -fPIC -DLIBCXX_BUILDING_LIBCXXABI -nostdinc++ -fvisibility-inlines-hidden -Wall -Wextra -W -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wformat-nonliteral -Wno-literal-suffix -Wno-c++14-compat -Wno-noexcept-type -Wno-suggest-override -Wno-error -I/home/tkloczko/rpmbuild/BUILD/libcxx-14.0.3.src/x86_64-redhat-linux-gnu/include/c++/v1 -std=c++20 -MD -MT src/CMakeFiles/cxx_shared.dir/exception.cpp.o -MF CMakeFiles/cxx_shared.dir/exception.cpp.o.d -o CMakeFiles/cxx_shared.dir/exception.cpp.o -c /home/tkloczko/rpmbuild/BUILD/libcxx-14.0.3.src/src/exception.cpp
/home/tkloczko/rpmbuild/BUILD/libcxx-14.0.3.src/src/exception.cpp:14:12: fatal error: cxxabi.h: No such file or directory
14 | #include <cxxabi.h>
| ^~~~~~~~~~
compilation terminated.
```
</details>
On building `libcxxabi` cmake requires `-D LIBCXXABI_LIBCXX_INCLUDES` so in that case that requires to have installed `libcxx` devel resources.
In other words there is circular dependency between those two when
clang issue (this one is solved by patch which is proposed by fedora clang maintainer)
opened 05:29PM - 13 Apr 22 UTC
build-problem
I hve problem with build 14.0.0 and just checked that the same still is on 14.0.… 1.
After build and install llvm I cannot build clang becaue cmake fails.
clang cmake is executed with:
```spec
%build
%cmake \
-D BUILD_SHARED_LIBS=OFF \
-D CLANG_BUILD_EXAMPLES=OFF \
-D CLANG_ENABLE_ARCMT=ON \
-D CLANG_ENABLE_STATIC_ANALYZER=ON \
-D CLANG_INCLUDE_DOCS=ON \
-D CLANG_INCLUDE_TESTS=ON \
-D CLANG_LINK_CLANG_DYLIB=ON \
-D CLANG_PLUGIN_SUPPORT=ON \
-D CLANG_REPOSITORY_STRING="G2V %{version}-%{release}" \
-D CMAKE_C_FLAGS_RELWITHDEBINFO="%{build_cflags} -DNDEBUG" \
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="%{build_cxxflags} -DNDEBUG" \
-D CMAKE_INSTALL_RPATH:BOOL=";" \
-D ENABLE_LINKER_BUILD_ID=ON \
-D LLVM_BUILD_DOCS=ON \
-D LLVM_ENABLE_EH=ON \
-D LLVM_ENABLE_RTTI=ON \
-D LLVM_ENABLE_SPHINX=ON \
-D LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=$PWD/clang-tools-extra.src \
-D LLVM_EXTERNAL_LIT=%{_bindir}/lit \
-D LLVM_LINK_LLVM_DYLIB=ON \
-D LLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \
-D LLVM_PARALLEL_LINK_JOBS=1 \
-D LLVM_TABLEGEN_EXE=%{_bindir}/llvm-tblgen \
-D PYTHON_EXECUTABLE=%__python3 \
-D SPHINX_WARNINGS_AS_ERRORS=OFF \
%if 0%{?__isa_bits} == 64
-D LLVM_LIBDIR_SUFFIX=64 \
%else
-D LLVM_LIBDIR_SUFFIX= \
%endif
%ifarch %{arm}
-D CLANG_DEFAULT_LINKER=lld \
%endif
```
and it fails with:
```console
+ /usr/bin/cmake -B x86_64-redhat-linux-gnu -D BUILD_SHARED_LIBS=ON -D CMAKE_AR=/usr/bin/gcc-ar -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_FLAGS_RELEASE=-DNDEBUG -D CMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -D CMAKE_Fortran_FLAGS_RELEASE=-DNDEBUG -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_NM=/usr/bin/gcc-nm -D CMAKE_RANLIB=/usr/bin/gcc-ranlib -D CMAKE_VERBOSE_MAKEFILE=ON -D INCLUDE_INSTALL_DIR=/usr/include -D LIB_INSTALL_DIR=/usr/lib64 -D LIB_SUFFIX=64 -D SHARE_INSTALL_PREFIX=/usr/share -D SYSCONF_INSTALL_DIR=/etc -S . -D BUILD_SHARED_LIBS=OFF -D CLANG_BUILD_EXAMPLES=OFF -D CLANG_ENABLE_ARCMT=ON -D CLANG_ENABLE_STATIC_ANALYZER=ON -D CLANG_INCLUDE_DOCS=ON -D CLANG_INCLUDE_TESTS=ON -D CLANG_LINK_CLANG_DYLIB=ON -D CLANG_PLUGIN_SUPPORT=ON -D 'CLANG_REPOSITORY_STRING=G2V 14.0.1-2.fc35' -D 'CMAKE_C_FLAGS_RELWITHDEBINFO=-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -DNDEBUG' -D 'CMAKE_CXX_FLAGS_RELWITHDEBINFO=-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -DNDEBUG' -D 'CMAKE_INSTALL_RPATH:BOOL=;' -D ENABLE_LINKER_BUILD_ID=ON -D LLVM_BUILD_DOCS=ON -D LLVM_ENABLE_EH=ON -D LLVM_ENABLE_RTTI=ON -D LLVM_ENABLE_SPHINX=ON -D LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=/home/tkloczko/rpmbuild/BUILD/clang-14.0.1.src/clang-tools-extra.src -D LLVM_EXTERNAL_LIT=/usr/bin/lit -D LLVM_LINK_LLVM_DYLIB=ON -D LLVM_MAIN_SRC_DIR=/usr/share/llvm/src -D LLVM_PARALLEL_LINK_JOBS=1 -D LLVM_TABLEGEN_EXE=/usr/bin/llvm-tblgen -D PYTHON_EXECUTABLE=/usr/bin/python3 -D SPHINX_WARNINGS_AS_ERRORS=OFF -D LLVM_LIBDIR_SUFFIX=64
-- The C compiler identification is GNU 12.0.1
-- The CXX compiler identification is GNU 12.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_FFI_CALL
-- Performing Test HAVE_FFI_CALL - Success
-- Found FFI: /usr/lib64/libffi.so
-- Performing Test Terminfo_LINKABLE
-- Performing Test Terminfo_LINKABLE - Success
-- Found Terminfo: /usr/lib64/libtinfo.so
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.9.13")
-- Linker detection: GNU ld
CMake Warning at /usr/lib64/cmake/llvm/HandleLLVMOptions.cmake:57 (message):
Job pooling is only available with Ninja generators.
Call Stack (most recent call first):
CMakeLists.txt:118 (include)
-- Performing Test C_SUPPORTS_FPIC
-- Performing Test C_SUPPORTS_FPIC - Success
-- Performing Test CXX_SUPPORTS_FPIC
-- Performing Test CXX_SUPPORTS_FPIC - Success
-- Building with -fPIC
-- Performing Test C_SUPPORTS_FNO_SEMANTIC_INTERPOSITION
-- Performing Test C_SUPPORTS_FNO_SEMANTIC_INTERPOSITION - Success
-- Performing Test CXX_SUPPORTS_FNO_SEMANTIC_INTERPOSITION
-- Performing Test CXX_SUPPORTS_FNO_SEMANTIC_INTERPOSITION - Success
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success
-- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
-- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
-- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG - Success
-- Performing Test CXX_SUPPORTS_REDUNDANT_MOVE_FLAG
-- Performing Test CXX_SUPPORTS_REDUNDANT_MOVE_FLAG - Success
-- Performing Test CXX_SUPPORTS_PESSIMIZING_MOVE_FLAG
-- Performing Test CXX_SUPPORTS_PESSIMIZING_MOVE_FLAG - Success
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG - Success
-- Performing Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR
-- Performing Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR - Failed
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Success
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL - Success
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Failed
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Failed
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Failed
-- Performing Test C_SUPPORTS_MISLEADING_INDENTATION_FLAG
-- Performing Test C_SUPPORTS_MISLEADING_INDENTATION_FLAG - Success
-- Performing Test CXX_SUPPORTS_MISLEADING_INDENTATION_FLAG
-- Performing Test CXX_SUPPORTS_MISLEADING_INDENTATION_FLAG - Success
-- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS
-- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS - Success
-- Performing Test C_SUPPORTS_FFUNCTION_SECTIONS
-- Performing Test C_SUPPORTS_FFUNCTION_SECTIONS - Success
-- Performing Test CXX_SUPPORTS_FFUNCTION_SECTIONS
-- Performing Test CXX_SUPPORTS_FFUNCTION_SECTIONS - Success
-- Performing Test C_SUPPORTS_FDATA_SECTIONS
-- Performing Test C_SUPPORTS_FDATA_SECTIONS - Success
-- Performing Test CXX_SUPPORTS_FDATA_SECTIONS
-- Performing Test CXX_SUPPORTS_FDATA_SECTIONS - Success
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Found Python3: /usr/bin/python3.8 (found suitable version "3.8.13", minimum required is "3.0") found components: Interpreter
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Clang version: 14.0.1
-- Performing Test CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG
-- Performing Test CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG - Failed
-- Found Git: /usr/bin/git (found version "2.35.1")
-- Looking for include file sys/inotify.h
-- Looking for include file sys/inotify.h - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Success
-- Performing Test LLVM_HAS_ATOMICS
-- Performing Test LLVM_HAS_ATOMICS - Success
-- Not building amdgpu-arch: hsa-runtime64 not found
-- Sphinx enabled.
-- Found Sphinx: /usr/bin/sphinx-build
-- Configuring done
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target "check-all" does not exist.
Call Stack (most recent call first):
CMakeLists.txt:583 (add_lit_target)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target "check-clang-tools" does not
exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1842 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:110 (add_lit_testsuite)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target "check-clang-extra-unit" does
not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target
"check-clang-extra-clang-apply-replacements" does not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target
"check-clang-extra-clang-change-namespace" does not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target "check-clang-extra-clang-doc"
does not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target
"check-clang-extra-clang-include-fixer" does not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target "check-clang-extra-clang-move"
does not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target "check-clang-extra-clang-query"
does not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target
"check-clang-extra-clang-reorder-fields" does not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target "check-clang-extra-clang-tidy"
does not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target
"check-clang-extra-clang-tidy-checkers" does not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target
"check-clang-extra-clang-tidy-infrastructure" does not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target "check-clang-extra-modularize"
does not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
CMake Error at /usr/lib64/cmake/llvm/AddLLVM.cmake:1821 (add_dependencies):
The dependency target "LLVMHello" of target "check-clang-extra-pp-trace"
does not exist.
Call Stack (most recent call first):
/usr/lib64/cmake/llvm/AddLLVM.cmake:1877 (add_lit_target)
clang-tools-extra.src/test/CMakeLists.txt:118 (add_lit_testsuites)
-- Generating done
```
I'm building and installing all software using rpm packages so it is not caused by ysome left over pieces from previouse versions.
I've checked llvm source tree and I dont see any cmake module in source tree which may be related to that `LLVMHello` target.
```console
[tkloczko@devel-g2v llvm-14.0.1.src]$ grep -r LLVMHello
docs/WritingAnLLVMPass.rst: add_llvm_library( LLVMHello MODULE
docs/WritingAnLLVMPass.rst:is to be compiled and linked into a shared object ``$(LEVEL)/lib/LLVMHello.so`` that
docs/WritingAnLLVMPass.rst:"``lib/LLVMHello.so``". Note that everything in this file is
docs/WritingAnLLVMPass.rst: $ opt -load lib/LLVMHello.so -hello < hello.bc > /dev/null
docs/WritingAnLLVMPass.rst: $ opt -load lib/LLVMHello.so -help
docs/WritingAnLLVMPass.rst: $ opt -load lib/LLVMHello.so -hello -time-passes < hello.bc > /dev/null
docs/WritingAnLLVMPass.rst: $ opt -load lib/LLVMHello.so -gvn -licm --debug-pass=Structure < hello.bc > /dev/null
docs/WritingAnLLVMPass.rst: $ opt -load lib/LLVMHello.so -gvn -hello -licm --debug-pass=Structure < hello.bc > /dev/null
docs/WritingAnLLVMPass.rst: $ opt -load lib/LLVMHello.so -gvn -hello -licm --debug-pass=Structure < hello.bc > /dev/null
lib/Transforms/Hello/CMakeLists.txt:add_llvm_library( LLVMHello MODULE BUILDTREE_ONLY
test/CMakeLists.txt: LLVMHello
utils/gn/secondary/llvm/lib/Transforms/Hello/BUILD.gn: output_name = "LLVMHello"
utils/gn/secondary/llvm/lib/Transforms/Hello/BUILD.gn: # LLVMHello doesn't want to link in any LLVM code, it just
```
Similar situation in clang source tree:
```console
[tkloczko@devel-g2v clang-14.0.1.src]$ grep -r LLVMHello
clang-tools-extra.src/test/CMakeLists.txt: # LLVMHello library is needed below
clang-tools-extra.src/test/CMakeLists.txt: AND NOT TARGET LLVMHello)
clang-tools-extra.src/test/CMakeLists.txt: list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule LLVMHello)
clang-tools-extra.src/test/clang-tidy/CTTestTidyModule.cpp:// RUN: clang-tidy -checks='-*,mytest*' --list-checks -load %llvmshlibdir/CTTestTidyModule%pluginext -load %llvmshlibdir/LLVMHello%pluginext | FileCheck --check-prefix=CHECK-LIST %s
```
At the same time I see DSO with that name in llvm package
```console
[tkloczko@devel-g2v clang-14.0.1.src]$ rpm -ql llvm-14.0.1 | grep LLVMHello
/usr/lib64/LLVMHello.so
```
May I ask fo some hint what could be wront in this case?
Is it any intention to bring that to working state?
This comes up from time to time but there is really low interest from the community to make standalone builds work. I think it will only be rectified if someone steps up and works on it.
I think the only reason we still publish the separate tarballs is because some distributions need it. But I think we maybe should rethink this considering how busted standalone builds are.
If no one from maintainers cares and it does not work why still those dist tar balls are provided?
There are many discussions about this in various threads:
llvm-project has traditionally supported the so-called “standalone builds”. I cannot find good documentation but it appears to be something like the following, specifying a toplevel project directory as CMake’s -S argument. Unfortunately with current main branch I get some errors:
% cmake -Sclang -B/tmp/out/clang -GNinja
...
CMake Error at CMakeLists.txt:89 (include):
include could not find requested file:
GetErrcMessages
...
CMake Error at cmake/modules/AddLLD.cmake:17 (get_target_expor…
And
TLDR; Skip to the Proposal section.
Hi,
Since the migration to the monorepo and Github, stand-alone build configurations for LLVM have existed in a very ambiguous state. There’s no documentation for how to use them, no buildbots testing them, and yet we still make a best effort to support this configuration in tree.
I would like to propose that we come up with concrete requirements for stand-alone builds and make sure that they are a supported build configuration going forward.
What are sta…
Those might give you an insight into why they are still around.
Agree.
In general, My feeling is that Linux distribution packagers (at least Gentoo (@mgorny ) and RedHat/Fedora (@tstellar )) care about stand-alone build support, but most personal and corporate contributors use the whole repository.
Almost all upstream and downstream build bots use the whole repository - this gives the community coverage for many configurations (there are numerous CMake variables to tune for a build). But the standalone build has only testing for very specific configurations, just the few that some distributions use. So there are likely many rough edges.
Up to now none of the replies changes any state of broken per subproject source dist tar balls.
Is it possible at least commit patch which I’v proposed?
If you submit patches via Phabricator, I would be surprised if they where denied. You might have a problem finding a reviewer since no-one really cares about these things, but offering the patches always helps push things forward.
The per sub-project tar balls are really meant to be used the same way one would use sparse checkouts from the git repository. There are still dependencies between sub-projects that make it impossible to build some of the sub-projects with a single tarball. For llvm, clang, and lld, the required sub-directories are documented here .
@kloczek I think the best way to approach this problem would be to document which dependencies are currently needed for the various tarballs you are interested in. Once we have this, we can look at how to prune the dependencies and fix the build issues if necessary.
Also, If you have some outstanding patches, you can add me as a reviewer and/or ping them, so they show up in my email.
tstellar:
The per sub-project tar balls are really meant to be used the same way one would use sparse checkouts from the git repository. There are still dependencies between sub-projects that make it impossible to build some of the sub-projects with a single tarball. For llvm, clang, and lld, the required sub-directories are documented here .
I cannot agree with above.
LLVM as the project is HUGE.
In case if it will be something to fix by apply single small patch on clang code it wille be possible to rebuild only clang
without wasting time on rebuilding everything.
Issue is only with libcxx and libcxxabi which requires each other on build stage so it makes sense to merge them. Such project even combined will be still one of the smallest chunks of the LLVM.
Second thing is that subproject like bolt is not ready to be build out of per subproject tar ball is not working at all which is possible to see in Fedora rpm spec file
https://src.fedoraproject.org/rpms/llvm-bolt/blob/rawhide/f/llvm-bolt.spec
The fact still stands: there is very little interest from the maintainers to have this feature. Someone would have to step up and work on it. Otherwise I think we should remove it, since it’s currently broken.
kwk
November 20, 2023, 11:04pm
11
I don’t follow the argumentation here. Fedora apparently builds bolt based on a tarball (Tree - rpms/llvm-bolt - src.fedoraproject.org ):
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{bolt_srcdir}.tar.xz
What is not working here? I mean, sure you depend on LLVM and other stuff:
BuildRequires: llvm-devel = %{version}
BuildRequires: llvm-test = %{version}
BuildRequires: python3-lit
But that’s intended.
Maybe I’m just not getting the point of your post.
kwk
November 20, 2023, 11:07pm
12
@tobiashieta what exactly is broken? Some projects refuse to work on standalone builds and others don’t support them at all or have abandoned them but this is not true for llvm, clang, lld, openmp, compiler-rt and so on. They still work “just fine” from a linux distribution perspective. The amount of downstream patches mostly doesn’t focus on standalone builds but on other stuff, at least for Fedora.