From 8557ffa0fd03079db04dc337fc31edabe311c369 Mon Sep 17 00:00:00 2001 From: Tobias Anderberg Date: Mon, 16 Sep 2002 08:18:46 +0000 Subject: * Added semi-support for version scripts. If sysdeps/linux//libc.map exists read it and include it when linking. * Add LIBGCC when linking libc. --- libc/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libc/Makefile') diff --git a/libc/Makefile b/libc/Makefile index fccca7b4f..401a56695 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -32,6 +32,11 @@ include $(TOPDIR)Rules.mak DIRS = misc pwd_grp stdio string termios inet signal stdlib sysdeps unistd +# Check if the target architecture has a version script for +# libc, and if so, include it when linking. +VERSION_SCRIPT:=${shell if [ -f sysdeps/linux/$(TARGET_ARCH)/libc.map ] ; then \ + echo "--version-script sysdeps/linux/$(TARGET_ARCH)/libc.map"; fi} + all: halfclean subdirs $(LIBNAME) $(DO_SHARED) $(LIBNAME): subdirs @@ -46,9 +51,10 @@ shared: $(TOPDIR)lib/$(LIBNAME) $(AR) rv ./tmp/libgcc-need.a @(cd tmp && CC=$(CC) LD=$(LD) NM=$(NM) AR=$(AR) \ /bin/sh $(TOPDIR)../extra/scripts/get-needed-libgcc-objects.sh) - $(LD) $(LDFLAGS) -soname=$(SHARED_MAJORNAME) -o $(SHARED_FULLNAME) \ + $(LD) $(LDFLAGS) $(VERSION_SCRIPT) -soname=$(SHARED_MAJORNAME) -o $(SHARED_FULLNAME) \ --whole-archive ./tmp/libgcc-need.a $(LIBNAME) --no-whole-archive \ - $(TOPDIR)/libc/misc/internals/interp.o + $(TOPDIR)/libc/misc/internals/interp.o \ + $(LIBGCC) @/bin/true #rm -rf tmp install -d $(TOPDIR)lib rm -f $(TOPDIR)lib/$(SHARED_FULLNAME) -- cgit v1.2.3