Update of bug #17647 (project hurd): Status: None => In Progress
_______________________________________________________ Follow-up Comment #2: I had a look today. But now I think I need Roland's or someone else's help. The problem is --- so far --- only in `sysdeps/mach/hurd/i386/init-first.c'. As soon as I compile that file with GCC 4.0 and everything else with GCC 4.1, the resulting `libc.so' doesn't fail anymore. (I was only testing with a primitive ``int main (void) { return 0; }'' so far, but that's already something.) So, what did I find. The problem may be related to this change: #v+ 2005-10-16 Roland McGrath <[EMAIL PROTECTED]> [...] [BZ #1253] * sysdeps/mach/hurd/i386/init-first.c (init): Make cast kosher. (_hurd_stack_setup): Don't declare with arguments and ellipsis. Use __builtin_frame_address and __builtin_return_address. (_dl_init_first): Likewise. #v- #v+ [...] void -_dl_init_first (int argc, ...) +_dl_init_first (void) { first_init (); - init (&argc); + init ((int *) __builtin_frame_address (0) + 2); } [...] #v- Now, experimenting a bit, there is a strange thing going on when using GCC 4.1 and `__builtin_frame_address': Consider this test program: #v+ #include <stdio.h> void func (void) { int *ra = __builtin_return_address (0); int *fa = __builtin_frame_address (0); printf ("%s:fa[0] = %u\tfa[1] = %u\tra = %u\n", __func__, fa[0], fa[1], ra); } int main (void) { int *ra = __builtin_return_address (0); int *fa = __builtin_frame_address (0); printf ("%s:fa = %u\tfa[1] = %u\tra = %u\n", __func__, fa, fa[1], ra); func (); } #v- #v+ $ gcc-4.0 test.c && ./a.out main:fa = 3216472808 fa[1] = 3084724428 ra = 3084724428 func:fa[0] = 3216472808 fa[1] = 134513645 ra = 134513645 #v- This is what I would expect. However: #v+ main:fa = 3220364948 fa[1] = 3220365064 ra = 3085416652 func:fa[0] = 3220364952 fa[1] = 134513639 ra = 134513639 #v- When applying optimizations via `-O' even the GCC 4.0 one produces unexpected results, but that's due to function-inlining then, I guess. So, perhaps there's something wrong with the usage of `__builtin_frame_address' in `_dl_init_first'? _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?17647> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-hurd mailing list Bug-hurd@gnu.org http://lists.gnu.org/mailman/listinfo/bug-hurd