Issue 125092
Summary [libc][test] make DeathTestExecutors and FPExceptionHelpers hermetic
Labels libc
Assignees nickdesaulniers
Reporter nickdesaulniers
    Towards the goal of being able to cross compile full builds, I hit a snag yesterday when cross compiling some of the unit tests.  With some other smaller fixes to our cmake, I can cross compile (and run in QEMU) _some_ unit tests, but quite a few still fail to build.

80cf21dad150a added a [TODO](https://github.com/llvm/llvm-project/blob/c39fba209ce655cf5997878b0bf794da269f008a/libc/test/UnitTest/CMakeLists.txt#L29-L30) that implies that the LibcDeathTestExecutors and LibcFPExceptionHelpers are indeed not yet hermetic.  (It then unsets `LLVM_LIBC_FULL_BUILD` which changes the set compiler options from `_get_common_test_compile_options`).

Here's an example failure:
```
llvm-project/libc/test/UnitTest/LibcDeathTestExecutors.cpp:15:10: fatal error: 'assert.h' file not found
   15 | #include <assert.h>
      | ^~~~~~~~~~
```

I suspect we can start relying on hdr/ for these from the UnitTests.

So that needs to get fixed first, before we can cross compile the entire unit test suite.

cc @lntue 

---

FWIW, my cmake invocation is:
```
$ cmake ../runtimes -GNinja -DLLVM_ENABLE_LLD=ON -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_RUNTIMES="libc" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_LIBC_FULL_BUILD=ON -DLIBC_TARGET_TRIPLE=aarch64-linux-gnu -DCMAKE_CROSSCOMPILING_EMULATOR=qemu-aarch64 -DLIBC_KERNEL_HEADERS=/tmp/sysroot/include
```
and my kernel headers were built via:
```
$ make LLVM=1 ARCH=arm64 INSTALL_HDR_PATH=/tmp/sysroot headers_install
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to