[LLVMbugs] [Bug 12700] New: LTO linking with -pie fails

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Apr 29 20:02:46 PDT 2012


             Bug #: 12700
           Summary: LTO linking with -pie fails
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: llvm-bugs at quasiparticle.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Compiling C++ programs as position independant and linking them with LTO will
fail with very strange errors. Simple test for clang from SVN and g++ 4.7:

% echo 'int main() { throw 1; }' | clang++ -x c++ -pie -fPIE -flto -o/dev/null
- && echo Success
/usr/bin/ld.gold: error: lto-llvm.o-19lpGA: requires dynamic R_X86_64_PC32
reloc against '__cxa_allocate_exception' which may overflow at runtime;
recompile with -fPIC
clang: error: linker command failed with exit code 1 (use -v to see invocation)

% echo 'int main() { throw 1; }' | g++ -x c++ -pie -fPIE -flto -o/dev/null - &&
echo Success

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list