diff options
| author | Hal Finkel <hfinkel@anl.gov> | 2015-09-30 22:34:35 +0000 |
|---|---|---|
| committer | Hal Finkel <hfinkel@anl.gov> | 2015-09-30 22:34:35 +0000 |
| commit | 39ac97fa3aab45bf9b554f294f24055113d5fc91 (patch) | |
| tree | 39380d782be466ab44409ec1e79bb8d66282e781 /llvm/lib/LibDriver/LibDriver.cpp | |
| parent | de1736ae0258aed29607660c748782fb7cb25793 (diff) | |
| download | bcm5719-llvm-39ac97fa3aab45bf9b554f294f24055113d5fc91.tar.gz bcm5719-llvm-39ac97fa3aab45bf9b554f294f24055113d5fc91.zip | |
[PowerPC] undef Relocation names in PowerPC*.def
glibc's PowerPC /usr/include/asm/sigcontext.h, has this:
#ifdef __powerpc64__
#include <asm/elf.h>
#endif
and that contains defines of all of the relocation symbols, like this:
#define R_PPC_NONE 0
and if that file is included prior to including
include/llvm/Support/ELFRelocs/PowerPC*.def, which we cannot in general
prevent, the result will fail.
As it turns out, this happens when compiling
lld/unittests/DriverTests/GnuLdDriverTest.cpp under PPC64/Linux, because:
lld/include/lld/ReaderWriter/ELFLinkingContext.h includes
lld/unittests/DriverTests/DriverTest.h which includes
utils/unittest/googletest/include/gtest/gtest.h which includes
utils/unittest/googletest/include/gtest/internal/gtest-internal.h which includes
/usr/include/sys/wait.h which includes
/usr/include/signal.h which includes
/usr/include/bits/sigcontext.h which includes
/usr/include/asm/sigcontext.h which includes
/usr/include/asm/elf.h
the test could be fixed to include ReaderWriter/ELFLinkingContext.h before
including unittests/DriverTests/DriverTest.h, but dealing with this in the
*.def files is a more-general solution that localizes the fix to the headers
instead of requiring changes to an unbounded number of other source files (both
in-tree and external).
llvm-svn: 248957
Diffstat (limited to 'llvm/lib/LibDriver/LibDriver.cpp')
0 files changed, 0 insertions, 0 deletions

