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

--- Comment #9 from Christoph Reiter <reiter.christoph at gmail dot com> ---
(In reply to Eric Botcazou from comment #8)
> > We currently link:
> > 
> > shared: gmp, winpthread, zlib, zstd
> > static: mpc, mpfr, isl
> > 
> > Not for any particular gcc related reason I think, some dependent packages
> > have static/shared builds, some don't.
> 
> 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:
> 
> # Strip -Werror during linking for the LTO bootstrap
> GCC_LINKERFLAGS = $(filter-out -Werror, $(ALL_LINKERFLAGS)) -shared-libgcc
> 
> in your setup since you link gnat1 with shared libraries. This should
> override the -static-libgcc in ALL_LINKERFLAGS inherited from toplevel.
> 
> 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?

Reply via email to