summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Anderberg <tobias.anderberg@axis.com>2002-09-16 08:18:46 +0000
committerTobias Anderberg <tobias.anderberg@axis.com>2002-09-16 08:18:46 +0000
commit8557ffa0fd03079db04dc337fc31edabe311c369 (patch)
tree63b118c0dae9dbd506a446fbf8d7a8558db7b835
parent7e973d02053874a35ddc568ec97a1e958c6f6342 (diff)
* Added semi-support for version scripts. If sysdeps/linux/<arch>/libc.map
exists read it and include it when linking. * Add LIBGCC when linking libc.
-rw-r--r--libc/Makefile10
1 files changed, 8 insertions, 2 deletions
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)