summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@gnu.org>2009-01-17 17:23:50 +0100
committerNeal H. Walfield <neal@gnu.org>2009-01-17 17:40:37 +0100
commitc630ae1e13659bbceed85ad47f519fedb09fc73f (patch)
treeb9a11c8a143c3ca2077ea5d6523fcd680b25aa13
parent8e7249d8deae3a82c086f435b7e31ec16d1457da (diff)
On x86-64, compile newlib with -fPIC.
2009-01-17 Neal H. Walfield <neal@gnu.org> * Makefile.am [ARCH_X86_64]: Compile with -fPIC. (routines): Add strcpy.
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/Makefile.am15
2 files changed, 18 insertions, 2 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 16dcb24..f150121 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-17 Neal H. Walfield <neal@gnu.org>
+
+ * Makefile.am [ARCH_X86_64]: Compile with -fPIC.
+ (routines): Add strcpy.
+
2008-12-12 Neal H. Walfield <neal@gnu.org>
* addon/newlib/libc/sys/hurd/access.c: New file.
diff --git a/newlib/Makefile.am b/newlib/Makefile.am
index 346dc68..99cfa69 100644
--- a/newlib/Makefile.am
+++ b/newlib/Makefile.am
@@ -155,11 +155,22 @@ newlib-build/configure.stamp: $(srcdir)/newlib/patch.stamp
)
touch $@
+if ARCH_X86_64
+ # Without -fPIC, when linking Viengoos against libc-routines, we get
+ # errors of the following form:
+ #
+ # ../newlib/libc-routines.a(lib_a-strcpy.o):(.eh_frame+0x20):
+ # relocation truncated to fit: R_X86_64_32 against `.text'
+ EXTRA_CFLAGS = -fPIC
+else
+ EXTRA_CFLAGS =
+endif
+
.PHONY: newlib-build/build.stamp
newlib-build/build.stamp: newlib-build/configure.stamp
cd newlib-build && \
make \
- TARGET_CFLAGS='$(USER_CPPFLAGS) $(USER_CFLAGS) $(USER_LDFLAGS)' \
+ TARGET_CFLAGS='$(EXTRA_CFLAGS) $(USER_CPPFLAGS) $(USER_CFLAGS) $(USER_LDFLAGS)' \
all
if test newlib-build/libc.a -nt newlib-build/build.stamp; then \
( cd newlib-build \
@@ -186,7 +197,7 @@ all-local: newlib-build/build.stamp libc.a libm.a libc-routines.a
# htonl htons ntohl ntohs ffs
routines := \
memcpy memmove memset \
- strcmp strncmp strlen
+ strcpy strcmp strncmp strlen
# We have to find all modules in the archive which contain the above functions.
routines_subexp := 's/^\($(shell echo $(routines) \
| $(SED) -e 's/ \+/\\|/g')\) in \(.*\)$$/\2/p'