This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix PR java/44095
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 22 Sep 2010 23:15:08 +0200
- Subject: Fix PR java/44095
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.
--
Eric Botcazou
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)"