[Bug 5174] Uncatchable C++ exceptions with NPTL on ARM and -fomit-frame-pointer

bugzilla at busybox.net bugzilla at busybox.net
Wed Jan 29 16:33:10 UTC 2014


https://bugs.busybox.net/show_bug.cgi?id=5174

--- Comment #9 from busybox at crayor.com 2014-01-29 16:33:09 UTC ---
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #5)
> > 
> > I'm having a hard time compiling buildroot with debug options.  If I activate
> > DODEBUG, DOASSERTS, SUPPORT_LD_DEBUG and SUPPORT_LD_DEBUG_EARLY in uClibc's
> > configuration, I get the following error:
> > 
> > /opt/users/ig/code/buildroot-git/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc
> > -Wl,-EL -shared -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,relro
> > -Wl,-z,now -Wl,-z,defs   -Wl,-init,__uClibc_init  -Wl,-soname=libc.so.0
> > -nostdlib -o lib/libuClibc-0.9.34-git.so  -Wl,--whole-archive libc/libc_so.a
> > -Wl,--no-whole-archive ./lib/interp.os ./lib/ld-uClibc.so.0
> > ./lib/uclibc_nonshared.a
> > /opt/users/ig/code/buildroot-git/output/host/usr/lib/gcc/arm-unknown-linux-uclibcgnueabi/4.7.0/libgcc.a 
> > libc/libc_so.a(lockf.os): In function `__GI_lockf':
> > /opt/users/ig/code/buildroot-git/output/toolchain/uClibc/libc/misc/file/lockf.c:73:
> > undefined reference to `_Unwind_Resume'
> > libc/libc_so.a(lockf.os):(.ARM.extab+0x0): undefined reference to
> > `__gcc_personality_v0'
> > collect2: error: ld returned 1 exit status
> 
> This GCC bug was fixed already.
> See http://gcc.gnu.org/PR51117

Sorry, I think the mentioned GCC bug is unrelated.

/opt/users/ig/code/buildroot-git/output/toolchain/uClibc/libc/misc/file/lockf.c:73:
undefined reference to `_Unwind_Resume'

When compiling buildroot 2013.11 with uclibc's DODEBUG and buildroot's
BR2_PREFER_STATIC_LIB I get the same error. Without this DODEBUG uclibc-option
it works fine. No matter if I use gcc 4.7.3 or 4.8.2.

But I found a fix from January 2013 that you committed for this problem in
uclibc. It is about a missing dependency to libgcc_eh. When I apply this patch
then I can compile without this linker error even when using DODEBUG.

Sadly this fix is not yet available in the current uclibc release (0.9.33.2).

commit:
http://git.uclibc.org/uClibc/commit/?id=8d31a6e50db423b89082b64a3250eec1b94a7456
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

with -O0 we (e.g. lockf) might end up with references to
_Unwind_Resume, so pull in gcc_eh in this case..

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 Rules.mak              |    4 ++++
 libc/misc/file/lockf.c |    5 +----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Rules.mak b/Rules.mak
index 8943fbf..9d621b5 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -804,6 +804,10 @@ ASFLAGS = $(ASFLAG_--noexecstack)

 LIBGCC_CFLAGS ?= $(CFLAGS) $(CPU_CFLAGS-y)
 $(eval $(call cache-output-var,LIBGCC,$(CC) $(LIBGCC_CFLAGS)
-print-libgcc-file-name))
+$(eval $(call cache-output-var,LIBGCC_EH,$(CC) $(LIBGCC_CFLAGS)
-print-file-name=libgcc_eh.a))
+# with -O0 we (e.g. lockf) might end up with references to
+# _Unwind_Resume, so pull in gcc_eh in this case..
+LIBGCC += $(if $(DODEBUG),$(LIBGCC_EH))
 LIBGCC_DIR:=$(dir $(LIBGCC))

 # moved from libpthread/linuxthreads
diff --git a/libc/misc/file/lockf.c b/libc/misc/file/lockf.c
index 4e398cd..56b3aac 100644
--- a/libc/misc/file/lockf.c
+++ b/libc/misc/file/lockf.c
@@ -16,15 +16,12 @@
    see <http://www.gnu.org/licenses/>.  */

 #include <features.h>
-
 #include <sys/types.h>
-#include <unistd.h>
 #include <fcntl.h>
+#include <unistd.h>
 #include <errno.h>
 #include <string.h>

-
-
 /* lockf is a simplified interface to fcntl's locking facilities.  */

 int lockf (int fd, int cmd, off_t len)

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the uClibc-cvs mailing list