Patchwork Fix PR java/44095

login
register
mail settings
Submitter Eric Botcazou
Date Sept. 22, 2010, 9:15 p.m.
Message ID <201009222315.08791.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/65456/
State New
Headers show

Comments

Eric Botcazou - Sept. 22, 2010, 9:15 p.m.
This is again a total breakage of -findirect-dispatch on SPARC/Linux, a 
regression present on mainline and 4.5 branch.  We were already there a few 
months ago and the kludge I added back then:
  http://gcc.gnu.org/ml/gcc-patches/2009-12/msg00339.html
was almost immediately defeated on the (then) mainline because Jakub slightly 
changed the semantics of the %<S spec in order to fix PR driver/42442.  See 
the audit trail for a more detailed analysis.

The attached patch improves the kludge by noticing that gcj appends "main.c" 
to the main class name before calling jvgenmain and then cc1.  Tested on 
SPARC/Linux and SPARC64/Linux, applied on the mainline and 4.5 branch.


2010-09-22  Eric Botcazou  <ebotcazou@adacore.com>

	PR java/44095
	* config/sparc/linux.h (ASM_SPEC): Pass -K PIC if -findirect-dispatch
	is specified and the suffix of the file isn't ".c".
	* config/sparc/linux64.h (ASM_SPEC): Likewise.

Patch

Index: config/sparc/linux.h
===================================================================
--- config/sparc/linux.h	(revision 164507)
+++ config/sparc/linux.h	(working copy)
@@ -107,7 +107,8 @@  along with GCC; see the file COPYING3.
 %{Ym,*} \
 %{Wa,*:%*} \
 -s \
-%{fpic|fPIC|fpie|fPIE|findirect-dispatch:-K PIC} \
+%{fpic|fPIC|fpie|fPIE:-K PIC} \
+%{!.c:%{findirect-dispatch:-K PIC}} \
 %(asm_cpu) %(asm_relax)"
 
 #undef ASM_OUTPUT_ALIGNED_LOCAL
Index: config/sparc/linux64.h
===================================================================
--- config/sparc/linux64.h	(revision 164507)
+++ config/sparc/linux64.h	(working copy)
@@ -236,7 +236,8 @@  along with GCC; see the file COPYING3.
 %{Ym,*} \
 %{Wa,*:%*} \
 -s \
-%{fpic|fPIC|fpie|fPIE|findirect-dispatch:-K PIC} \
+%{fpic|fPIC|fpie|fPIE:-K PIC} \
+%{!.c:%{findirect-dispatch:-K PIC}} \
 %{mlittle-endian:-EL} \
 %(asm_cpu) %(asm_arch) %(asm_relax)"