Browse Source

fix gcc package

- simple test c program compiles in qemu-mips with the
  cross-compiled compiler
- don't know if rstrip.sh change is good, need to check,
  but crt*.o symbols might not be stripped
- create helper links for libgcc + libc needed for ld
Waldemar Brodkorb 15 years ago
parent
commit
141bcc0f9d
4 changed files with 15 additions and 7 deletions
  1. 7 3
      package/gcc/Makefile
  2. 1 0
      package/mpfr/Makefile
  3. 3 1
      package/uclibc/Makefile
  4. 4 3
      scripts/rstrip.sh

+ 7 - 3
package/gcc/Makefile

@@ -16,6 +16,7 @@ ifeq ($(ADK_LINUX_MIPS64_LEMOTE),y)
 CONFIGURE_ARGS+=	--with-abi=64
 endif
 CONFIGURE_ARGS+=	--enable-languages=c \
+			--libexecdir=/usr/lib \
 			--host=$(REAL_GNU_TARGET_NAME) \
 			--target=$(REAL_GNU_TARGET_NAME) \
 			--disable-__cxa_atexit \
@@ -32,9 +33,12 @@ INSTALL_STYLE:=		auto
 INSTALL_TARGET:=	install-gcc install-target-libgcc
 
 post-install:
-	${INSTALL_DIR} ${IDIR_GCC}/usr/lib
-	${INSTALL_DIR} ${IDIR_GCC}/usr/bin
+	${INSTALL_DIR} ${IDIR_GCC}/usr/lib/gcc ${IDIR_GCC}/usr/bin
 	${INSTALL_BIN} ${WRKINST}/usr/bin/gcc ${IDIR_GCC}/usr/bin/
-	${INSTALL_BIN} ${WRKINST}/usr/bin/ccp ${IDIR_GCC}/usr/bin/
+	${INSTALL_BIN} ${WRKINST}/usr/bin/cpp ${IDIR_GCC}/usr/bin/
+	${CP} ${WRKINST}/usr/lib/gcc/* ${IDIR_GCC}/usr/lib/gcc/
+	${CP} ${STAGING_DIR}/lib/crt* ${IDIR_GCC}/usr/lib
+	rm -rf ${IDIR_GCC}/usr/lib/gcc/*/*/include-fixed
+	rm -rf ${IDIR_GCC}/usr/lib/gcc/*/*/install-tools
 
 include ${TOPDIR}/mk/pkg-bottom.mk

+ 1 - 0
package/mpfr/Makefile

@@ -15,5 +15,6 @@ INSTALL_STYLE=		auto
 
 post-install:
 	${INSTALL_DIR} ${IDIR_MPFR}/usr/lib
+	${CP} ${WRKINST}/usr/lib/libmpfr.so.* ${IDIR_MPFR}/usr/lib/
 
 include ${TOPDIR}/mk/pkg-bottom.mk

+ 3 - 1
package/uclibc/Makefile

@@ -28,11 +28,13 @@ endif
 		$(CP) $(STAGING_DIR)/lib/$$file.so.* $(IDIR_UCLIBC)/lib/; \
 		$(CP) $(STAGING_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_UCLIBC)/lib/; \
 	done
-	# create ld.so link for ldd
+	# create links for ldd / gcc
 ifneq (${CPU_ARCH},x86_64)
 	cd $(IDIR_UCLIBC)/lib && ln -sf ld-uClibc.so.0 ld.so
 else
 	cd $(IDIR_UCLIBC)/lib && ln -sf ld64-uClibc.so.0 ld.so
 endif
+	cd $(IDIR_UCLIBC)/lib && ln -sf libc.so.0 libc.so
+	cd $(IDIR_UCLIBC)/lib && ln -sf libgcc_s.so.1 libgcc_s.so
 
 include ${TOPDIR}/mk/pkg-bottom.mk

+ 4 - 3
scripts/rstrip.sh

@@ -37,6 +37,9 @@ find $TARGETS -type f -a -exec file {} \; | \
 	*ELF*executable*statically\ linked*)
 		echo >&2 "$SELF: *WARNING* '$V' is not dynamically linked!"
 		;;
+	*ELF*relocatable*,\ not\ stripped*)
+		echo >&2 "$SELF: *WARNING* '$V' is a relocatable!"
+		;;
 	esac
 	case $line in
 	*ELF*executable*,\ not\ stripped*)
@@ -48,14 +51,12 @@ find $TARGETS -type f -a -exec file {} \; | \
 		    sed -n -e '/__param_/s/^.*__param_/-K /p' \
 		    -e '/__module_parm_/s/^.*__module_parm_/-K /p'))"
 		S='kernel module' ;;
-	*ELF*relocatable*,\ not\ stripped*)
-		S=relocatable ;;
 	*ELF*shared\ object*,\ not\ stripped*)
 		S='shared object' ;;
 	*)
 		continue ;;
 	esac
 	echo "$SELF: $V:$S"
-	#echo "+ $T $F"
+	echo "-> $T $F"
 	eval "$T $F"
 done