From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BD80C3858C66; Thu, 7 Sep 2023 10:34:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD80C3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694082891; bh=dIKvq4I3y5df4/axlAhS47tzjh36BLLp51cALJE/MBY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FO6y4xsMEPBFHo5aCovFERNe8YgmnQxNWtoEsyBedJnQdFLMgnAGe7ZfuAN8z0sMI rutzI65dKXSnDEKSbHXXzRnlhMf9lIRczZpcrsbLC6erp3WprnrnE3BKPj6dQ/u9Qc 6NEgczvCO2xls0dGYPBo+BAqiKujVAu+o8XPpqqc= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/111315] libstdc++ stacktrace testsuite failures with --enable-default-pie Date: Thu, 07 Sep 2023 10:34:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xry111 at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111315 Xi Ruoyao changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xry111 at gcc dot gnu.org --- Comment #2 from Xi Ruoyao --- (In reply to Rimvydas (RJ) from comment #0) > The GCC configured with --enable-default-pie gives: >=20 > =3D=3D=3D libstdc++ tests =3D=3D=3D >=20 > Running target unix > FAIL: 19_diagnostics/stacktrace/entry.cc execution test > FAIL: 19_diagnostics/stacktrace/stacktrace.cc execution test >=20 > libstdc++-v3/testsuite/19_diagnostics/stacktrace/entry.cc:39: void > test_members(): Assertion 'e1.source_line() =3D=3D (__LINE__ - 5)' failed. > libstdc++-v3/testsuite/19_diagnostics/stacktrace/stacktrace.cc:132: void > test_assign(): Assertion 's0.at(0).source_line() =3D=3D (__LINE__ - 4)' f= ailed. >=20 > In both cases source_line() methods return 0. >=20 > 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 mak= ing > 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.=