Hi!

Richi complained on IRC that cc1 is linked against libcody.a.
>From my understanding, it is just the cc1plus and cc1objplus binaries
that need it, so this patch links only those against it.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2021-01-05  Jakub Jelinek  <ja...@redhat.com>

gcc/
        * Makefile.in (BACKEND): Remove CODYLIB.
gcc/cp/
        * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
        $(CODYLIB) after $(BACKEND).
gcc/objcp/
        * Make-lang.in (cc1objplus-checksum, cc1objplus$(exeext): Add
        $(CODYLIB) after $(BACKEND).

--- gcc/Makefile.in.jj  2020-12-28 12:27:32.252755439 +0100
+++ gcc/Makefile.in     2021-01-04 09:40:17.292056310 +0100
@@ -1729,7 +1729,7 @@ endif
 ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS)
 
 BACKEND = libbackend.a main.o libcommon-target.a libcommon.a \
-       $(CPPLIB) $(CODYLIB) $(LIBDECNUMBER)
+       $(CPPLIB) $(LIBDECNUMBER)
 
 # This is defined to "yes" if Tree checking is enabled, which roughly means
 # front-end checking.
--- gcc/cp/Make-lang.in.jj      2020-12-15 17:37:38.118383315 +0100
+++ gcc/cp/Make-lang.in 2021-01-04 09:42:07.098811847 +0100
@@ -121,20 +121,20 @@ cp-warn = $(STRICT_WARN)
 # re-use the checksum from the prev-final stage so it passes
 # the bootstrap comparison and allows comparing of the cc1 binary
 cc1plus-checksum.c : build/genchecksum$(build_exeext) checksum-options \
-       $(CXX_OBJS) $(BACKEND) $(LIBDEPS) 
+       $(CXX_OBJS) $(BACKEND) $(CODYLIB) $(LIBDEPS) 
        if [ -f ../stage_final ] \
           && cmp -s ../stage_current ../stage_final; then \
           cp ../prev-gcc/cc1plus-checksum.c cc1plus-checksum.c; \
        else \
-         build/genchecksum$(build_exeext) $(CXX_OBJS) $(BACKEND) $(LIBDEPS) \
+         build/genchecksum$(build_exeext) $(CXX_OBJS) $(BACKEND) $(CODYLIB) 
$(LIBDEPS) \
                      checksum-options > cc1plus-checksum.c.tmp &&         \
          $(srcdir)/../move-if-change cc1plus-checksum.c.tmp 
cc1plus-checksum.c; \
        fi
 
-cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS) 
$(c++.prev)
+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) $(LIBS) $(BACKENDLIBS)
+             $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(CODYLIB) $(LIBS) 
$(BACKENDLIBS)
        @$(call LINK_PROGRESS,$(INDEX.c++),end)
 
 ifeq ($(ENABLE_MAINTAINER_RULES), true)
--- gcc/objcp/Make-lang.in.jj   2020-11-20 08:45:04.213678353 +0100
+++ gcc/objcp/Make-lang.in      2021-01-04 09:42:50.455320724 +0100
@@ -61,17 +61,18 @@ OBJCXX_OBJS = objcp/objcp-act.o objcp/ob
 obj-c++_OBJS = $(OBJCXX_OBJS) cc1objplus-checksum.o
 
 cc1objplus-checksum.c : build/genchecksum$(build_exeext) checksum-options \
-       $(OBJCXX_OBJS) $(BACKEND) $(LIBDEPS)
-       build/genchecksum$(build_exeext) $(OBJCXX_OBJS) $(BACKEND) \
+       $(OBJCXX_OBJS) $(BACKEND) $(CODYLIB) $(LIBDEPS)
+       build/genchecksum$(build_exeext) $(OBJCXX_OBJS) $(BACKEND) $(CODYLIB) \
                $(LIBDEPS) checksum-options > cc1objplus-checksum.c.tmp && \
        $(srcdir)/../move-if-change cc1objplus-checksum.c.tmp \
        cc1objplus-checksum.c
 
 cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) \
-                    $(LIBDEPS) $(obj-c++.prev)
+                    $(CODYLIB) $(LIBDEPS) $(obj-c++.prev)
        @$(call LINK_PROGRESS,$(INDEX.obj-c++),start)
        +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
-               $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBS) 
$(BACKENDLIBS)
+               $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(CODYLIB) \
+               $(LIBS) $(BACKENDLIBS)
        @$(call LINK_PROGRESS,$(INDEX.obj-c++),end)
 
 # Objective C++ language specific files.

        Jakub

Reply via email to