libgcc, Darwin: Add missing build dependencies.
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 15 Dec 2021 14:11:58 +0000 (14:11 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 17 Dec 2021 10:12:53 +0000 (10:12 +0000)
There was a race condition where the link for the new shared EH library
(only used on earlier Darwin) could fail because the new crts had not been
copied to the gcc directory.  This can cause a build failure (although
currently only seen on powerpc-darwin).

Fixed by adding specific dependency on the crts and on the multi target.
We also add the declaration header for the Darwin10 unwinder shim to the
powerpc cases, since we build that there for Rosetta use.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
libgcc/ChangeLog:

* config.host: Add shim declaration header to powerpc*-darwin builds.
* config/rs6000/t-darwin-ehs: Remove dependency on the powerpc end
file.
* config/t-darwin-ehs: Add dependencies to the shared unwinder
objects.
* config/t-slibgcc-darwin: Add extra_parts to the dependencies for
the shared EH lib.  Add all-multi to the dependencies for the
libgcc_s.1.dylib redirections.

libgcc/config.host
libgcc/config/rs6000/t-darwin-ehs
libgcc/config/t-darwin-ehs
libgcc/config/t-slibgcc-darwin

index 1bac57c..ad0cdb2 100644 (file)
@@ -1140,10 +1140,14 @@ powerpc-*-darwin*)
          md_unwind_header=rs6000/darwin-unwind.h
          ;;
        esac
+       # We build the darwin10 EH shim for Rosetta (running on x86 machines).
+       tm_file="$tm_file i386/darwin-lib.h"
        tmake_file="$tmake_file rs6000/t-ppc64-fp rs6000/t-ibm-ldouble"
        extra_parts="$extra_parts crt2.o crt3_2.o libef_ppc.a dw_ppc.o"
        ;;
 powerpc64-*-darwin*)
+       # We build the darwin10 EH shim for Rosetta (running on x86 machines).
+       tm_file="$tm_file i386/darwin-lib.h"
        tmake_file="$tmake_file rs6000/t-darwin64 rs6000/t-ibm-ldouble"
        extra_parts="$extra_parts crt2.o crt3_2.o libef_ppc.a dw_ppc.o"
        ;;
index 3047f53..42f5214 100644 (file)
@@ -1,5 +1,3 @@
 # We need the save_world code for the EH library.
 
-LIBEHSOBJS +=  darwin-world_s.o
-
-$(LIBEHSOBJS): libef_ppc.a
+LIBEHSOBJS += darwin-world_s.o
index 8481898..9527502 100644 (file)
@@ -2,3 +2,6 @@
 # libgcc_s.1 on systems that used the unwinder in libgcc_s.
 
 LIBEHSOBJS = unwind-dw2_s.o unwind-dw2-fde-darwin_s.o unwind-c_s.o
+
+unwind-dw2_s.o: gthr-default.h md-unwind-support.h
+$(LIBEHSOBJS): libgcc_tm.h
index 7349b87..a8f6966 100644 (file)
@@ -59,9 +59,8 @@ ifneq ($(LIBEHSOBJS),)
 EHS_INSTNAME = libgcc_ehs.$(SHLIB_SOVERSION)$(SHLIB_EXT)
 
 # multilib build for a shared EH lib.
-$(LIBEHSOBJS): libgcc_tm.h
 
-libgcc_ehs$(SHLIB_EXT): $(LIBEHSOBJS)
+libgcc_ehs$(SHLIB_EXT): $(LIBEHSOBJS) $(extra-parts)
        mkdir -p $(MULTIDIR)
        $(CC) $(LIBGCC2_CFLAGS) $(LDFLAGS) -dynamiclib -nodefaultlibs \
        -install_name $(SHLIB_INSTALL_DIR)/$(EHS_INSTNAME) \
@@ -113,7 +112,8 @@ libgcc_ehs.$(SHLIB_SOVERSION)$(SHLIB_EXT): all-multi libgcc_ehs$(SHLIB_EXT)
        rm libgcc_ehs.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T*
 
 
-libgcc_s.1.dylib: libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT) libgcc_ehs.$(SHLIB_SOVERSION)$(SHLIB_EXT)
+libgcc_s.1.dylib: all-multi libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT) \
+                 libgcc_ehs.$(SHLIB_SOVERSION)$(SHLIB_EXT)
        MLIBS=`$(CC) --print-multi-lib | sed -e 's/;.*$$//'` ; \
        for mlib in $$MLIBS ; do \
          cp ../$${mlib}/libgcc/$${mlib}/libgcc_s$(SHLIB_EXT)  \
@@ -134,7 +134,7 @@ libgcc_s.1.dylib: libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT) libgcc_ehs.$(SHLIB_SOV
 
 else
 
-libgcc_s.1.dylib: libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)
+libgcc_s.1.dylib: all-multi libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)
        MLIBS=`$(CC) --print-multi-lib | sed -e 's/;.*$$//'` ; \
        for mlib in $$MLIBS ; do \
          cp ../$${mlib}/libgcc/$${mlib}/libgcc_s$(SHLIB_EXT)  \