From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1D64F3857C61; Mon, 1 Aug 2022 23:07:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D64F3857C61 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/58638] libstdc++ builds as non-PIC when --with-pic is specified Date: Mon, 01 Aug 2022 23:07:42 +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: 4.8.1 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2022 23:07:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D58638 --- Comment #14 from Jonathan Wakely --- (In reply to Alec Ari from comment #11) > This fix worked for me: >=20 > --- a/libstdc++-v3/configure.ac > +++ b/libstdc++-v3/configure.ac > @@ -121,8 +121,8 @@ if test "$enable_shared" =3D yes; then > glibcxx_compiler_shared_flag=3D"-D_GLIBCXX_SHARED" >=20=20 > else > - glibcxx_lt_pic_flag=3D > - glibcxx_compiler_pic_flag=3D > + glibcxx_lt_pic_flag=3D"-prefer-pic" > + glibcxx_compiler_pic_flag=3D"$lt_prog_compiler_pic_CXX" > glibcxx_compiler_shared_flag=3D > fi >=20 > (no elif / no else if) But this means always PIC, doesn't it? Even if you build with --disable-sha= red and --without-pic. Surely that's not right? Why is this better than comment= 9?=