On Wed, 2008-11-12 at 16:33 +0100, Bernhard Reutner-Fischer wrote:
> On Wed, Nov 12, 2008 at 09:03:18AM -0600, Rob Landley wrote:
> >On Wednesday 12 November 2008 06:52:07 Bernhard Reutner-Fischer wrote:
> >> Hi,
> >>
> >> uClibc-0.9.30 has been released.
> >
> >Yay!
> 
> :)
> 
> Just as a sidenote and because there were at least three people running
> into this very issue lately:
> 
> The current gcc-3.4.6 from "hardened gentoo" miscompiles 0.9.30,
> the current stable release of gcc, 4.3.2 at the time of this writing,
> works just fine for me. So either fix your old compiler or use
> a compiler that is somewhat current..
> 
> Those who tried to use gcc-3.4.6 from gentoo experienced segfaults
> when running any app that was _linked_ against -lpthread, fwiw.

The problem come from a buggy gcc which did not create frame pointers
(due to -fomit-frame-poitner) but the assembly tried to access it
anyway.

It is possible to work around it by adding -fno-omit-frame-pointer for
linuxthreads.old/* as the attatched patch does.

I assume the patch is not needed for newer gcc's.

-nc
--- uClibc-0.9.30.orig/libpthread/linuxthreads.old/Makefile.in	Thu Nov 13 09:53:27 2008
+++ uClibc-0.9.30/libpthread/linuxthreads.old/Makefile.in	Thu Nov 13 10:01:35 2008
@@ -59,6 +59,13 @@
 libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
 libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
 
+ifeq ($(TARGET_ARCH),i386)
+# Most files must not be compiled without frame pointer since we need
+# the frame base address which is stored in %ebp unless the frame pointer
+# is optimized out.
+CFLAGS += -fno-omit-frame-pointer -mpreferred-stack-boundary=4
+endif
+
 libpthread-static-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SPEC_SRC))
 libpthread-shared-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.oS,$(libpthread_SPEC_SRC))
 
_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Reply via email to