From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0B7E8395C43C; Thu, 19 May 2022 16:14:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B7E8395C43C From: "reiter.christoph at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/105507] Ada build fails for 32bit Windows Date: Thu, 19 May 2022 16:14:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: reiter.christoph at gmail dot com 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: Thu, 19 May 2022 16:14:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105507 --- Comment #9 from Christoph Reiter --- (In reply to Eric Botcazou from comment #8) > > We currently link: > >=20 > > shared: gmp, winpthread, zlib, zstd > > static: mpc, mpfr, isl > >=20 > > Not for any particular gcc related reason I think, some dependent packa= ges > > have static/shared builds, some don't. >=20 > Why didn't I think of that for PR ada/100486? Sorry, I didn't know this was a problem :) I'm not quite sure how I ended up maintaining this downstream... but here we are. > So the fix should have been > to add -shared-libgcc to GCC_LINKERFLAGS in > gcc/ada/gcc-interface/Make-lang.in: >=20 > # Strip -Werror during linking for the LTO bootstrap > GCC_LINKERFLAGS =3D $(filter-out -Werror, $(ALL_LINKERFLAGS)) -shared-lib= gcc >=20 > in your setup since you link gnat1 with shared libraries. This should > override the -static-libgcc in ALL_LINKERFLAGS inherited from toplevel. >=20 > So you need to to it 1) for GCC 11: rebuild it and reinstall it 2) for GCC > 12: build it with the patched GCC 11. Note that this means that GCC 11 is > currently not fully functional anyway. Thanks for the detailed instructions. I'll give that a try. I'm wondering if there are any downsides to just removing "-static-libgcc" = from both "--with-stage1-ldflags" and "--with-boot-ldflags". Or is only ada using exceptions in GCC? Or should we try linking everything statically to avoid this alltogether?=