Issue 149324
Summary Building liboffload fails for pure libc++ build (missing build dependency)
Labels build-problem, openmp:libomptarget
Assignees
Reporter jprotze
    Building with `-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld" -DLLVM_ENABLE_RUNTIMES="libcxxabi;libcxx;libunwind;openmp;offload;compiler-rt"` fails, when configuring clang to always use the LLVM C++ lib: `-DCLANG_DEFAULT_CXX_STDLIB=libc++`:
```
[105/2895] Building CXX object offload/tools/offload-tblgen/CMakeFiles/offload-tblgen.dir/APIGen.cpp.o
FAILED: offload/tools/offload-tblgen/CMakeFiles/offload-tblgen.dir/APIGen.cpp.o 
BUILD/bin/clang++ --target=x86_64-unknown-linux-gnu -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -DOMPTARGET_DEBUG -DOMPT_SUPPORT=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -ISOURCE/llvm/include -IBUILD/include -IBUILD/runtimes/runtimes-bins/openmp/runtime/src -Wno-unused-command-line-argument -Wno-gnu-line-marker -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -w -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -MD -MT offload/tools/offload-tblgen/CMakeFiles/offload-tblgen.dir/APIGen.cpp.o -MF offload/tools/offload-tblgen/CMakeFiles/offload-tblgen.dir/APIGen.cpp.o.d -o offload/tools/offload-tblgen/CMakeFiles/offload-tblgen.dir/APIGen.cpp.o -c SOURCE/offload/tools/offload-tblgen/APIGen.cpp
In file included from SOURCE/offload/tools/offload-tblgen/APIGen.cpp:14:
In file included from SOURCE/llvm/include/llvm/ADT/StringExtras.h:17:
In file included from SOURCE/llvm/include/llvm/ADT/APSInt.h:18:
In file included from SOURCE/llvm/include/llvm/ADT/APInt.h:19:
In file included from SOURCE/llvm/include/llvm/Support/MathExtras.h:16:
SOURCE/llvm/include/llvm/ADT/bit.h:18:10: fatal error: 'cstddef' file not found
   18 | #include <cstddef> // for std::size_t
      |          ^~~~~~~~~
1 error generated.
```
With more errors about missing `type_traits` includes.

When building without `offload` runtime first, adding `offload` to the runtimes in a second configure+build sequence, the build succeeds. So, there is clearly some dependency missing between generating C++ header files in the outer build directory and building the runtimes.

In a successful build, the header can be found in:

```
BUILD/include/c++/v1/type_traits
BUILD/include/c++/v1/experimental/type_traits
BUILD/include/c++/v1/__cxx03/type_traits
```

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to