llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.69k stars 11.87k forks source link

16.0.0: llvm build wants to use files from outside of the source tree #61502

Open kloczek opened 1 year ago

kloczek commented 1 year ago

As source tar ball I'm using https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/llvm-16.0.0.src.tar.xz and cmake fails on trying to check files outside of the surce tree.

+ /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!
asl commented 1 year ago

Tagging @tstellar

Individual tarballs these days are pretty broken :(

tbaederr commented 1 year ago

Well you need the cmake-* tarball as well? That one is shared between the individual projects.

That's why Fedora uses it in [llvm][https://src.fedoraproject.org/rpms/llvm/raw/rawhide/f/llvm.spec] (Source2) and clang (Source4)

kloczek commented 1 year ago

I have alrrady installed llvm-cmake

drwxr-xr-x    2 root     root                        0 Mar 18 12:36 /usr/lib64/cmake/llvm
-rw-r--r--    1 root     root                      468 Mar 18 12:36 /usr/lib64/cmake/llvm/CMakePolicy.cmake
-rw-r--r--    1 root     root                      552 Mar 18 12:36 /usr/lib64/cmake/llvm/EnableLanguageNolink.cmake
-rw-r--r--    1 root     root                      878 Mar 18 12:36 /usr/lib64/cmake/llvm/ExtendPath.cmake
-rw-r--r--    1 root     root                     7477 Mar 18 12:36 /usr/lib64/cmake/llvm/FindGRPC.cmake
-rw-r--r--    1 root     root                     2495 Mar 18 12:36 /usr/lib64/cmake/llvm/FindLibEdit.cmake
-rw-r--r--    1 root     root                     2487 Mar 18 12:36 /usr/lib64/cmake/llvm/FindPrefixFromConfig.cmake
-rw-r--r--    1 root     root                     1553 Mar 18 12:36 /usr/lib64/cmake/llvm/GNUInstallPackageDir.cmake
-rw-r--r--    1 root     root                     5367 Mar 18 12:36 /usr/lib64/cmake/llvm/HandleCompilerRT.cmake
-rw-r--r--    1 root     root                     2843 Mar 18 12:36 /usr/lib64/cmake/llvm/HandleOutOfTreeLLVM.cmake
-rw-r--r--    1 root     root                     1235 Mar 18 12:36 /usr/lib64/cmake/llvm/LLVMCheckCompilerLinkerFlag.cmake
-rw-r--r--    1 root     root                      412 Mar 18 12:36 /usr/lib64/cmake/llvm/SetPlatformToolchainTools.cmake
-rw-r--r--    1 root     root                      807 Mar 18 12:36 /usr/lib64/cmake/llvm/SortSubset.cmake

In case of 15.0.7 other LLVM subproject where able to find those files automatically or by passing -D CMAKE_MODULE_PATH=%{_libdir}/cmake/llvm in cmake params. If clang, and other are abke to use installed cmake-llvm why llvm is not able to do the same and/or if llvm needs cmake-llvm in own tree why cmake-llvm tar ball is provided and it is not part of the llvm and that subproject is not only installing cmake-llvm files in system image to allow other LLVM subprojects use that cmake module? 🤔

kloczek commented 1 year ago

Just checked:

[tkloczko@pers-jacek llvm-16.0.0.src]$ find . -name CMakeLists.txt |xargs grep include\(llvm
[tkloczko@pers-jacek llvm-16.0.0.src]$

So looks like nowhere in llvm tree there are any incude(llvm) line.

kloczek commented 1 year ago

Individual tarballs these days are pretty broken :(

I thik that all those issues of LLVM monorepo vs indyvidual tar balls issue shoud be solved by use -D LLVM_MONOREPO=[ON|OFF] cmake option. I can understand that for CI proposes using monorepo makes everything easier however IMO in loger term using monorepo is IMO unsustanable like it was with Xorg.

kloczek commented 1 year ago

I've been trying to use patch:

--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -9,7 +9,7 @@
     "at least 3.20.0 now to avoid issues in the future!")
 endif()

-set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
+include(llvm)
 include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
   NO_POLICY_SCOPE)

but it doesn't work because what contains cmake-llvm is not regular cmake module and it causes that cmake is not able to find it.

+ /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_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:12 (include):
  include could not find requested file:

    llvm

CMake Error at CMakeLists.txt:13 (include):
  include could not find requested file:

    /Modules/CMakePolicy.cmake

Proposal:

kloczek commented 1 year ago

If that doesn't work, you could also try specifying the path to the cmake/Modules directory explicitly using the -DCMAKE_MODULE_PATH flag when invoking CMake. For example, you could try adding "-DCMAKE_MODULE_PATH=/path/to/llvm-16.0.0.src/cmake/Modules" to your CMake command.

Issue is that what is in cmake-llvm is not regular cmake module. With have installed in $(libdir}/cmake/llvm such module cmake automatialy would be able to find necessary files without altering $DCMAKE_MODULE_PATH

starball5 commented 1 year ago

Related question on Stack Overflow: LLVM-16 CMake error: CMake is not able to include CMakePolicy.cmake file, which is present at required location

tstellar commented 1 year ago

Have you followed the standalone build instructions here: https://llvm.org/docs/GettingStarted.html#stand-alone-builds There is a table in the documentation that shows which tarballs you need for each project. These instructions should work, but if it doesn't I can take a look.

kiwixz commented 1 year ago

Hi, you should pass -S llvm instead of -S ., as showcased in the getting started guide.

kloczek commented 1 year ago

Hi, you should pass -S llvm instead of -S ., as showcased in the getting started guide.

Base directory of the llvm standalone tar ball it is llvm-<version>.src/ not lvm/. After cd llvm-<version>.src/ main CMakeLists.txt is in current directory.

IMO kind of solution of monorepo vs. standalobe tar balls could be add in main https://github.com/llvm/llvm-project direcory for example .monorepo filee. This would allow to check each standalone CMakeLists.txt files to check is that file in above directory or not. With that it will be ossible o build weach standalone subproject without any additional cmake params.

Obove combined with cmake-llvm move to regular cmake module IMO shoud solve all monorepo vs. standalone projects builds.

Coments? IMO is time to ink some plan and start proceed to implemet that.

kloczek commented 1 year ago

Is it any chance to add this ticket to https://github.com/llvm/llvm-project/milestone/21? 🤔

tstellar commented 1 year ago

From what I can tell, this is working by design. In order to do stand-alone builds, you need to download and unpack all tarballs that a project (in this case llvm) depends on.

kloczek commented 1 year ago

From what I can tell, this is working by design. In order to do stand-alone builds, you need to download and unpack all tarballs that a project (in this case llvm) depends on.

And that design forces to use more thaj one subproject tar ball in case of llvm. Possible solution have been alredy presented and still no progress to stor out that issue. Q: what is going on? 🤔

Additional Qs:

tstellar commented 1 year ago

And that design forces to use more thaj one subproject tar ball in case of llvm.

Yes, we've discussed this in the past, and I think it's the best way to support the separate tarballs. It's working the exact same way a sparse checkout of the llvm-project git repo would work where you have to pick the directories you need in order to build.

  • why other LLVM subprojects are able to use system installed cmake macros and only llvm is not possible to do that?

The installed cmake macros are a distro specific modification. It's not actually possible to install the macros from the cmake/ directory in upstream code. That's why building llvm using installed cmake files is not supported. Also, officially, the we don't currently support using files from installed files from cmake/ for other projects. The fact that it works is a coincidence.

kloczek commented 1 year ago

The installed cmake macros are a distro specific modification. It's not actually possible to install the macros from the cmake/ directory in upstream code. That's why building llvm using installed cmake files is not supported. Also, officially, the we don't currently support using files from installed files from cmake/ for other projects. The fact that it works is a coincidence.

What you are describing is current state and not absolute impossibility of fixing that. Content of the cmake tar ball has notbing to do with any distros,

I can only point on fact that clang, compiler-rt, libomp and llvm-libunwind tar balls supports CMAKE_MODULE_PATH cmake option. In other words: what you described is state in which any distro which want to use standalone tar balls must use additional cmake tar ball on building llvn and usually packaging second time exactly the same cmake files to forced to build other subprojects. Why llvm subproject cmake cannot use the same CMAKE_MODULE_PATH option? 🤔

My understanding is that keeping that ticket as still opened is kind of recognition that it is the issue. Now only thing is to make decision how it would be good to solve that. When such decision could be made I can try to help fix that by submitting the PR.

Generally issue is that LLVM as project is really HUGE and total LLVM build time is really LONG. All types of packaging software assumes that on packaging fail whole packaging procedure neds to be started again. Dividing LLVM into subprojects SAVES a lot of time in case packaging all LLVM stuff because in case of any fail only rebuild of the subproject needs to be started again.

tstellar commented 1 year ago

OK, so let's try to be clear about what the request is, so we can track it better. It sounds to me like you are requesting 2 things:

  1. There should be a way to install the files from the cmake/ directory.
  2. The llvm sub-project should be able to consume the cmake files from the install directory.

Does this sound right?

Also, could you write out the exact commands you are running and what you expect to happen. This will make it easier to verify that your use case is fixed. For example:

curl -O -L https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/cmake-16.0.0.src.tar.xz
tar -xJf cmake-16.0.90.src.tar.xz
...
...
kloczek commented 1 year ago

OK, so let's try to be clear about what the request is, so we can track it better. It sounds to me like you are requesting 2 things:

  1. There should be a way to install the files from the cmake/ directory.
  2. The llvm sub-project should be able to consume the cmake files from the install directory.

Does this sound right?

Again:

kloczek commented 1 year ago

BTW: llvm 15.0.7 was possible to build with system installed cmake files. Why it has been changed if it was working? 🤔

kloczek commented 1 year ago

What is really beaking use system installed cmake files is https://github.com/llvm/llvm-project/blob/42d1b276f7793999be3f9b6a99efbb143254c729/llvm/CMakeLists.txt#L12-L14 In this case it breaks use custom -D LLVM_COMMON_CMAKE_UTILS=</some/path> because it unconditionally/blindly tries use ../cmake path.

tstellar commented 1 year ago

I don't think the why questions are all that relevant right now. We just want to know what the feature request is so that we can work on implementing it. It's not surprising that an unsupported use case would start and stop working over time or only work for some sub-projects or not others.

kloczek commented 1 year ago

So RFE is to:

kloczek commented 1 year ago

I made some JFDI patch for llvm tree to be able use system installed llvm cmake files only to discover that without that patch I would need third-party tar ball. In this situation I really don't know what to say .. 😞

kloczek commented 1 year ago

Proposal of some minimal fix which allows unpack cmake files into llvm tree and point on ot using -D LLVM_COMMON_CMAKE_UTILS=$PWD/cmake-%{version}.src/.

--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -9,7 +9,9 @@
     "at least 3.20.0 now to avoid issues in the future!")
 endif()

-set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
+if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
+  set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
+endif()
 include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
   NO_POLICY_SCOPE)

Simillar lines are alredy in compiler-rt, lld, lldb.

IMO best woild be just integrate cmake into llvm and install all necessary cmake files in $(libdir)/cmake/llmv. llvm must be build as first and its devel resources after install will be available for the rest of the LLVM projects.

I think that in case of monorepo build everty subproject exept llvm should be checking if ../llvm/cmake/Modules directory exist and if it exist add it to cmake search path.

Please let me know if you wanr above as PR.

kloczek commented 1 year ago

After finish package most of the LLVM subprojects here is cumulative patch which allows use custom LLVM_COMMON_CMAKE_UTILS cmake param which allows easier build LLVM subpeoject using per subproject dist tar balls:

--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -1,6 +1,8 @@
 cmake_minimum_required(VERSION 3.13.4)

-set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
+if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
+  set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
+endif()

 # Add path for custom modules
 list(INSERT CMAKE_MODULE_PATH 0
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -9,7 +9,9 @@
     "at least 3.20.0 now to avoid issues in the future!")
 endif()

-set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
+if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
+  set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
+endif()
 include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
   NO_POLICY_SCOPE)
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -5,7 +5,9 @@
 cmake_minimum_required(VERSION 3.13.4)
 project(libunwind C CXX ASM)

-set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
+if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
+  set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
+endif()

 # Add path for custom modules
 list(INSERT CMAKE_MODULE_PATH 0
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -19,7 +19,9 @@
   endif()
 endif()

-set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
+if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
+  set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
+endif()

 # Add path for custom compiler-rt modules.
 list(INSERT CMAKE_MODULE_PATH 0

Please let me know what should be done to have those small adjustments included in next 16.0.x release.

kloczek commented 1 year ago

Gentle ping .. should I submit that patch as PR? 🤔

esaaprillia commented 6 months ago

@kloczek

the same problem

2024-04-25T02:36:24.7287653Z make[1]: Entering directory '/home/runner/work/mosdns/mosdns/sdk'
2024-04-25T02:36:24.8764372Z make[2]: Entering directory '/home/runner/work/mosdns/mosdns/sdk/feeds/mosdns/llvm'
2024-04-25T02:36:25.3682705Z mkdir -p /home/runner/work/mosdns/mosdns/sdk/dl
2024-04-25T02:36:25.3720754Z SHELL= flock /home/runner/work/mosdns/mosdns/sdk/tmp/.llvm-18.1.4.src.tar.xz.flock -c '    /home/runner/work/mosdns/mosdns/sdk/scripts/download.pl "/home/runner/work/mosdns/mosdns/sdk/dl" "llvm-18.1.4.src.tar.xz" "skip" "" "https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.4"    '
2024-04-25T02:36:25.4090991Z . /home/runner/work/mosdns/mosdns/sdk/include/shell.sh; xzcat /home/runner/work/mosdns/mosdns/sdk/dl/llvm-18.1.4.src.tar.xz | tar -C /home/runner/work/mosdns/mosdns/sdk/build_dir/hostpkg/llvm-18.1.4.src/.. -xf -
2024-04-25T02:36:30.0100024Z [ ! -d ./src/ ] || cp -fpR ./src/* /home/runner/work/mosdns/mosdns/sdk/build_dir/hostpkg/llvm-18.1.4.src
2024-04-25T02:36:30.0141917Z touch /home/runner/work/mosdns/mosdns/sdk/build_dir/hostpkg/llvm-18.1.4.src/.prepared150ffbe4e069f8dd43a4c727bb4b5263_6664517399ebbbc92a37c5bb081b5c53
2024-04-25T02:36:30.0168210Z mkdir -p "/home/runner/work/mosdns/mosdns/sdk/build_dir/hostpkg/llvm-18.1.4.src/build"
2024-04-25T02:36:30.0221858Z (cd /home/runner/work/mosdns/mosdns/sdk/build_dir/hostpkg/llvm-18.1.4.src/build; CFLAGS="-O2 -I/home/runner/work/mosdns/mosdns/sdk/staging_dir/host/include -I/home/runner/work/mosdns/mosdns/sdk/staging_dir/hostpkg/include -I/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/host/include" CXXFLAGS="-O2 -I/home/runner/work/mosdns/mosdns/sdk/staging_dir/host/include -I/home/runner/work/mosdns/mosdns/sdk/staging_dir/hostpkg/include -I/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/host/include" LDFLAGS="-L/home/runner/work/mosdns/mosdns/sdk/staging_dir/host/lib -L/home/runner/work/mosdns/mosdns/sdk/staging_dir/hostpkg/lib -L/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/host/lib" cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER="" -DCMAKE_C_COMPILER="/home/runner/work/mosdns/mosdns/sdk/staging_dir/host/bin/gcc" -DCMAKE_CXX_COMPILER_LAUNCHER="" -DCMAKE_CXX_COMPILER="/home/runner/work/mosdns/mosdns/sdk/staging_dir/host/bin/g++" -DCMAKE_ASM_COMPILER_LAUNCHER="" -DCMAKE_ASM_COMPILER="/home/runner/work/mosdns/mosdns/sdk/staging_dir/host/bin/gcc" -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_EXE_LINKER_FLAGS:STRING="-L/home/runner/work/mosdns/mosdns/sdk/staging_dir/host/lib -L/home/runner/work/mosdns/mosdns/sdk/staging_dir/hostpkg/lib -L/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/host/lib" -DCMAKE_MODULE_LINKER_FLAGS:STRING="-L/home/runner/work/mosdns/mosdns/sdk/staging_dir/host/lib -L/home/runner/work/mosdns/mosdns/sdk/staging_dir/hostpkg/lib -L/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/host/lib" -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L/home/runner/work/mosdns/mosdns/sdk/staging_dir/host/lib -L/home/runner/work/mosdns/mosdns/sdk/staging_dir/hostpkg/lib -L/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/host/lib" -DCMAKE_FIND_ROOT_PATH="/home/runner/work/mosdns/mosdns/sdk/staging_dir/target-aarch64_generic_musl/host;/home/runner/work/mosdns/mosdns/sdk/staging_dir/hostpkg;/home/runner/work/mosdns/mosdns/sdk/staging_dir/host" -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_STRIP=: -DCMAKE_INSTALL_PREFIX=/home/runner/work/mosdns/mosdns/sdk/staging_dir/hostpkg -DCMAKE_PREFIX_PATH=/home/runner/work/mosdns/mosdns/sdk/staging_dir/hostpkg -DCMAKE_SKIP_RPATH=TRUE -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_EXPORT_PACKAGE_REGISTRY=FALSE -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE -DCMAKE_FIND_USE_PACKAGE_REGISTRY=FALSE -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=FALSE -DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=TRUE -DCMAKE_GENERATOR="Ninja" -Wno-dev -DCMAKE_BUILD_TYPE="MINSIZEREL" -DLLVM_INCLUDE_TOOLS=ON -DLLVM_BUILD_UTILS=OFF -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_BUILD_TESTS=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_GO_TESTS=OFF -DLLVM_BUILD_DOCS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_ENABLE_DOXYGEN=OFF -DLLVM_ENABLE_SPHINX=OFF -DLLVM_TARGETS_TO_BUILD="AArch64" -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_ASSERTIONS=OFF -DLLVM_ENABLE_WERROR=OFF -DLLVM_ENABLE_ZLIB=OFF -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_APPEND_VC_REV=OFF -DLLVM_ENABLE_LIBXML2=OFF -DCMAKE_EXE_LINKER_FLAGS="-Wl,--reduce-memory-overheads -Wl,--hash-size=1021 " -DLLVM_PARALLEL_LINK_JOBS=2 -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON -DLLVM_ENABLE_RTTI=ON -DLLVM_BUILD_TOOLS=OFF -DCMAKE_INSTALL_PREFIX="/home/runner/work/mosdns/mosdns/sdk/staging_dir/hostpkg/usr/lib/llvm" -DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH -DCMAKE_INSTALL_RPATH="/home/runner/work/mosdns/mosdns/sdk/staging_dir/hostpkg/usr/lib/llvm/lib" -DCMAKE_SKIP_RPATH=FALSE /home/runner/work/mosdns/mosdns/sdk/build_dir/hostpkg/llvm-18.1.4.src )
2024-04-25T02:36:30.0297322Z CMake Error at CMakeLists.txt:6 (include):
2024-04-25T02:36:30.0298320Z Not searching for unused variables given on the command line.
2024-04-25T02:36:30.0299435Z   include could not find requested file:
2024-04-25T02:36:30.0299947Z 
2024-04-25T02:36:30.0301028Z     /home/runner/work/mosdns/mosdns/sdk/build_dir/hostpkg/llvm-18.1.4.src/../cmake/Modules/CMakePolicy.cmake
2024-04-25T02:36:30.0301617Z 
2024-04-25T02:36:30.0301622Z 
2024-04-25T02:36:30.0831820Z -- The C compiler identification is GNU 11.4.0
2024-04-25T02:36:30.2319984Z -- The CXX compiler identification is GNU 11.4.0
2024-04-25T02:36:30.2470693Z -- The ASM compiler identification is GNU
2024-04-25T02:36:30.2548437Z -- Found assembler: /home/runner/work/mosdns/mosdns/sdk/staging_dir/host/bin/gcc
2024-04-25T02:36:30.2675148Z -- Detecting C compiler ABI info
2024-04-25T02:36:30.3375309Z -- Detecting C compiler ABI info - done
2024-04-25T02:36:30.3532101Z -- Check for working C compiler: /home/runner/work/mosdns/mosdns/sdk/staging_dir/host/bin/gcc - skipped
2024-04-25T02:36:30.3534660Z -- Detecting C compile features
2024-04-25T02:36:30.3539394Z -- Detecting C compile features - done
2024-04-25T02:36:30.3633733Z -- Detecting CXX compiler ABI info
2024-04-25T02:36:30.4420946Z -- Detecting CXX compiler ABI info - done
2024-04-25T02:36:30.4585197Z -- Check for working CXX compiler: /home/runner/work/mosdns/mosdns/sdk/staging_dir/host/bin/g++ - skipped
2024-04-25T02:36:30.4587684Z -- Detecting CXX compile features
2024-04-25T02:36:30.4593618Z -- Detecting CXX compile features - done
2024-04-25T02:36:30.4769076Z CMake Error at CMakeLists.txt:410 (include):
2024-04-25T02:36:30.4770253Z   include could not find requested file:
2024-04-25T02:36:30.4770701Z 
2024-04-25T02:36:30.4770883Z     GNUInstallPackageDir
2024-04-25T02:36:30.4771194Z 
2024-04-25T02:36:30.4771203Z 
2024-04-25T02:36:30.6288080Z -- Found Python3: /home/runner/work/mosdns/mosdns/sdk/staging_dir/host/bin/python3 (found suitable version "3.10.12", minimum required is "3.0") found components: Interpreter
2024-04-25T02:36:30.6335668Z -- Looking for dlfcn.h
2024-04-25T02:36:30.6991929Z -- Looking for dlfcn.h - found
2024-04-25T02:36:30.6992690Z -- Looking for errno.h
2024-04-25T02:36:30.7649476Z -- Looking for errno.h - found
2024-04-25T02:36:30.7650287Z -- Looking for fcntl.h
2024-04-25T02:36:30.8308530Z -- Looking for fcntl.h - found
2024-04-25T02:36:30.8309247Z -- Looking for link.h
2024-04-25T02:36:30.9915767Z -- Looking for link.h - found
2024-04-25T02:36:30.9916608Z -- Looking for malloc/malloc.h
2024-04-25T02:36:31.0294257Z -- Looking for malloc/malloc.h - not found
2024-04-25T02:36:31.0295058Z -- Looking for pthread.h
2024-04-25T02:36:31.0985356Z -- Looking for pthread.h - found
2024-04-25T02:36:31.0985971Z -- Looking for signal.h
2024-04-25T02:36:31.1710612Z -- Looking for signal.h - found
2024-04-25T02:36:31.1711361Z -- Looking for sys/ioctl.h
2024-04-25T02:36:31.2382222Z -- Looking for sys/ioctl.h - found
2024-04-25T02:36:31.2383056Z -- Looking for sys/mman.h
2024-04-25T02:36:31.3025796Z -- Looking for sys/mman.h - found
2024-04-25T02:36:31.3026559Z -- Looking for sys/param.h
2024-04-25T02:36:31.3734634Z -- Looking for sys/param.h - found
2024-04-25T02:36:31.3735254Z -- Looking for sys/resource.h
2024-04-25T02:36:31.4403961Z -- Looking for sys/resource.h - found
2024-04-25T02:36:31.4404795Z -- Looking for sys/stat.h
2024-04-25T02:36:31.5076474Z -- Looking for sys/stat.h - found
2024-04-25T02:36:31.5077220Z -- Looking for sys/time.h
2024-04-25T02:36:31.5738265Z -- Looking for sys/time.h - found
2024-04-25T02:36:31.5739162Z -- Looking for sys/types.h
2024-04-25T02:36:31.6414259Z -- Looking for sys/types.h - found
2024-04-25T02:36:31.6415028Z -- Looking for sysexits.h
2024-04-25T02:36:31.7065775Z -- Looking for sysexits.h - found
2024-04-25T02:36:31.7066344Z -- Looking for termios.h
2024-04-25T02:36:31.7741992Z -- Looking for termios.h - found
2024-04-25T02:36:31.7742800Z -- Looking for unistd.h
2024-04-25T02:36:31.8435154Z -- Looking for unistd.h - found
2024-04-25T02:36:31.8435803Z -- Looking for valgrind/valgrind.h
2024-04-25T02:36:31.8828615Z -- Looking for valgrind/valgrind.h - not found
2024-04-25T02:36:31.8829392Z -- Looking for fenv.h
2024-04-25T02:36:31.9612681Z -- Looking for fenv.h - found
2024-04-25T02:36:31.9613877Z -- Looking for FE_ALL_EXCEPT
2024-04-25T02:36:32.0261938Z -- Looking for FE_ALL_EXCEPT - found
2024-04-25T02:36:32.0263046Z -- Looking for FE_INEXACT
2024-04-25T02:36:32.0915972Z -- Looking for FE_INEXACT - found
2024-04-25T02:36:32.0916881Z -- Performing Test HAVE_BUILTIN_THREAD_POINTER
2024-04-25T02:36:32.1567624Z -- Performing Test HAVE_BUILTIN_THREAD_POINTER - Success
2024-04-25T02:36:32.1568548Z -- Looking for mach/mach.h
2024-04-25T02:36:32.1938997Z -- Looking for mach/mach.h - not found
2024-04-25T02:36:32.1939924Z -- Looking for CrashReporterClient.h
2024-04-25T02:36:32.2306203Z -- Looking for CrashReporterClient.h - not found
2024-04-25T02:36:32.2307076Z -- Looking for linux/magic.h
2024-04-25T02:36:32.2945972Z -- Looking for linux/magic.h - found
2024-04-25T02:36:32.2946837Z -- Looking for pthread_create in pthread
2024-04-25T02:36:32.3596061Z -- Looking for pthread_create in pthread - found
2024-04-25T02:36:32.3596637Z -- Looking for pthread_rwlock_init in pthread
2024-04-25T02:36:32.4243373Z -- Looking for pthread_rwlock_init in pthread - found
2024-04-25T02:36:32.4244247Z -- Looking for pthread_mutex_lock in pthread
2024-04-25T02:36:32.4888239Z -- Looking for pthread_mutex_lock in pthread - found
2024-04-25T02:36:32.4889136Z -- Looking for dlopen in dl
2024-04-25T02:36:32.5537302Z -- Looking for dlopen in dl - found
2024-04-25T02:36:32.5538183Z -- Looking for clock_gettime in rt
2024-04-25T02:36:32.6194675Z -- Looking for clock_gettime in rt - found
2024-04-25T02:36:32.6199675Z -- Looking for pfm_initialize in pfm
2024-04-25T02:36:32.6745445Z -- Looking for pfm_initialize in pfm - not found
2024-04-25T02:36:32.6753218Z -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
2024-04-25T02:36:32.7444069Z -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
2024-04-25T02:36:32.7455491Z -- Found Threads: TRUE
2024-04-25T02:36:32.7899676Z -- Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES) 
2024-04-25T02:36:32.7900965Z -- Looking for arc4random
2024-04-25T02:36:32.8342866Z -- Looking for arc4random - not found
2024-04-25T02:36:32.8388616Z -- Looking for backtrace
2024-04-25T02:36:32.9029780Z -- Looking for backtrace - found
2024-04-25T02:36:32.9030809Z -- backtrace facility detected in default set of libraries
2024-04-25T02:36:32.9033239Z -- Found Backtrace: /usr/include
2024-04-25T02:36:32.9040345Z -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
2024-04-25T02:36:32.9522715Z -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
2024-04-25T02:36:32.9524848Z -- Looking for __register_frame
2024-04-25T02:36:33.0171078Z -- Looking for __register_frame - found
2024-04-25T02:36:33.0172886Z -- Looking for __deregister_frame
2024-04-25T02:36:33.0815964Z -- Looking for __deregister_frame - found
2024-04-25T02:36:33.0817497Z -- Looking for __unw_add_dynamic_fde
2024-04-25T02:36:33.1467068Z -- Looking for __unw_add_dynamic_fde - not found
2024-04-25T02:36:33.1468516Z -- Looking for _Unwind_Backtrace
2024-04-25T02:36:33.2363516Z -- Looking for _Unwind_Backtrace - found
2024-04-25T02:36:33.2364589Z -- Looking for getpagesize
2024-04-25T02:36:33.3062366Z -- Looking for getpagesize - found
2024-04-25T02:36:33.3063468Z -- Looking for sysconf
2024-04-25T02:36:33.3769249Z -- Looking for sysconf - found
2024-04-25T02:36:33.3770814Z -- Looking for getrusage
2024-04-25T02:36:33.4434303Z -- Looking for getrusage - found
2024-04-25T02:36:33.4436285Z -- Looking for setrlimit
2024-04-25T02:36:33.5098645Z -- Looking for setrlimit - found
2024-04-25T02:36:33.5100183Z -- Looking for isatty
2024-04-25T02:36:33.5805517Z -- Looking for isatty - found
2024-04-25T02:36:33.5807102Z -- Looking for futimens
2024-04-25T02:36:33.6477726Z -- Looking for futimens - found
2024-04-25T02:36:33.6479604Z -- Looking for futimes
2024-04-25T02:36:33.7154474Z -- Looking for futimes - found
2024-04-25T02:36:33.7155681Z -- Looking for sigaltstack
2024-04-25T02:36:33.7846806Z -- Looking for sigaltstack - found
2024-04-25T02:36:33.7847993Z -- Looking for mallctl
2024-04-25T02:36:33.8234559Z -- Looking for mallctl - not found
2024-04-25T02:36:33.8235992Z -- Looking for mallinfo
2024-04-25T02:36:33.8928330Z -- Looking for mallinfo - found
2024-04-25T02:36:33.8931242Z -- Looking for mallinfo2
2024-04-25T02:36:33.9623305Z -- Looking for mallinfo2 - found
2024-04-25T02:36:33.9625161Z -- Looking for malloc_zone_statistics
2024-04-25T02:36:34.0005477Z -- Looking for malloc_zone_statistics - not found
2024-04-25T02:36:34.0007041Z -- Looking for getrlimit
2024-04-25T02:36:34.0685548Z -- Looking for getrlimit - found
2024-04-25T02:36:34.0687284Z -- Looking for posix_spawn
2024-04-25T02:36:34.1387880Z -- Looking for posix_spawn - found
2024-04-25T02:36:34.1389357Z -- Looking for pread
2024-04-25T02:36:34.2102792Z -- Looking for pread - found
2024-04-25T02:36:34.2104315Z -- Looking for sbrk
2024-04-25T02:36:34.2826289Z -- Looking for sbrk - found
2024-04-25T02:36:34.2827529Z -- Looking for strerror_r
2024-04-25T02:36:34.3508557Z -- Looking for strerror_r - found
2024-04-25T02:36:34.3510256Z -- Looking for strerror_s
2024-04-25T02:36:34.3924334Z -- Looking for strerror_s - not found
2024-04-25T02:36:34.3925988Z -- Looking for setenv
2024-04-25T02:36:34.4630265Z -- Looking for setenv - found
2024-04-25T02:36:34.4632204Z -- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
2024-04-25T02:36:34.5037150Z -- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC - Failed
2024-04-25T02:36:34.5038335Z -- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
2024-04-25T02:36:34.5722893Z -- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC - Success
2024-04-25T02:36:34.5724170Z -- Looking for __GLIBC__
2024-04-25T02:36:34.6401307Z -- Looking for __GLIBC__ - found
2024-04-25T02:36:34.6403105Z -- Looking for pthread_getname_np
2024-04-25T02:36:34.7097982Z -- Looking for pthread_getname_np - found
2024-04-25T02:36:34.7099561Z -- Looking for pthread_setname_np
2024-04-25T02:36:34.7785034Z -- Looking for pthread_setname_np - found
2024-04-25T02:36:34.7786734Z -- Looking for dlopen
2024-04-25T02:36:34.8455394Z -- Looking for dlopen - found
2024-04-25T02:36:34.8457154Z -- Looking for dladdr
2024-04-25T02:36:34.9150684Z -- Looking for dladdr - found
2024-04-25T02:36:34.9152577Z -- Looking for proc_pid_rusage
2024-04-25T02:36:34.9525693Z -- Looking for proc_pid_rusage - not found
2024-04-25T02:36:34.9531174Z -- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
2024-04-25T02:36:35.1017967Z -- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
2024-04-25T02:36:35.1019138Z -- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
2024-04-25T02:36:35.2029724Z -- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Success
2024-04-25T02:36:35.2030652Z -- Performing Test LLVM_HAS_ATOMICS
2024-04-25T02:36:35.3018426Z -- Performing Test LLVM_HAS_ATOMICS - Success
2024-04-25T02:36:35.3024722Z -- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG
2024-04-25T02:36:35.3752462Z -- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG - Success
2024-04-25T02:36:35.3758797Z -- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG
2024-04-25T02:36:35.4223133Z -- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Failed
2024-04-25T02:36:35.4229346Z -- Performing Test HAS_UNINITIALIZED
2024-04-25T02:36:35.4942248Z -- Performing Test HAS_UNINITIALIZED - Success
2024-04-25T02:36:35.5059958Z -- LLVM host triple: x86_64-unknown-linux-gnu
2024-04-25T02:36:35.5061127Z -- Native target X86 is not selected; lli will not JIT code
2024-04-25T02:36:35.5061845Z -- Threads enabled.
2024-04-25T02:36:35.5062199Z -- Doxygen disabled.
2024-04-25T02:36:35.5158771Z -- Ninja version: 1.11.1
2024-04-25T02:36:35.5205534Z -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
2024-04-25T02:36:35.5252332Z -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
2024-04-25T02:36:35.5253341Z -- OCaml bindings disabled.
2024-04-25T02:36:35.6528575Z -- Found Python module pygments
2024-04-25T02:36:35.8140241Z -- Found Python module pygments.lexers.c_cpp
2024-04-25T02:36:35.8452146Z -- Found Python module yaml
2024-04-25T02:36:35.8460383Z -- LLVM default target triple: 
2024-04-25T02:36:35.8543295Z -- Performing Test C_SUPPORTS_FPIC
2024-04-25T02:36:35.9188626Z -- Performing Test C_SUPPORTS_FPIC - Success
2024-04-25T02:36:35.9194628Z -- Performing Test CXX_SUPPORTS_FPIC
2024-04-25T02:36:35.9915165Z -- Performing Test CXX_SUPPORTS_FPIC - Success
2024-04-25T02:36:35.9915983Z -- Building with -fPIC
2024-04-25T02:36:35.9922257Z -- Performing Test C_SUPPORTS_FNO_SEMANTIC_INTERPOSITION
2024-04-25T02:36:36.0576717Z -- Performing Test C_SUPPORTS_FNO_SEMANTIC_INTERPOSITION - Success
2024-04-25T02:36:36.0583158Z -- Performing Test CXX_SUPPORTS_FNO_SEMANTIC_INTERPOSITION
2024-04-25T02:36:36.1311541Z -- Performing Test CXX_SUPPORTS_FNO_SEMANTIC_INTERPOSITION - Success
2024-04-25T02:36:36.1319682Z -- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
2024-04-25T02:36:36.2044799Z -- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success
2024-04-25T02:36:36.2052350Z -- Performing Test C_SUPPORTS_WERROR_DATE_TIME
2024-04-25T02:36:36.2701133Z -- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success
2024-04-25T02:36:36.2707912Z -- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME
2024-04-25T02:36:36.3427316Z -- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success
2024-04-25T02:36:36.3435923Z -- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
2024-04-25T02:36:36.4025555Z -- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
2024-04-25T02:36:36.4032617Z -- Performing Test C_SUPPORTS_CMAKE_CXX_FLAGS
2024-04-25T02:36:36.4671996Z -- Performing Test C_SUPPORTS_CMAKE_CXX_FLAGS - Success
2024-04-25T02:36:36.4678833Z -- Performing Test CXX_SUPPORTS_CMAKE_CXX_FLAGS
2024-04-25T02:36:36.5406164Z -- Performing Test CXX_SUPPORTS_CMAKE_CXX_FLAGS - Success
2024-04-25T02:36:36.5414161Z -- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG
2024-04-25T02:36:36.6142501Z -- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success
2024-04-25T02:36:36.6149533Z -- Performing Test C_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG
2024-04-25T02:36:36.6578467Z -- Performing Test C_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG - Failed
2024-04-25T02:36:36.6584918Z -- Performing Test CXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG
2024-04-25T02:36:36.7015281Z -- Performing Test CXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG - Failed
2024-04-25T02:36:36.7022107Z -- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
2024-04-25T02:36:36.7666239Z -- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
2024-04-25T02:36:36.7673259Z -- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
2024-04-25T02:36:36.8404926Z -- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
2024-04-25T02:36:36.8411943Z -- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
2024-04-25T02:36:36.8828061Z -- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
2024-04-25T02:36:36.8834583Z -- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
2024-04-25T02:36:36.9262557Z -- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
2024-04-25T02:36:36.9269889Z -- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG
2024-04-25T02:36:36.9995992Z -- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG - Success
2024-04-25T02:36:37.0003239Z -- Performing Test CXX_SUPPORTS_REDUNDANT_MOVE_FLAG
2024-04-25T02:36:37.0727818Z -- Performing Test CXX_SUPPORTS_REDUNDANT_MOVE_FLAG - Success
2024-04-25T02:36:37.0735191Z -- Performing Test CXX_SUPPORTS_PESSIMIZING_MOVE_FLAG
2024-04-25T02:36:37.1468591Z -- Performing Test CXX_SUPPORTS_PESSIMIZING_MOVE_FLAG - Success
2024-04-25T02:36:37.1475765Z -- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG
2024-04-25T02:36:37.2201669Z -- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG - Success
2024-04-25T02:36:37.2203204Z -- Performing Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR
2024-04-25T02:36:37.2640300Z -- Performing Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR - Failed
2024-04-25T02:36:37.2646993Z -- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
2024-04-25T02:36:37.3368741Z -- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Success
2024-04-25T02:36:37.3370728Z -- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL
2024-04-25T02:36:37.4095968Z -- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL - Success
2024-04-25T02:36:37.4096801Z -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
2024-04-25T02:36:37.4510725Z -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Failed
2024-04-25T02:36:37.4517376Z -- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG
2024-04-25T02:36:37.4916909Z -- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Failed
2024-04-25T02:36:37.4923249Z -- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG
2024-04-25T02:36:37.5332931Z -- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Failed
2024-04-25T02:36:37.5340236Z -- Performing Test CXX_SUPPORTS_MISLEADING_INDENTATION_FLAG
2024-04-25T02:36:37.6090108Z -- Performing Test CXX_SUPPORTS_MISLEADING_INDENTATION_FLAG - Success
2024-04-25T02:36:37.6097162Z -- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
2024-04-25T02:36:37.6543365Z -- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Failed
2024-04-25T02:36:37.6550441Z -- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
2024-04-25T02:36:37.7317839Z -- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Success
2024-04-25T02:36:37.7328465Z -- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS
2024-04-25T02:36:37.7875560Z -- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS - Failed
2024-04-25T02:36:37.7882826Z -- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS
2024-04-25T02:36:37.8557397Z -- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS - Success
2024-04-25T02:36:37.8564597Z -- Performing Test C_SUPPORTS_FFUNCTION_SECTIONS
2024-04-25T02:36:37.9237447Z -- Performing Test C_SUPPORTS_FFUNCTION_SECTIONS - Success
2024-04-25T02:36:37.9244558Z -- Performing Test CXX_SUPPORTS_FFUNCTION_SECTIONS
2024-04-25T02:36:38.0007596Z -- Performing Test CXX_SUPPORTS_FFUNCTION_SECTIONS - Success
2024-04-25T02:36:38.0014994Z -- Performing Test C_SUPPORTS_FDATA_SECTIONS
2024-04-25T02:36:38.0687844Z -- Performing Test C_SUPPORTS_FDATA_SECTIONS - Success
2024-04-25T02:36:38.0695358Z -- Performing Test CXX_SUPPORTS_FDATA_SECTIONS
2024-04-25T02:36:38.1447067Z -- Performing Test CXX_SUPPORTS_FDATA_SECTIONS - Success
2024-04-25T02:36:38.1452930Z -- Looking for os_signpost_interval_begin
2024-04-25T02:36:38.1828928Z -- Looking for os_signpost_interval_begin - not found
2024-04-25T02:36:38.2040333Z -- Linker detection: GNU ld
2024-04-25T02:36:38.2094291Z -- Performing Test HAS_WERROR_GLOBAL_CTORS
2024-04-25T02:36:38.2563275Z -- Performing Test HAS_WERROR_GLOBAL_CTORS - Failed
2024-04-25T02:36:38.2576084Z -- Looking for __x86_64__
2024-04-25T02:36:38.3244961Z -- Looking for __x86_64__ - found
2024-04-25T02:36:38.3842550Z -- Found Git: /home/runner/work/mosdns/mosdns/sdk/staging_dir/host/bin/git (found version "2.43.2")
2024-04-25T02:36:38.6303735Z -- Targeting AArch64
2024-04-25T02:36:38.8833031Z CMake Error at cmake/modules/CMakeLists.txt:1 (include):
2024-04-25T02:36:38.8834169Z   include could not find requested file:
2024-04-25T02:36:38.8837172Z 
2024-04-25T02:36:38.8837819Z     ExtendPath
2024-04-25T02:36:38.8838107Z 
2024-04-25T02:36:38.8838119Z 
2024-04-25T02:36:38.8839400Z CMake Error at cmake/modules/CMakeLists.txt:3 (include):
2024-04-25T02:36:38.8840126Z   include could not find requested file:
2024-04-25T02:36:38.8840524Z 
2024-04-25T02:36:38.8840693Z     FindPrefixFromConfig
2024-04-25T02:36:38.8840996Z 
2024-04-25T02:36:38.8841004Z 
2024-04-25T02:36:38.8903074Z CMake Error at cmake/modules/CMakeLists.txt:118 (find_prefix_from_config):
2024-04-25T02:36:38.8904005Z   Unknown CMake command "find_prefix_from_config".
2024-04-25T02:36:38.8904785Z 
2024-04-25T02:36:38.8904797Z 
2024-04-25T02:36:38.9108332Z -- Configuring incomplete, errors occurred!
2024-04-25T02:36:38.9467847Z make[2]: *** [Makefile:128: /home/runner/work/mosdns/mosdns/sdk/build_dir/hostpkg/llvm-18.1.4.src/.configured] Error 1
2024-04-25T02:36:38.9469307Z make[2]: Leaving directory '/home/runner/work/mosdns/mosdns/sdk/feeds/mosdns/llvm'
2024-04-25T02:36:38.9470729Z time: package/feeds/mosdns/llvm/host-compile#9.04#7.17#14.07
2024-04-25T02:36:38.9478770Z     ERROR: package/feeds/mosdns/llvm [host] failed to build.
2024-04-25T02:36:38.9482755Z make[1]: *** [package/Makefile:127: package/feeds/mosdns/llvm/host/compile] Error 1
2024-04-25T02:36:38.9483901Z make[1]: Leaving directory '/home/runner/work/mosdns/mosdns/sdk'
2024-04-25T02:36:38.9489838Z make: *** [/home/runner/work/mosdns/mosdns/sdk/include/toplevel.mk:226: package/luci-app-mosdns/compile] Error 2
2024-04-25T02:36:38.9505096Z ##[error]Process completed with exit code 2.
kloczek commented 6 months ago

Please let me know what should be done to have those small adjustments included in next 16.0.x release.

I have updated that patch for 18.1.x. Should I create PR against that branch? 🤔

esaaprillia commented 5 months ago

hy @kloczek

i had this problem in openwrt.

I built the llvm host after completing the host file I installed in @HOME/staging/hostpkg/

build cross compilation.

I added -DLLVM_NATIVE_TOOL_DIR=$HOME/staging/hostpkg/

i see NATIVE when cross compiling this should not happen.

if I add -DLLVM_NATIVE_TOOL_DIR=$HOME/code/llvm-project/llvm/build/bin I no longer see NATIVEcreated during cross-compilation

My question is how to build an llvm host and install the llvm host file in the specified place?

i already added this when building llvm host but it didn’t work -DCMAKE_INSTALL_PREFIX="$(STAGING_DIR_HOSTPKG)