forked from OSchip/llvm-project
9f1d90bf91
When `compiler-rt` is configured as a runtime, the configure-time target detection for builtins is done in compile-only mode, which is basically a test of whether the newly-built `clang` can compile a simple program with an additional flag (`-m32` and `-m64` in my case). The problem is that on my Debian system `clang` can compile `int foo(int x, int y) { return x + y; }` with `-m32` but fails to include `limits.h` (or any other target-specific header) for the `i386` target: ``` $ /path/to/build/./bin/clang --target=x86_64-unknown-linux-gnu -DVISIBILITY_HIDDEN -O3 -DNDEBUG -m32 -std=c11 -fPIC -fno-builtin -fvisibility=hidden -fomit-frame-pointer -MD -MT CMakeFiles/clang_rt.builtins-i386.dir/absvdi2.c.o -MF CMakeFiles/clang_rt.builtins-i386.dir/absvdi2.c.o.d -o CMakeFiles/clang_rt.builtins-i386.dir/absvdi2.c.o -c /path/to/src/compiler-rt/lib/builtins/absvdi2.c In file included from /path/to/src/compiler-rt/lib/builtins/absvdi2.c:13: In file included from /path/to/src/compiler-rt/lib/builtins/int_lib.h:93: In file included from /path/to/build/lib/clang/15.0.0/include/limits.h:21: In file included from /usr/include/limits.h:25: /usr/include/features.h:364:12: fatal error: 'sys/cdefs.h' file not found ^~~~~~~~~~~~~ 1 error generated. ``` This is an attempt to make the target detection more robust: extend the test program with `#include <limits.h>`. Differential Revision: https://reviews.llvm.org/D127975 |
||
---|---|---|
.. | ||
cmake | ||
docs | ||
include | ||
lib | ||
test | ||
tools | ||
unittests | ||
utils | ||
www | ||
.clang-tidy | ||
.gitignore | ||
CMakeLists.txt | ||
CODE_OWNERS.TXT | ||
CREDITS.TXT | ||
LICENSE.TXT | ||
README.txt |
README.txt
Compiler-RT ================================ This directory and its subdirectories contain source code for the compiler support routines. Compiler-RT is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt. ================================