mklibgcc fallout

Alan Modra amodra@bigpond.net.au
Sat Dec 4 03:06:00 GMT 2004


On Fri, Dec 03, 2004 at 02:42:25PM -0800, Mark Mitchell wrote:
> I'm not 100% clear if the compiler is presently broken after 
> installation, of if it's just the case that the layout before 
> installation is not as you desire.

It is currently broken for *bootstrap* on multilib targets.  The
following fixes all the problems I know about, and builds
libgcc_s*.so.1 and libunwind*.so.7 in gcc/.  The patch doesn't change
any install locations.  So far, tested by "make quickstrap" and visually
scanning rules in libgcc.mk for both powerpc-linux and powerpc64-linux.
Bootstrap in progress.

	* mklibgcc.in: Build shared libgcc and shared libunwind in gcc/.
	Don't subst shlib_dir for SHLIB_LINK, SHLIBUNWIND_LINK,
	SHLIB_INSTALL, and SHLIBUNWIND_INSTALL.
	* config/i386/t-nwld (SHLIB_NAME): Use shlib_base_name in place of
	shlib_dir and shlib_so_name.
	* config/mips/t-slibgcc-irix (SHLIB_NAME): Likewise.
	* config/t-libunwind-elf (SHLIB_NAME): Likewise.
	* config/t-slibgcc-darwin (SHLIB_NAME): Likewise.
	* config/t-slibgcc-sld (SHLIB_NAME): Likewise.
	(SHLIB_LINK): Don't use shlib_dir when creating symlink.

Further cleanup of mklibgcc.in looks possible.  One obvious thing is
that shlib_dir isn't used in the "for ml in $MULTILIBS" loop.

diff -urp -xCVS -x'*~' -x'.#*' gcc-virgin/gcc/mklibgcc.in gcc-current/gcc/mklibgcc.in
--- gcc-virgin/gcc/mklibgcc.in	2004-12-04 09:27:19.813477064 +1030
+++ gcc-current/gcc/mklibgcc.in	2004-12-04 12:40:13.663844692 +1030
@@ -173,21 +173,21 @@ for ml in $MULTILIBS; do
     if [ -z "$SHLIB_MULTILIB" ]; then
       if [ "$dir" = . ]; then
 	libgcc_eh_a=$dir/libgcc_eh.a
-	libgcc_s_so_base=$dir/libgcc_s
+	libgcc_s_so_base=libgcc_s
 	libgcc_s_so=${libgcc_s_so_base}${SHLIB_EXT}
 	libgcc_s_soname=libgcc_s
 	if [ "$LIBUNWIND" ]; then
-	  libunwind_so_base=$dir/libunwind
+	  libunwind_so_base=libunwind
 	  libunwind_so=${libunwind_so_base}${SHLIB_EXT}
 	  libunwind_soname=libunwind
 	fi
       else
 	libgcc_eh_a=$dir/libgcc_eh.a
-	libgcc_s_so_base=$dir/libgcc_s_${suffix}
+	libgcc_s_so_base=libgcc_s_${suffix}
 	libgcc_s_so=${libgcc_s_so_base}${SHLIB_EXT}
 	libgcc_s_soname=libgcc_s_${suffix}
 	if [ "$LIBUNWIND" ]; then
-	  libunwind_so_base=$dir/libunwind_${suffix}
+	  libunwind_so_base=libunwind_${suffix}
 	  libunwind_so=${libunwind_so_base}${SHLIB_EXT}
 	fi
       fi
@@ -215,11 +215,11 @@ for ml in $MULTILIBS; do
 
     elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
       libgcc_eh_a=$dir/libgcc_eh.a
-      libgcc_s_so_base=$dir/libgcc_s
+      libgcc_s_so_base=libgcc_s
       libgcc_s_so=${libgcc_s_so_base}${SHLIB_EXT}
       libgcc_s_soname=libgcc_s
       if [ "$LIBUNWIND" ]; then
-	libunwind_so_base=$dir/libunwind
+	libunwind_so_base=libunwind
 	libunwind_so=${libunwind_so_base}${SHLIB_EXT}
 	libunwind_soname=libunwind
       fi
@@ -774,7 +774,6 @@ EOF
 	       -e "s%@shlib_base_name@%$libgcc_s_so_base%g" \
 	       -e "s%@shlib_so_name@%$libgcc_s_soname%g" \
 	       -e "s%@shlib_map_file@%$mapfile%g" \
-	       -e "s%@shlib_dir@%$shlib_dir%g" \
 	       -e "s%@shlib_slibdir_qual@%$shlib_dir_qual%g"
     echo "all: $libgcc_s_so"
   fi
@@ -788,7 +787,6 @@ EOF
 		 -e "s%@shlib_objs@%\$(objects)%g" \
 		 -e "s%@shlib_base_name@%$libunwind_so_base%g" \
 		 -e "s%@shlib_so_name@%$libunwind_soname%g" \
-		 -e "s%@shlib_dir@%$shlib_dir%g" \
 		 -e "s%@shlib_slibdir_qual@%$shlib_dir_qual%g"
     echo "all: $libunwind_so"
   fi
@@ -870,13 +868,11 @@ for ml in $MULTILIBS; do
       echo "	$SHLIB_INSTALL" \
 	| sed -e "s%@shlib_base_name@%$shlib_base_name%g" \
 	      -e "s%@shlib_so_name@%$shlib_so_name%g" \
-	      -e "s%@shlib_dir@%$shlib_dir%g" \
 	      -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
       if [ "$LIBUNWIND" ]; then
 	echo "	$SHLIBUNWIND_INSTALL" \
 	   | sed -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
 		 -e "s%@shlib_so_name@%$shlibunwind_so_name%g" \
-		 -e "s%@shlib_dir@%$shlib_dir%g" \
 		 -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
 	libunwinddir='$(DESTDIR)$(slibdir)$(shlib_slibdir_qual)/$(shlib_dir)'
 	echo '	$(INSTALL_DATA)' ${dir}/libunwind.a ${libunwinddir}/
@@ -887,13 +883,11 @@ for ml in $MULTILIBS; do
       echo "	$SHLIB_INSTALL" \
 	| sed -e "s%@shlib_base_name@%$shlib_base_name%g" \
 	      -e "s%@shlib_so_name@%$shlib_base_name%g" \
-	      -e "s%@shlib_dir@%%g" \
 	      -e "s%@shlib_slibdir_qual@%%g"
       if [ "$LIBUNWIND" ]; then
 	echo "	$SHLIBUNWIND_INSTALL" \
 	   | sed -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
 		 -e "s%@shlib_so_name@%$shlibunwind_base_name%g" \
-		 -e "s%@shlib_dir@%%g" \
 		 -e "s%@shlib_slibdir_qual@%%g"
 	libunwinddir='$(DESTDIR)$(slibdir)'
 	echo '	$(INSTALL_DATA)' ${dir}/libunwind.a ${libunwinddir}/
diff -urp -xCVS -x'*~' -x'.#*' gcc-virgin/gcc/config/i386/t-nwld gcc-current/gcc/config/i386/t-nwld
--- gcc-virgin/gcc/config/i386/t-nwld	2004-12-04 11:59:23.862201945 +1030
+++ gcc-current/gcc/config/i386/t-nwld	2004-12-04 11:59:02.319595246 +1030
@@ -30,7 +30,7 @@ s-crt0: $(srcdir)/unwind-dw2-fde.h
 
 SHLIB_EXT = .nlm
 SHLIB_SONAME = @shlib_so_name@.nlm
-SHLIB_NAME = @shlib_dir@@shlib_so_name@.nlm
+SHLIB_NAME = @shlib_base_name@.nlm
 SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
 SHLIB_DEF = $(srcdir)/config/i386/netware-libgcc.def
 SHLIB_MAP = $(srcdir)/config/i386/netware-libgcc.exp
diff -urp -xCVS -x'*~' -x'.#*' gcc-virgin/gcc/config/mips/t-slibgcc-irix gcc-current/gcc/config/mips/t-slibgcc-irix
--- gcc-virgin/gcc/config/mips/t-slibgcc-irix	2004-12-04 11:59:23.863201788 +1030
+++ gcc-current/gcc/config/mips/t-slibgcc-irix	2004-12-04 11:59:02.319595246 +1030
@@ -4,7 +4,7 @@ SHLIB_EXT = .so
 SHLIB_SOLINK = @shlib_base_name@.so
 SHLIB_SOVERSION = 1
 SHLIB_SONAME = @shlib_so_name@.so.$(SHLIB_SOVERSION)
-SHLIB_NAME = @shlib_dir@@shlib_so_name@.so.$(SHLIB_SOVERSION)
+SHLIB_NAME = @shlib_base_name@.so.$(SHLIB_SOVERSION)
 SHLIB_MAP = @shlib_map_file@
 SHLIB_OBJS = @shlib_objs@
 SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
diff -urp -xCVS -x'*~' -x'.#*' gcc-virgin/gcc/config/t-libunwind-elf gcc-current/gcc/config/t-libunwind-elf
--- gcc-virgin/gcc/config/t-libunwind-elf	2004-12-04 11:59:23.876199740 +1030
+++ gcc-current/gcc/config/t-libunwind-elf	2004-12-04 11:59:02.320595088 +1030
@@ -6,7 +6,7 @@ LIBUNWINDDEP = unwind.inc unwind-dw2-fde
 
 SHLIBUNWIND_SOVERSION = 7
 SHLIBUNWIND_SONAME = @shlib_so_name@.so.$(SHLIBUNWIND_SOVERSION)
-SHLIBUNWIND_NAME = @shlib_dir@@shlib_so_name@.so.$(SHLIBUNWIND_SOVERSION)
+SHLIBUNWIND_NAME = @shlib_base_name@.so.$(SHLIBUNWIND_SOVERSION)
 
 SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared \
 	-nodefaultlibs -Wl,-h,$(SHLIBUNWIND_SONAME) \
diff -urp -xCVS -x'*~' -x'.#*' gcc-virgin/gcc/config/t-slibgcc-darwin gcc-current/gcc/config/t-slibgcc-darwin
--- gcc-virgin/gcc/config/t-slibgcc-darwin	2004-12-04 11:59:23.877199583 +1030
+++ gcc-current/gcc/config/t-slibgcc-darwin	2004-12-04 11:59:02.321594931 +1030
@@ -5,7 +5,7 @@ SHLIB_VERSTRING = -compatibility_version
 SHLIB_EXT = .dylib
 SHLIB_SOLINK = @shlib_base_name@.dylib
 SHLIB_SONAME = @shlib_so_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib
-SHLIB_NAME = @shlib_dir@@shlib_so_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib
+SHLIB_NAME = @shlib_base_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib
 SHLIB_MAP = @shlib_map_file@
 SHLIB_OBJS = @shlib_objs@
 SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
diff -urp -xCVS -x'*~' -x'.#*' gcc-virgin/gcc/config/t-slibgcc-sld gcc-current/gcc/config/t-slibgcc-sld
--- gcc-virgin/gcc/config/t-slibgcc-sld	2004-12-04 11:59:23.878199425 +1030
+++ gcc-current/gcc/config/t-slibgcc-sld	2004-12-04 11:59:02.322594773 +1030
@@ -3,7 +3,7 @@
 SHLIB_EXT = .so
 SHLIB_SOLINK = @shlib_base_name@.so
 SHLIB_SONAME = @shlib_so_name@.so.1
-SHLIB_NAME = @shlib_dir@@shlib_so_name@.so.1
+SHLIB_NAME = @shlib_base_name@.so.1
 SHLIB_MAP = @shlib_map_file@
 SHLIB_OBJS = @shlib_objs@
 SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
@@ -12,12 +12,12 @@ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2
 	-Wl,-h,$(SHLIB_SONAME) -Wl,-z,text -Wl,-z,defs \
 	-Wl,-M,$(SHLIB_MAP) -o $(SHLIB_NAME).tmp \
 	@multilib_flags@ $(SHLIB_OBJS) -lc && \
-	rm -f @shlib_dir@$(SHLIB_SOLINK) && \
+	rm -f $(SHLIB_SOLINK) && \
 	if [ -f $(SHLIB_NAME) ]; then \
 	  mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
 	else true; fi && \
 	mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
-	$(LN_S) $(SHLIB_SONAME) @shlib_dir@$(SHLIB_SOLINK)
+	$(LN_S) $(SHLIB_SONAME) $(SHLIB_SOLINK)
 # $(slibdir) double quoted to protect it from expansion while building
 # libgcc.mk.  We want this delayed until actual install time.
 SHLIB_INSTALL = \

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Gcc-patches mailing list