This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
4.0.2/4.1 PATCH: Enforce PIC code for mips libffi (PR libgcj/21943)
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- To: java-patches at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 9 Jun 2005 20:38:38 +0200 (MEST)
- Subject: 4.0.2/4.1 PATCH: Enforce PIC code for mips libffi (PR libgcj/21943)
As reported in PR libgcj/21943, the O32 libffi doesn't build on IRIX 6
(haven't tried IRIX 5 yet) due to the following error:
ld: FATAL 45 : Non-PIC (src/mips/.libs/o32.o) used in shared/call_shared link.
It turns out that gas (unlike the native as) defaults to non-PIC code, so
the above error is expected.
I'm not sure if one wants to do something about this, either change gas in
this respect or at least pass -KPIC by default or at least with
-fpic/-fPIC.
Anyway, for the case at hand the fix is trivial. With that change, the O32
libffi.so builds and testresults are not completely broken:
http://gcc.gnu.org/ml/gcc-testresults/2005-06/msg00589.html
To avoid any potential problems for N32, I've applied the same change there
as well, although it doesn't seem to be necessary for some reason.
Ok for mainline and the 4.0 branch once testing is complete and the branch
reopens?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Wed Jun 8 03:49:21 2005 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
PR libgcj/21943
* src/mips/n32.S: Enforce PIC code.
* src/mips/o32.S: Likewise.
Index: libffi/src/mips/n32.S
===================================================================
RCS file: /cvs/gcc/gcc/libffi/src/mips/n32.S,v
retrieving revision 1.3
diff -u -p -r1.3 n32.S
--- libffi/src/mips/n32.S 21 Oct 2003 19:01:56 -0000 1.3
+++ libffi/src/mips/n32.S 9 Jun 2005 18:38:10 -0000
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- n32.S - Copyright (c) 1996, 1998 Red Hat, Inc.
+ n32.S - Copyright (c) 1996, 1998, 2005 Red Hat, Inc.
MIPS Foreign Function Interface
@@ -39,6 +39,7 @@
#define SIZEOF_FRAME ( 8 * FFI_SIZEOF_ARG )
+ .option pic2
.text
.align 2
.globl ffi_call_N32
Index: libffi/src/mips/o32.S
===================================================================
RCS file: /cvs/gcc/gcc/libffi/src/mips/o32.S,v
retrieving revision 1.6
diff -u -p -r1.6 o32.S
--- libffi/src/mips/o32.S 23 Nov 2004 23:18:11 -0000 1.6
+++ libffi/src/mips/o32.S 9 Jun 2005 18:38:10 -0000
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- o32.S - Copyright (c) 1996, 1998 Red Hat, Inc.
+ o32.S - Copyright (c) 1996, 1998, 2005 Red Hat, Inc.
MIPS Foreign Function Interface
@@ -37,6 +37,7 @@
#define SIZEOF_FRAME ( 4 * FFI_SIZEOF_ARG + 2 * FFI_SIZEOF_ARG )
+ .option pic2
.text
.align 2
.globl ffi_call_O32