https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97787

--- Comment #5 from Adrian Bunk <bunk at stusta dot de> ---
(In reply to Richard Biener from comment #4)
> You can also try to 'reduce' the testcase.  Since you are linking a shared
> object you can try to strip as many linker inputs as possible and then
> reduce the source files.

Bisecting does not work when both halves are working, but I now found some
clues:

$ g++ -flto -shared CMakeFiles/cpp.dir/src/dolfin.cpp.o
CMakeFiles/cpp.dir/src/parameter.cpp.o CMakeFiles/cpp.dir/src/adaptivity.cpp.o
CMakeFiles/cpp.dir/src/ale.cpp.o CMakeFiles/cpp.dir/src/common.cpp.o
CMakeFiles/cpp.dir/src/fem.cpp.o CMakeFiles/cpp.dir/src/function.cpp.o
CMakeFiles/cpp.dir/src/generation.cpp.o CMakeFiles/cpp.dir/src/geometry.cpp.o
CMakeFiles/cpp.dir/src/graph.cpp.o CMakeFiles/cpp.dir/src/log.cpp.o
CMakeFiles/cpp.dir/src/math.cpp.o CMakeFiles/cpp.dir/src/mesh.cpp.o
CMakeFiles/cpp.dir/src/multistage.cpp.o CMakeFiles/cpp.dir/src/ts.cpp.o
CMakeFiles/cpp.dir/src/io.cpp.o CMakeFiles/cpp.dir/src/la.cpp.o
CMakeFiles/cpp.dir/src/nls.cpp.o CMakeFiles/cpp.dir/src/refinement.cpp.o
CMakeFiles/cpp.dir/src/MPICommWrapper.cpp.o
/usr/bin/ld: /tmp/ccofV1SZ.ltrans32.ltrans.o: .symtab local symbol at index 214
(>= sh_info of 34)
/usr/bin/ld: /tmp/ccofV1SZ.ltrans32.ltrans.o: error adding symbols: bad value
collect2: error: ld returned 1 exit status
$  g++ -flto -shared dolfin.ii parameter.ii adaptivity.ii ale.ii common.ii
fem.ii function.ii generation.ii geometry.ii graph.ii log.ii math.ii mesh.ii
multistage.ii ts.ii io.ii la.ii nls.ii refinement.ii MPICommWrapper.ii
/tmp/ccraiNyo.ltrans9.ltrans.o: in function
`std::__exception_ptr::exception_ptr::operator=(std::__exception_ptr::exception_ptr&&)':
<artificial>:(.text+0x290): relocation truncated to fit: R_MIPS_CALL16 against
`std::__exception_ptr::exception_ptr::~exception_ptr()@@CXXABI_1.3.3'
/tmp/ccraiNyo.ltrans9.ltrans.o: in function `std::__cxx11::to_string(int)':
<artificial>:(.text+0x414): relocation truncated to fit: R_MIPS_CALL16 against
`std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
>::basic_string(unsigned long, char, std::allocator<char>
const&)@@GLIBCXX_3.4.21'
<artificial>:(.text+0x42c): relocation truncated to fit: R_MIPS_CALL16 against
`std::allocator<char>::~allocator()@@GLIBCXX_3.4'
<artificial>:(.text+0x498): relocation truncated to fit: R_MIPS_CALL16 against
`std::allocator<char>::~allocator()@@GLIBCXX_3.4'
<artificial>:(.text+0x4b0): relocation truncated to fit: R_MIPS_CALL16 against
`_Unwind_Resume@@GCC_3.0'
<artificial>:(.text+0x4e0): relocation truncated to fit: R_MIPS_CALL16 against
`_Unwind_Resume@@GCC_3.0'
/tmp/ccraiNyo.ltrans9.ltrans.o: in function `std::__cxx11::to_string(unsigned
long)':
<artificial>:(.text+0x584): relocation truncated to fit: R_MIPS_CALL16 against
`std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
>::basic_string(unsigned long, char, std::allocator<char>
const&)@@GLIBCXX_3.4.21'
<artificial>:(.text+0x598): relocation truncated to fit: R_MIPS_CALL16 against
`std::allocator<char>::~allocator()@@GLIBCXX_3.4'
<artificial>:(.text+0x5c8): relocation truncated to fit: R_MIPS_CALL16 against
`std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
>::size() const@@GLIBCXX_3.4.21'
<artificial>:(.text+0x610): relocation truncated to fit: R_MIPS_CALL16 against
`std::allocator<char>::~allocator()@@GLIBCXX_3.4'
<artificial>:(.text+0x628): additional relocation overflows omitted from the
output
collect2: error: ld returned 1 exit status
$ g++ -flto -shared dolfin.ii parameter.ii adaptivity.ii ale.ii common.ii
fem.ii function.ii generation.ii geometry.ii graph.ii log.ii math.ii mesh.ii
multistage.ii ts.ii io.ii la.ii nls.ii refinement.ii MPICommWrapper.ii -mxgot
$ g++ -flto -shared CMakeFiles/cpp.dir/src/dolfin.cpp.o
CMakeFiles/cpp.dir/src/parameter.cpp.o CMakeFiles/cpp.dir/src/adaptivity.cpp.o
CMakeFiles/cpp.dir/src/ale.cpp.o CMakeFiles/cpp.dir/src/common.cpp.o
CMakeFiles/cpp.dir/src/fem.cpp.o CMakeFiles/cpp.dir/src/function.cpp.o
CMakeFiles/cpp.dir/src/generation.cpp.o CMakeFiles/cpp.dir/src/geometry.cpp.o
CMakeFiles/cpp.dir/src/graph.cpp.o CMakeFiles/cpp.dir/src/log.cpp.o
CMakeFiles/cpp.dir/src/math.cpp.o CMakeFiles/cpp.dir/src/mesh.cpp.o
CMakeFiles/cpp.dir/src/multistage.cpp.o CMakeFiles/cpp.dir/src/ts.cpp.o
CMakeFiles/cpp.dir/src/io.cpp.o CMakeFiles/cpp.dir/src/la.cpp.o
CMakeFiles/cpp.dir/src/nls.cpp.o CMakeFiles/cpp.dir/src/refinement.cpp.o
CMakeFiles/cpp.dir/src/MPICommWrapper.cpp.o -flto-partition=none
$ 

Adding -mxgot to compiler and linker flags of a normal LTO build does not work,
but -flto-partition=none during linking is a workaround.

Reply via email to