[uClibc] Observation: uclibc snapshot won't build againstgcc-3.4.4for ppc

Joakim Tjernlund Joakim.Tjernlund at lumentis.se
Sun Jun 19 12:56:19 UTC 2005


> 
> > 
> > Hi Folks,
> > 
> > Building for ppc.
> > 
> > Using buildroot-snapshot, apps built w/ gcc-3.4.4 (including ldd) won't 
> > build against uclibc due to a reference in libgcc to __libc_stack_end.  I 
> > found the code that references it in the config/rs6000 stuff.
> > 
> > I'm not quite sure what would happen if I removed it.
> 
> Is it only powerpc that needs this symbol?
> 
> It appears that MIPS needs it too for NPTL and I guess that most/all archs will need
> it.
> 
> I think that __libc_stack_end needs to be impl. in uclibc, the NPTL
> http://uclibc.org/cgi-bin/viewcvs.cgi/branches/uClibc-nptl/ldso/ldso/dl-startup.c?rev=10461&view=auto 
> branch already have it.
> 
>  Jocke

Does this help? Not tested.
Index: libc/misc/internals/__uClibc_main.c
===================================================================
--- libc/misc/internals/__uClibc_main.c	(revision 10413)
+++ libc/misc/internals/__uClibc_main.c	(working copy)
@@ -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. */
Index: ldso/ldso/dl-startup.c
===================================================================
--- ldso/ldso/dl-startup.c	(revision 10505)
+++ ldso/ldso/dl-startup.c	(working copy)
@@ -97,9 +97,10 @@
 /* Static declarations */
 int (*_dl_elf_main) (int, char **, char **);
 
+static void* __rtld_stack_end;
+strong_alias(__rtld_stack_end, __libc_stack_end);
 
 
-
 /* When we enter this piece of code, the program stack looks like this:
         argc            argument counter (integer)
         argv[0]         program name (pointer)
@@ -306,6 +307,8 @@
 	   free to start using global variables, since these things have all been
 	   fixed up by now.  Still no function calls outside of this library ,
 	   since the dynamic resolver is not yet ready. */
+	__rtld_stack_end = (void *)args;
+
 	_dl_get_ready_to_run(tpnt, load_addr, auxvt, envp, argv);
 
 




More information about the uClibc mailing list