[uClibc-cvs] svn commit: trunk/uClibc/libc: misc/internals
jocke at uclibc.org
jocke at uclibc.org
Wed Jun 29 23:21:46 UTC 2005
Author: jocke
Date: 2005-06-29 17:21:45 -0600 (Wed, 29 Jun 2005)
New Revision: 10636
Log:
Add __libc_stack_end to libc.
Added:
trunk/uClibc/libc/misc/internals/static.c
Modified:
trunk/uClibc/libc/Makefile
trunk/uClibc/libc/misc/internals/Makefile
trunk/uClibc/libc/misc/internals/__uClibc_main.c
Changeset:
Modified: trunk/uClibc/libc/Makefile
===================================================================
--- trunk/uClibc/libc/Makefile 2005-06-29 23:12:02 UTC (rev 10635)
+++ trunk/uClibc/libc/Makefile 2005-06-29 23:21:45 UTC (rev 10636)
@@ -52,7 +52,8 @@
# 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 @@
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 @@
$(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 @@
$(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:
Modified: trunk/uClibc/libc/misc/internals/Makefile
===================================================================
--- trunk/uClibc/libc/misc/internals/Makefile 2005-06-29 23:12:02 UTC (rev 10635)
+++ trunk/uClibc/libc/misc/internals/Makefile 2005-06-29 23:21:45 UTC (rev 10636)
@@ -31,7 +31,7 @@
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,13 +44,9 @@
"(\".interp\"))) =\""$(DYNAMIC_LINKER)"\";" >> interp.c
echo "#endif" >> interp.c
-interp.o: interp.c
+$(COBJS) interp.o static.o: %.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
-$(COBJS): %.o : %.c
- $(CC) $(CFLAGS) -c $< -o $@
- $(STRIPTOOL) -x -R .note -R .comment $*.o
-
clean:
$(RM) *.[oa] interp.c *~ core
Modified: trunk/uClibc/libc/misc/internals/__uClibc_main.c
===================================================================
--- trunk/uClibc/libc/misc/internals/__uClibc_main.c 2005-06-29 23:12:02 UTC (rev 10635)
+++ trunk/uClibc/libc/misc/internals/__uClibc_main.c 2005-06-29 23:21:45 UTC (rev 10636)
@@ -32,6 +32,7 @@
/*
* 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 @@
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. */
Added: trunk/uClibc/libc/misc/internals/static.c
===================================================================
--- trunk/uClibc/libc/misc/internals/static.c 2005-06-29 23:12:02 UTC (rev 10635)
+++ trunk/uClibc/libc/misc/internals/static.c 2005-06-29 23:21:45 UTC (rev 10636)
@@ -0,0 +1,4 @@
+#include <stddef.h>
+
+/* Force static libraries to know about ... */
+void *__libc_stack_end=NULL;
More information about the uClibc-cvs
mailing list