public inbox for gentoo-embedded@lists.gentoo.org
 help / color / mirror / Atom feed
From: Natanael Copa <natanael.copa@gmail.com>
To: gentoo-embedded@lists.gentoo.org
Subject: [gentoo-embedded] [PATCH] uclibc-0.9.30 and broken gcc-3.4.6
Date: Thu, 13 Nov 2008 13:05:57 +0100	[thread overview]
Message-ID: <1226577957.31131.130.camel@nc> (raw)

[-- Attachment #1: Type: text/plain, Size: 359 bytes --]

Hi,

After compiling uclibc with gcc-3.4.6 (current hardened compiler) any
program linked with -lpthread just segfaulted.

shows up that gcc first omits the framepointer then tries to access it.
To work around it, gcc-3.4.6 need to add -fno-omit-framepointer to
libpthreads.old/*

attatched patch will help you to build a working hardened uclibc-0.9.30.

-nc

[-- Attachment #2: pthreads-fno-omit-frame-pointer.patch --]
[-- Type: text/x-patch, Size: 773 bytes --]

--- 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))
 

                 reply	other threads:[~2008-11-13 12:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1226577957.31131.130.camel@nc \
    --to=natanael.copa@gmail.com \
    --cc=gentoo-embedded@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox