https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111315
Xi Ruoyao <xry111 at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xry111 at gcc dot gnu.org --- Comment #2 from Xi Ruoyao <xry111 at gcc dot gnu.org> --- (In reply to Rimvydas (RJ) from comment #0) > The GCC configured with --enable-default-pie gives: > > === libstdc++ tests === > > Running target unix > FAIL: 19_diagnostics/stacktrace/entry.cc execution test > FAIL: 19_diagnostics/stacktrace/stacktrace.cc execution test > > libstdc++-v3/testsuite/19_diagnostics/stacktrace/entry.cc:39: void > test_members(): Assertion 'e1.source_line() == (__LINE__ - 5)' failed. > libstdc++-v3/testsuite/19_diagnostics/stacktrace/stacktrace.cc:132: void > test_assign(): Assertion 's0.at(0).source_line() == (__LINE__ - 4)' failed. > > In both cases source_line() methods return 0. > > Also, the -fno-pie option cannot be used when linking these tescases: > /usr/bin/ld: /tmp/ccv2BTff.o: relocation R_X86_64_32 against symbol > `_ZNSt16stacktrace_entry14_S_err_handlerEPvPKci' can not be used when making > a PIE object; recompile with -fPIE You need to use both -no-pie and -fno-pie. -fno-pie only tells the compiler not to emit code for PIE, -no-pie tells the linker not to link the code for PIE.