diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-10-01 05:30:25 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-10-01 05:30:25 +0000 |
commit | b58a631942341b6ccb62ab400e862f404e22dbbf (patch) | |
tree | 0c6e622729b6c98417a15c0b7c10279c17ca0038 /libpthread | |
parent | 351c1d9029844a97d2771da883fc2b432d5e1bd4 (diff) |
This commit contains a patch from Stefan Allius <allius@atecom.com> to change
how uClibc handles _init and _fini, allowing shared lib constructors and
destructors to initialize things in the correct sequence. Stefan ported the SH
architecture. I then ported x86, arm, and mips. x86 and arm are working fine,
but I don't think I quite got things correct for mips.
Diffstat (limited to 'libpthread')
-rw-r--r-- | libpthread/Makefile | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libpthread/Makefile b/libpthread/Makefile index 7566b4753..7edf34f66 100644 --- a/libpthread/Makefile +++ b/libpthread/Makefile @@ -36,6 +36,15 @@ ifeq ($(strip $(DODEBUG)),true) endif endif +GCC_LIB_DIR = $(dir $(shell $(CC) -print-libgcc-file-name )) +ifeq ($(strip $(DOPIC)),true) + START_FILES = $(TOPDIR)lib/crti.o $(GCC_LIB_DIR)crtbeginS.o + END_FILES = $(GCC_LIB_DIR)crtendS.o $(TOPDIR)lib/crtn.o +else + START_FILES = $(TOPDIR)lib/crti.o $(GCC_LIB_DIR)crtbegin.o + END_FILES = $(GCC_LIB_DIR)crtend.o $(TOPDIR)lib/crtn.o +endif + ALL_SUBDIRS = linuxthreads linuxthreads_db all: $(LIBPTHREAD) $(LIBTHREAD_DB) @@ -67,9 +76,9 @@ shared: all if [ -f $(LIBPTHREAD) ] ; then \ set -e; \ $(LD) $(LDFLAGS) -soname=$(LIBPTHREAD_SHARED).$(MAJOR_VERSION) \ - -o $(LIBPTHREAD_SHARED_FULLNAME) --whole-archive $(LIBPTHREAD) \ + -o $(LIBPTHREAD_SHARED_FULLNAME) $(START_FILES) --whole-archive $(LIBPTHREAD) \ --no-whole-archive $(TOPDIR)/libc/misc/internals/interp.o \ - -L$(TOPDIR)/lib -lc; \ + -L$(TOPDIR)/lib -lc $(END_FILES); \ install -d $(TOPDIR)lib; \ rm -f $(TOPDIR)lib/$(LIBPTHREAD_SHARED_FULLNAME) \ $(TOPDIR)lib/$(LIBPTHREAD_SHARED).$(MAJOR_VERSION); \ @@ -82,9 +91,9 @@ shared: all if [ -f $(LIBTHREAD_DB) ] ; then \ set -e; \ $(LD) $(LDFLAGS) -soname=$(LIBTHREAD_DB_SHARED).$(MAJOR_VERSION) \ - -o $(LIBTHREAD_DB_SHARED_FULLNAME) --whole-archive $(LIBTHREAD_DB) \ + -o $(LIBTHREAD_DB_SHARED_FULLNAME) $(START_FILES) --whole-archive $(LIBTHREAD_DB) \ --no-whole-archive $(TOPDIR)/libc/misc/internals/interp.o \ - -L$(TOPDIR)/lib -lc; \ + -L$(TOPDIR)/lib -lc $(END_FILES); \ install -d $(TOPDIR)lib; \ rm -f $(TOPDIR)lib/$(LIBTHREAD_DB_SHARED_FULLNAME) \ $(TOPDIR)lib/$(LIBTHREAD_DB_SHARED).$(MAJOR_VERSION); \ |