diff options
author | Sergey Kosukhin <sergey.kosukhin@mpimet.mpg.de> | 2022-06-22 16:10:33 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2022-06-23 15:11:39 +0300 |
commit | 9f1d90bf91570efa124c4a86cd033de374d1049a (patch) | |
tree | 26c16880fed7442d6fab45bf5ba7bae0109bbd4e /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | b6a33cec3830b6c9ea35faf35b4a5889c22c6ae9 (diff) | |
download | llvm-9f1d90bf91570efa124c4a86cd033de374d1049a.zip llvm-9f1d90bf91570efa124c4a86cd033de374d1049a.tar.gz llvm-9f1d90bf91570efa124c4a86cd033de374d1049a.tar.bz2 |
[compiler-rt] Fix false positive detection of a target in compile-only mode
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
0 files changed, 0 insertions, 0 deletions