[Bug bootstrap/56750] [6/7/8 Regression] static -lstdc++ logic bleeds into all subdirs

aldyh at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 2 19:16:00 GMT 2018


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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org

--- Comment #13 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
(In reply to Eric Botcazou from comment #4)
> > Well, if you can link dynamically, you should, if say libstdc++ contains
> > some security bug and gdb isn't built in the combined tree with gcc, then
> > I'd say it is highly undesirable to link it statically.
> 
> Your point of view is clearly too Linux-centric here. :-)  I can assure you
> that the last thing people want on Solaris on HP-UX is to have to install
> shared libraries to run GDB.

Hi folks.  It's been 4 years with no progress here.

Is this becoming a WONTFIX or should we add a toplevel configure flag to give
the user an option to opt out of -static-libstdc++ -static-libgcc?

The the original patch has a work around, just specify --with-stage1-libs=" "
and you won't get the offending behavior :):

 # In stage 1, default to linking libstdc++ and libgcc statically with GCC
 # if supported.  But if the user explicitly specified the libraries to use,
 # trust that they are doing what they want.
 if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
   stage1_ldflags="-static-libstdc++ -static-libgcc"
 fi])

Should we make an explicit configury flag for this behavior instead of the
above work around?

Should we instead close this as a WONTFIX with a pointer to the following in
our docs:

--with-stage1-ldflags=flags
This option may be used to set linker flags to be used when linking stage 1 of
GCC. These are also used when linking GCC if configured with
--disable-bootstrap. If --with-stage1-libs is not set to a value, then the
default is ‘-static-libstdc++ -static-libgcc’, if supported.

Any input would be great.


More information about the Gcc-bugs mailing list