[uClibc-cvs] uClibc/libc Makefile,1.25,1.26

Erik Andersen andersen at codepoet.org
Wed Feb 5 07:45:39 UTC 2003


Update of /var/cvs/uClibc/libc
In directory winder:/tmp/cvs-serv4703/libc

Modified Files:
	Makefile 
Log Message:
Patch from Stefan Allius to make adding libgcc functions to the library an
option, to avoid the possibility of adding non PIC code into the shared PIC
uClibc library, thereby making the .text segment unshareable.


Index: Makefile
===================================================================
RCS file: /var/cvs/uClibc/libc/Makefile,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- Makefile	23 Jan 2003 15:36:00 -0000	1.25
+++ Makefile	5 Feb 2003 07:45:35 -0000	1.26
@@ -36,6 +36,12 @@
 CRTOBJS="../../lib/crt0.o"
 endif
 
+ifeq ($(strip $(ADD_LIBGCC_FUNCTIONS)),y)
+LIBGCC_NEED=./tmp/libgcc-need.a
+else
+LIBGCC=
+endif
+
 DIRS = misc pwd_grp stdio string termios inet signal stdlib sysdeps unistd
 
 # Check if the target architecture has a version script for
@@ -54,17 +60,11 @@
 $(LIBNAME): subdirs ar-target
 
 
-shared: $(TOPDIR)lib/$(LIBNAME)
-	@rm -rf tmp
-	@mkdir tmp
-	$(AR) rv ./tmp/libgcc-need.a
-	@(cd tmp && CC=$(CC) LD=$(LD) LDFLAGS=$(CPU_LDFLAGS-y) NM=$(NM) AR=$(AR) \
-		LIBGCC=$(LIBGCC) CRTOBJS=$(CRTOBJS) \
-		/bin/sh $(TOPDIR)../extra/scripts/get-needed-libgcc-objects.sh)
+shared: $(TOPDIR)lib/$(LIBNAME) $(LIBGCC_NEED)
 	$(LD) $(LDFLAGS) $(VERSION_SCRIPT) -soname=$(SHARED_MAJORNAME) -o $(SHARED_FULLNAME) \
-		--whole-archive ./tmp/libgcc-need.a $(LIBNAME) --no-whole-archive \
-		-init __uClibc_init $(TOPDIR)/libc/misc/internals/interp.o \
-		$(LIBGCC)
+		--whole-archive $(LIBGCC_NEED) $(LIBNAME) \
+		$(TOPDIR)/libc/misc/internals/interp.o --no-whole-archive \
+		-init __uClibc_init $(LIBGCC)
 	@true #rm -rf tmp
 	install -d $(TOPDIR)lib
 	rm -f $(TOPDIR)lib/$(SHARED_FULLNAME)
@@ -72,6 +72,13 @@
 	(cd ../lib && ln -sf $(SHARED_FULLNAME) libc.so);
 	(cd ../lib && ln -sf $(SHARED_FULLNAME) $(SHARED_MAJORNAME));
 
+$(LIBGCC_NEED): $(TOPDIR)lib/$(LIBNAME)
+	@rm -rf tmp
+	@mkdir tmp
+	$(AR) rv $@
+	@(cd tmp && CC=$(CC) LD=$(LD) LDFLAGS=$(CPU_LDFLAGS-y) NM=$(NM) AR=$(AR) \
+		LIBGCC=$(LIBGCC) CRTOBJS=$(CRTOBJS) \
+		/bin/sh $(TOPDIR)../extra/scripts/get-needed-libgcc-objects.sh)
 
 halfclean:
 	@rm -f $(LIBNAME) uClibc_config.h




More information about the uClibc-cvs mailing list