diff options
Diffstat (limited to 'libc')
-rw-r--r-- | libc/Makefile | 11 | ||||
-rw-r--r-- | libc/misc/internals/Makefile | 8 | ||||
-rw-r--r-- | libc/misc/internals/__uClibc_main.c | 3 | ||||
-rw-r--r-- | libc/misc/internals/static.c | 4 |
4 files changed, 15 insertions, 11 deletions
diff --git a/libc/Makefile b/libc/Makefile index fc31a2cbb..5a9a908d6 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -52,7 +52,8 @@ all: halfclean $(LIBNAME_TARGET) $(DO_SHARED) # the wildcard will be evaluated when `make` is run instead of when the make # target is evaluated. That means if you run `rm obj.* ; make`, the wildcard # will evaluate to no files :(. -$(LIBNAME) ar-target: subdirs +$(LIBNAME) shared_$(LIBNAME) ar-target: subdirs + $(RM) $(LIBNAME) shared_$(LIBNAME) objs=`cat obj.*` ; \ $(AR) $(ARFLAGS) $(LIBNAME) $$objs && \ $(AR) dN 2 $(LIBNAME) $$objs && \ @@ -66,6 +67,8 @@ $(LIBNAME) ar-target: subdirs fi ; \ $(AR) $(ARFLAGS) $(LIBNAME) $$objs || exit 1 ; \ done + cp $(LIBNAME) shared_$(LIBNAME) + $(AR) $(ARFLAGS) $(LIBNAME) misc/internals/static.o || exit 1 $(RANLIB) $(LIBNAME) $(LIBNAME_TARGET): $(LIBNAME) @@ -73,9 +76,9 @@ $(LIBNAME_TARGET): $(LIBNAME) $(RM) $(TOPDIR)lib/$(LIBNAME) $(INSTALL) -m 644 $(LIBNAME) $(TOPDIR)lib -shared: $(LIBNAME) +shared: shared_$(LIBNAME) $(LD) $(LDFLAGS) $(VERSION_SCRIPT) -soname=$(SHARED_MAJORNAME) -o $(SHARED_FULLNAME) \ - --whole-archive $(LIBNAME) \ + --whole-archive shared_$(LIBNAME) \ $(TOPDIR)libc/misc/internals/interp.o --no-whole-archive \ -init __uClibc_init $(LIBGCC) $(LDADD_LIBFLOAT) @true #$(RM) -r tmp @@ -86,7 +89,7 @@ shared: $(LIBNAME) $(LN) -sf $(SHARED_FULLNAME) $(TOPDIR)lib/$(SHARED_MAJORNAME) halfclean: - @$(RM) $(LIBNAME) uClibc_config.h + @$(RM) $(LIBNAME) shared_$(LIBNAME) uClibc_config.h @$(RM) $(SHARED_FULLNAME) $(SHARED_MAJORNAME) uClibc-0.* libc.so* tags: diff --git a/libc/misc/internals/Makefile b/libc/misc/internals/Makefile index 23816b38d..933b169a6 100644 --- a/libc/misc/internals/Makefile +++ b/libc/misc/internals/Makefile @@ -31,7 +31,7 @@ OBJS=$(COBJS) OBJ_LIST=../../obj.misc.internals -all: $(OBJ_LIST) interp.o +all: $(OBJ_LIST) interp.o static.o $(OBJ_LIST): $(OBJS) echo $(patsubst %, misc/internals/%, $(OBJS)) > $(OBJ_LIST) @@ -44,11 +44,7 @@ interp.c: Makefile "(\".interp\"))) =\""$(DYNAMIC_LINKER)"\";" >> interp.c echo "#endif" >> interp.c -interp.o: interp.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c +$(COBJS) interp.o static.o: %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index 071d6d613..21864ba4f 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -32,6 +32,7 @@ extern void __guard_setup(void); /* * Prototypes. */ +extern void *__libc_stack_end; extern void weak_function _stdio_init(void); extern int *weak_const_function __errno_location(void); extern int *weak_const_function __h_errno_location(void); @@ -172,7 +173,7 @@ __uClibc_main(int (*main)(int, char **, char **), int argc, unsigned long *aux_dat; Elf32_auxv_t auxvt[AT_EGID + 1]; #endif - + __libc_stack_end = stack_end; /* We need to initialize uClibc. If we are dynamically linked this * may have already been completed by the shared lib loader. We call * __uClibc_init() regardless, to be sure the right thing happens. */ diff --git a/libc/misc/internals/static.c b/libc/misc/internals/static.c new file mode 100644 index 000000000..cd39ffdd7 --- /dev/null +++ b/libc/misc/internals/static.c @@ -0,0 +1,4 @@ +#include <stddef.h> + +/* Force static libraries to know about ... */ +void *__libc_stack_end=NULL; |