# 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 && \
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)
$(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
$(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:
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)
"(\".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
/*
* 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);
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. */