This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix -findirect-dispatch Java failures on SPARC/Linux


The problem is

LIBGCJ_BC_SPEC="%{findirect-dispatch:-fPIC}"

but you cannot compile with -fPIC without assembling with -K PIC on the SPARC.

Hence the attached kludge, which yields:

Native configuration is sparc-unknown-linux-gnu

                === libjava tests ===


Running target unix

                === libjava Summary ===

# of expected passes            2574


Does anyone have a better idea?


2009-12-06  Eric Botcazou  <ebotcazou@adacore.com>

	* config/sparc/linux.h (ASM_SPEC): Pass -K PIC if -findirect-dispatch.
	* config/sparc/linux64.h (ASM_SPEC): Likewise.


-- 
Eric Botcazou
Index: config/sparc/linux.h
===================================================================
--- config/sparc/linux.h	(revision 155009)
+++ config/sparc/linux.h	(working copy)
@@ -98,9 +98,17 @@ along with GCC; see the file COPYING3.  
 /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
    It's safe to pass -s always, even if -g is not used.  */
 #undef ASM_SPEC
-#define ASM_SPEC \
-  "%{V} %{v:%{!V:-V}} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \
-   %{fpic|fPIC|fpie|fPIE:-K PIC} %(asm_cpu) %(asm_relax)"
+#define ASM_SPEC "\
+%{V} \
+%{v:%{!V:-V}} \
+%{!Qn:-Qy} \
+%{n} \
+%{T} \
+%{Ym,*} \
+%{Wa,*:%*} \
+-s \
+%{fpic|fPIC|fpie|fPIE|findirect-dispatch:-K PIC} \
+%(asm_cpu) %(asm_relax)"
 
 #undef ASM_OUTPUT_ALIGNED_LOCAL
 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)		\
Index: config/sparc/linux64.h
===================================================================
--- config/sparc/linux64.h	(revision 155009)
+++ config/sparc/linux64.h	(working copy)
@@ -235,7 +235,8 @@ along with GCC; see the file COPYING3.  
 %{T} \
 %{Ym,*} \
 %{Wa,*:%*} \
--s %{fpic|fPIC|fpie|fPIE:-K PIC} \
+-s \
+%{fpic|fPIC|fpie|fPIE|findirect-dispatch:-K PIC} \
 %{mlittle-endian:-EL} \
 %(asm_cpu) %(asm_arch) %(asm_relax)"
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]