[uClibc]mods for build process

Joel Coltoff joel at wmi.com
Wed Sep 11 18:08:51 UTC 2002


The missing piece to my build problem for mipsel was provided by
Jay Carlson. Thanks Jay. I attached 3 patches. The first is
the mod to the Makefile in gcc-3.1.1-uclibc-20020812.src.tar.gz
that made it all work. It should work for architectures other than
mipsel but I haven't tested i386 and can't test powerpc.

The other attachments are patches that the Makefile applies from
the sources directory. The files in binutils/bfd and gcc/config/mips
that control the dynamic loader don't get fixed by the perl that
is run. These patches fix the files in gcc-3.1.1 and binutils-2.13.
The gcc patch may work for older versions of gcc but the I think
the one in binutils is specific to binutils-2.13. Sorry, I can't
check this right now. It's rather easy to fix the perl to modify
the mips stuff in binutils but I opted for a patch instead.

Without these patches your dynamic loader will be /lib/ld.so.1.
This isn't a problem if you've only got uClibc linked files on
your system but we don't. It's also not the way it is supposed to
work.

-- 
Joel Coltoff

If I had my life to live again, I'd make the same mistakes, only sooner.
    -- Tallulah Bankhead

-------------- next part --------------
--- Makefile.orig	Wed Sep 11 13:32:33 2002
+++ Makefile	Wed Sep 11 13:51:37 2002
@@ -289,7 +289,9 @@
 	touch $(GCC_BUILD_DIR1)/.configured
 
 $(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
-	PATH=$(STAGING_DIR)/bin:$$PATH $(MAKE) -C $(GCC_BUILD_DIR1);
+	PATH=$(STAGING_DIR)/bin:$$PATH $(MAKE) -C $(GCC_BUILD_DIR1) \
+	AR_FOR_TARGET=$(TARGET_PATH)/bin/$(ARCH)-uclibc-ar \
+	RANLIB_FOR_TARGET=$(TARGET_PATH)/bin/$(ARCH)-uclibc-ranlib
 	touch $(GCC_BUILD_DIR1)/.compiled
 
 $(GCC_BUILD_DIR1)/.installed: $(GCC_BUILD_DIR1)/.compiled
@@ -442,7 +444,9 @@
 	touch $(GCC_BUILD_DIR2)/.configured
 
 $(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
-	PATH=$(STAGING_DIR)/bin:$$PATH $(MAKE) -C $(GCC_BUILD_DIR2)
+	PATH=$(STAGING_DIR)/bin:$$PATH $(MAKE) -C $(GCC_BUILD_DIR2) \
+	AR_FOR_TARGET=$(TARGET_PATH)/bin/$(ARCH)-uclibc-ar \
+	RANLIB_FOR_TARGET=$(TARGET_PATH)/bin/$(ARCH)-uclibc-ranlib
 	touch $(GCC_BUILD_DIR2)/.compiled
 
 $(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled
-------------- next part --------------
--- binutils-2.13/bfd/elfxx-mips.c	Tue Jul 30 14:19:42 2002
+++ binutils-2.13-new/bfd/elfxx-mips.c	Wed Sep 11 08:14:47 2002
@@ -471,7 +471,7 @@
 #define ELF_DYNAMIC_INTERPRETER(abfd) 		\
    (ABI_N32_P (abfd) ? "/usr/lib32/libc.so.1" 	\
     : ABI_64_P (abfd) ? "/usr/lib64/libc.so.1" 	\
-    : "/usr/lib/libc.so.1")
+    : "/lib/ld-uClibc.so.0")
 
 #ifdef BFD64
 #define ELF_R_SYM(bfd, i)					\
-------------- next part --------------
--- gcc-3.1.1/gcc/config/mips/linux.h	Mon Apr 15 16:27:33 2002
+++ gcc-3.1.1-new/gcc/config/mips/linux.h	Wed Sep 11 10:23:53 2002
@@ -211,7 +211,7 @@
     %{!ibcs: \
       %{!static: \
         %{rdynamic:-export-dynamic} \
-        %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+        %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
         %{static:-static}}}"
 
 


More information about the uClibc mailing list