summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/internals/Makefile8
-rw-r--r--libc/misc/internals/__uClibc_main.c3
-rw-r--r--libc/misc/internals/static.c4
3 files changed, 8 insertions, 7 deletions
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;