This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Add ARM-specific static-stubs.c
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-ports at sourceware dot org>
- Date: Thu, 5 Jul 2012 22:28:57 +0000
- Subject: Add ARM-specific static-stubs.c
While the ARM changes I included with my patch to avoid libgcc_s /
libgcc_eh were sufficient to keep the ARM glibc build working in cases
that had already worked without special hacks, it turns out they weren't
quite sufficient to get the ARM build to start working when using a
compiler without libgcc_s / libgcc_eh.
With such a compiler, some of the unwind functionality is present in
libgcc.a (whereas with a compiler built with shared libgcc, it's separate
in libgcc_s and libgcc_eh). The copy of _Unwind_Resume from
static-stubs.c is properly used in static links - but libgcc gets used
before ARM's libgcc-stubs.a, so __aeabi_unwind_cpp_pr* get pulled in from
libgcc, which ends up conflicting with the copy of _Unwind_Resume from
static-stubs.c. So in fact the stub __aeabi_unwind_cpp_pr* need providing
in two places:
* In static-stubs.c (via a #include of aeabi_unwind_cpp_pr1.c), for static
links with a compiler with libgcc.a only.
* In libgcc-stubs.a, for linking other executables and shared libraries.
I've applied this patch to get the ARM build working with a compiler with
static-only libgcc, though I'll think some more about whether better
approaches are possible.
diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index 71e8b1b..8cd383d 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,3 +1,7 @@
+2012-07-05 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/arm/static-stubs.c: New file.
+
2012-07-03 Joseph Myers <joseph@codesourcery.com>
* sysdeps/arm/Makefile (gnulib-arch): New variable.
diff --git a/ports/sysdeps/arm/static-stubs.c b/ports/sysdeps/arm/static-stubs.c
new file mode 100644
index 0000000..d90d603
--- /dev/null
+++ b/ports/sysdeps/arm/static-stubs.c
@@ -0,0 +1,7 @@
+/* When building with GCC with static-only libgcc, the dummy
+ _Unwind_Resume from static-stubs.c needs to be used together with
+ the dummy __aeabi_unwind_cpp_pr* from aeabi_unwind_cpp_pr1.c
+ instead of the copies from libgcc. */
+
+#include <elf/static-stubs.c>
+#include <aeabi_unwind_cpp_pr1.c>
--
Joseph S. Myers
joseph@codesourcery.com