This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Make libgcc.a symbols .hidden (fix for non-GNU make)


Hi!

On Wed, Feb 27, 2002 at 01:51:11AM -0600, Loren James Rittle wrote:
> In article <20020226184219.V2204@sunsite.ms.mff.cuni.cz> Jakub Jelinek writes:
> 
> > The following patch marks all libgcc.a functions
> > as .hidden (with the exception of _bb.o where I'm not sure what should
> > be done).
> 
> FYI, you have used a GNU make feature not present in BSD make.
> 
> Caught by nightly automatic bootstrap on 3.1 branch on
> i386-*-freebsd4.5.  Rolling back to -r1.37 mklibgcc.in restores
> bootstrap.  Since this is in the core bootstrap process of the C
> compiler not a support library or language, it needs to be fixed under
> current rules.
> 
> Here is the fatal error:
> 
> make: don't know how to make libgcc/./%.oS:. Stop

Would the following work for you?
Note I had exactly this in the tree until I fired make -j4 bootstrap,
which died (and that's why I added "$libgcc_a_objs: ").
The problem is that libgcc.mk has:
all: stmp-dirs libgcc.a libgcc_eh.a libgcc_s.so
(where basically all goals in libgcc.mk depend on libgcc/ and libgcc
multilib dirs to be created).
With make -jN, make is free to make stmp-dirs goal at the same time as
libgcc/./_muldi3.oS (or whatever else), but if libgcc dir doesn't exist yet,
the implicit libgcc/./%.oS: libgcc/./%.o rule is just not used and
make files.
The following patch tries to fix that by doing make -f libgcc.mk stmp-dirs
separately strictly before make -f libgcc.mk {all,install}.
Richard, what do you think about it? Perhaps stmp-dirs could be removed
from all and install dependencies then.

2002-02-28  Jakub Jelinek  <jakub@redhat.com>

	* mklibgcc.in: Don't use GNU make extension.
	* Makefile.in (libgcc.a, stmp-multilib, install-libgcc,
	install-multilib): Make stmp-dirs first.

--- gcc/mklibgcc.in.jj	Thu Feb 28 00:09:30 2002
+++ gcc/mklibgcc.in	Thu Feb 28 00:41:13 2002
@@ -277,7 +277,7 @@ for ml in $MULTILIBS; do
 
     # .oS objects will have all non-local symbol definitions .hidden
     echo ""
-    echo "$libgcc_a_objs: libgcc/${dir}/%.oS: libgcc/${dir}/%${objext}"
+    echo "libgcc/${dir}/%.oS: libgcc/${dir}/%${objext}"
     echo "	@\$(NM_FOR_TARGET) $SHLIB_NM_FLAGS \$^" \\
     echo "	 | \$(AWK) 'NF == 3 { print \".hidden\", \$\$3 }'" \\
     echo '	 | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -Wl,-r -nostdinc' \\ 
--- gcc/Makefile.in.jj	Fri Feb 22 11:31:46 2002
+++ gcc/Makefile.in	Thu Feb 28 00:52:47 2002
@@ -1016,6 +1016,7 @@ LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES)
 	$(LIB2ADDEHDEP) $(EXTRA_PARTS) $(srcdir)/config/$(LIB1ASMSRC)
 
 libgcc.a: $(LIBGCC_DEPS)
+	$(MAKE) -f libgcc.mk stmp-dirs
 	$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
 	  HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
 	  AR_FOR_TARGET="$(AR_FOR_TARGET)" \
@@ -1050,6 +1051,7 @@ s-mlib: $(srcdir)/genmultilib Makefile
 
 # Build multiple copies of libgcc.a, one for each target switch.
 stmp-multilib: $(LIBGCC_DEPS)
+	$(MAKE) -f libgcc.mk stmp-dirs
 	$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
 	  HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
 	  AR_FOR_TARGET="$(AR_FOR_TARGET)" \
@@ -2706,6 +2708,7 @@ install-libgcc: libgcc.mk libgcc.a insta
 	else \
 	  r_f_t=: ; \
 	fi; \
+	$(MAKE) -f libgcc.mk stmp-dirs; \
 	$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
 	  HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
 	  AR_FOR_TARGET="$(AR_FOR_TARGET)" \
@@ -2732,6 +2735,7 @@ install-multilib: stmp-multilib installd
 	else \
 	  r_f_t=: ; \
 	fi; \
+	$(MAKE) -f libgcc.mk stmp-dirs; \
 	$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
 	  HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
 	  AR_FOR_TARGET="$(AR_FOR_TARGET)" \


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]