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]

Re: PATCH: bootstrap/17684: /usr/ccs/bin/ld: Can't create libgcc_s.sl


On Tue, Sep 28, 2004 at 01:17:02AM +0200, Andreas Schwab wrote:
> "H. J. Lu" <hjl@lucon.org> writes:
> 
> > --- gcc/config/alpha/t-osf4.busy	2003-07-31 07:52:50.000000000 -0700
> > +++ gcc/config/alpha/t-osf4	2004-09-27 16:01:37.000000000 -0700
> > @@ -15,9 +15,13 @@ SHLIB_OBJS = @shlib_objs@
> >  SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
> >  	-Wl,-hidden_symbol,pthread\* -Wl,-hidden_symbol,__pthread\* \
> >  	-Wl,-hidden_symbol,sched_get_\* -Wl,-hidden_symbol,sched_yield \
> > -	-Wl,-msym -Wl,-set_version,gcc.1 -Wl,-soname,$(SHLIB_SONAME) \
> > +	-Wl,-msym -Wl,-set_version,gcc.1 -Wl,-soname,$(SHLIB_SONAME).tmp \
> >  	-o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
> > -	rm -f $(SHLIB_SONAME) && \
> > +	rm -f $(SHLIB_SOLINK) && \
> > +	if [ -f $(SHLIBUNWIND_NAME) ]; then \
> > +	  mv $(SHLIBUNWIND_NAME) \
> > +	     $(SHLIBUNWIND_NAME).`basename t$(STAGE_PREFIX)`; fi && \
> 
> You probably need to add "else true;", otherwise some old shells may
> return a spurious failure.
> 

Sure. I also fixed a few typos.


H.J.
-----
2004-09-27  H.J. Lu  <hongjiu.lu@intel.com>

	PR bootstrap/17684
	* config/alpha/t-osf4 (SHLIB_LINK): Use a temporary file for
	the shared library to be created and don't remove the existing
	shared library.
	* config/arm/t-netbsd (SHLIB_LINK): Likewise.
	* config/mips/t-iris5-6 (SHLIB_LINK): Likewise.
	* config/pa/t-hpux-shlib (SHLIB_LINK): Likewise.
	* config/sh/t-linux (SHLIB_LINK): Likewise.
	* config/t-libunwind-elf (SHLIBUNWIND_LINK): Likewise.
	* config/t-slibgcc-darwin (SHLIB_LINK): Likewise.
	* config/t-slibgcc-elf-ver (SHLIB_LINK): Likewise.
	* config/t-slibgcc-sld (SHLIB_LINK): Likewise.

--- gcc/config/alpha/t-osf4.busy	2003-07-31 07:52:50.000000000 -0700
+++ gcc/config/alpha/t-osf4	2004-09-27 17:15:14.000000000 -0700
@@ -15,9 +15,13 @@ SHLIB_OBJS = @shlib_objs@
 SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
 	-Wl,-hidden_symbol,pthread\* -Wl,-hidden_symbol,__pthread\* \
 	-Wl,-hidden_symbol,sched_get_\* -Wl,-hidden_symbol,sched_yield \
-	-Wl,-msym -Wl,-set_version,gcc.1 -Wl,-soname,$(SHLIB_SONAME) \
+	-Wl,-msym -Wl,-set_version,gcc.1 -Wl,-soname,$(SHLIB_SONAME).tmp \
 	-o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
 	rm -f $(SHLIB_SONAME) && \
+	if [ -f $(SHLIB_NAME) ]; then \
+	  mv $(SHLIB_NAME) $(SHLIB_NAME).`basename t$(STAGE_PREFIX)`; \
+	then true; fi && \
+	mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
 	$(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
 # $(slibdir) double quoted to protect it from expansion while building
 # libgcc.mk.  We want this delayed until actual install time.
--- gcc/config/arm/t-netbsd.busy	2003-09-25 09:02:43.000000000 -0700
+++ gcc/config/arm/t-netbsd	2004-09-27 17:15:20.000000000 -0700
@@ -11,8 +11,12 @@ SHLIB_OBJS = @shlib_objs@
 
 SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
 	-Wl,-soname,$(SHLIB_SONAME) \
-	-o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
+	-o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
 	rm -f $(SHLIB_SONAME) && \
+	if [ -f $(SHLIB_NAME) ]; then \
+	  mv $(SHLIB_NAME) $(SHLIB_NAME).`basename t$(STAGE_PREFIX)`; \
+	then true; fi && \
+	mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
 	$(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
 # $(slibdir) double quoted to protect it from expansion while building
 # libgcc.mk.  We want this delayed until actual install time.
--- gcc/config/mips/t-iris5-6.busy	2004-02-23 13:24:44.000000000 -0800
+++ gcc/config/mips/t-iris5-6	2004-09-27 17:16:27.000000000 -0700
@@ -9,8 +9,12 @@ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual
 
 SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
         -Wl,-soname,$(SHLIB_SONAME) \
-	-o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
+	-o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
 	rm -f $(SHLIB_SOLINK) && \
+	if [ -f $(SHLIB_NAME) ]; then \
+	  mv $(SHLIB_NAME) $(SHLIB_NAME).`basename t$(STAGE_PREFIX)`; \
+	then true; fi && \
+	mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
 	$(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
 # ??? Irix 6.5 seems to eat the option fine (if we somehow remove the
 # -hidden_symbol option, which is documented to be ignored in conjunction
--- gcc/config/pa/t-hpux-shlib.busy	2003-03-03 12:04:07.000000000 -0800
+++ gcc/config/pa/t-hpux-shlib	2004-09-27 17:18:11.000000000 -0700
@@ -5,8 +5,12 @@ SHLIB_SONAME = @shlib_base_name@.1
 SHLIB_OBJS = @shlib_objs@
 
 SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared  -nodefaultlibs \
-	-o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
+	-o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
         rm -f $(SHLIB_SONAME) && \
+	if [ -f $(SHLIB_NAME) ]; then \
+	  mv $(SHLIB_NAME) $(SHLIB_NAME).`basename t$(STAGE_PREFIX)`; \
+	then true; fi && \
+	mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
         $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
 
 
--- gcc/config/sh/t-linux.busy	2004-05-28 11:26:53.000000000 -0700
+++ gcc/config/sh/t-linux	2004-09-27 17:16:44.000000000 -0700
@@ -22,8 +22,12 @@ SHLIB_MAPFILES =  $(srcdir)/config/sh/li
 SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
 	-Wl,--soname=$(SHLIB_SONAME) \
 	-Wl,--version-script=$(SHLIB_MAP) \
-	-o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
+	-o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
 	rm -f $(SHLIB_SOLINK) && \
+	if [ -f $(SHLIB_NAME) ]; then \
+	  mv $(SHLIB_NAME) $(SHLIB_NAME).`basename t$(STAGE_PREFIX)`; \
+	then true; fi && \
+	mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
 	(echo "/* GNU ld script"; \
 	 echo "   Use the shared library, but some functions are only in"; \
 	 echo "   the static library.  */"; \
--- gcc/config/t-libunwind-elf.busy	2004-09-08 08:16:15.000000000 -0700
+++ gcc/config/t-libunwind-elf	2004-09-27 17:13:44.000000000 -0700
@@ -10,9 +10,14 @@ SHLIBUNWIND_NAME = @shlib_dir@@shlib_so_
 
 SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared \
 	-nodefaultlibs -Wl,-h,$(SHLIBUNWIND_SONAME) \
-	-Wl,-z,text -Wl,-z,defs \
-	-o $(SHLIBUNWIND_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
+	-Wl,-z,text -Wl,-z,defs -o $(SHLIBUNWIND_NAME).tmp \
+	@multilib_flags@ $(SHLIB_OBJS) -lc && \
 	rm -f $(SHLIB_SOLINK) && \
+	if [ -f $(SHLIBUNWIND_NAME) ]; then \
+	  mv $(SHLIBUNWIND_NAME) \
+	     $(SHLIBUNWIND_NAME).`basename t$(STAGE_PREFIX)`; \
+	then true; fi && \
+	mv $(SHLIBUNWIND_NAME).tmp $(SHLIBUNWIND_NAME) && \
 	$(LN_S) $(SHLIBUNWIND_NAME) $(SHLIB_SOLINK)
 
 # $(slibdir) double quoted to protect it from expansion while building
--- gcc/config/t-slibgcc-darwin.busy	2004-02-23 13:24:33.000000000 -0800
+++ gcc/config/t-slibgcc-darwin	2004-09-27 17:16:55.000000000 -0700
@@ -12,10 +12,14 @@ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual
 
 SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \
 	-Wl,-install_name,$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME) \
-	-Wl,-flat_namespace -o $(SHLIB_NAME) \
+	-Wl,-flat_namespace -o $(SHLIB_NAME).tmp \
 	$(SHLIB_VERSTRING) \
 	@multilib_flags@ $(SHLIB_OBJS) -lc && \
 	rm -f $(SHLIB_SOLINK) && \
+	if [ -f $(SHLIB_NAME) ]; then \
+	  mv $(SHLIB_NAME) $(SHLIB_NAME).`basename t$(STAGE_PREFIX)`; \
+	then true; fi && \
+	mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
 	$(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
 # $(slibdir) double quoted to protect it from expansion while building
 # libgcc.mk.  We want this delayed until actual install time.
--- gcc/config/t-slibgcc-elf-ver.busy	2004-02-23 13:24:33.000000000 -0800
+++ gcc/config/t-slibgcc-elf-ver	2004-09-27 17:12:51.000000000 -0700
@@ -14,8 +14,12 @@ SHLIB_LC = -lc
 SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
 	-Wl,--soname=$(SHLIB_SONAME) \
 	-Wl,--version-script=$(SHLIB_MAP) \
-	-o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
+	-o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
 	rm -f $(SHLIB_SOLINK) && \
+	if [ -f $(SHLIB_NAME) ]; then \
+	  mv $(SHLIB_NAME) $(SHLIB_NAME).`basename t$(STAGE_PREFIX)`; \
+	then true; fi && \
+	mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
 	$(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
 # $(slibdir) double quoted to protect it from expansion while building
 # libgcc.mk.  We want this delayed until actual install time.
--- gcc/config/t-slibgcc-sld.busy	2004-02-23 13:24:33.000000000 -0800
+++ gcc/config/t-slibgcc-sld	2004-09-27 17:13:01.000000000 -0700
@@ -10,9 +10,13 @@ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual
 
 SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
 	-Wl,-h,$(SHLIB_SONAME) -Wl,-z,text -Wl,-z,defs \
-	-Wl,-M,$(SHLIB_MAP) -o $(SHLIB_NAME) \
+	-Wl,-M,$(SHLIB_MAP) -o $(SHLIB_NAME).tmp \
 	@multilib_flags@ $(SHLIB_OBJS) -lc && \
 	rm -f $(SHLIB_SOLINK) && \
+	if [ -f $(SHLIB_NAME) ]; then \
+	  mv $(SHLIB_NAME) $(SHLIB_NAME).`basename t$(STAGE_PREFIX)`; \
+	then true; fi && \
+	mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
 	$(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
 # $(slibdir) double quoted to protect it from expansion while building
 # libgcc.mk.  We want this delayed until actual install time.


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