On Tue, May 07, 2024 at 04:40:55PM -0400, James K. Lowden wrote:
> /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not
> found (required by build-O2/gcc/cobol1

The cc1/cc1plus/f951/... binaries are normally linked with
-static-libstdc++ -static-libgcc in second and later stages (first
stage is linked against the host libstdc++, so not a problem, but
even that stage is often linked with it).
See e.g. --with-static-standard-libraries configure option in toplevel
configury.

Perhaps you don't link cobol1 with the correct make variables
as other FEs are linked?

I think it is $(LDFLAGS) that is needed:
grep ^LDFLAGS *gcc/Makefile
gcc/Makefile:LDFLAGS = -static-libstdc++ -static-libgcc  
prev-gcc/Makefile:LDFLAGS = -static-libstdc++ -static-libgcc  
stage1-gcc/Makefile:LDFLAGS = -static-libstdc++ -static-libgcc  
but better follow what other FEs do in Make-lang.in
E.g. the linking of the FE binaries need to be specially chained for
--enable-link-serialization
or
--enable-link-serialization=N
such that only N binaries are linked together, etc.
c++.serial = cc1plus$(exeext)
...
cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(CODYLIB) 
$(LIBDEPS) $(c++.prev)
        @$(call LINK_PROGRESS,$(INDEX.c++),start)
        +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
              $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(CODYLIB) \
                $(LIBS) $(BACKENDLIBS)
        @$(call LINK_PROGRESS,$(INDEX.c++),end)
does that (the lang.serial line, $(lang.prev) dependency, the
LINK_PROGRESS.lang calls, using $(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) ...
$(BACKEND) $(BACKENDLIBS) $(LIBS) too.

        Jakub

Reply via email to