This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [build, libjava] Ignore IRIX 6.5 ld warning for --no-merge-exidx-entries (PR libgcj/44216)
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Andrew Haley <aph at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org, Paolo Bonzini <bonzini at gnu dot org>
- Date: Fri, 04 Jun 2010 16:19:36 +0200
- Subject: Re: [build, libjava] Ignore IRIX 6.5 ld warning for --no-merge-exidx-entries (PR libgcj/44216)
- References: <yddsk5glycp.fsf@manam.CeBiTec.Uni-Bielefeld.DE> <yddbpc1je7t.fsf@manam.CeBiTec.Uni-Bielefeld.DE> <4BFF79F6.6020701@redhat.com>
Andrew Haley <aph@redhat.com> writes:
>> While checking in another libjava patch, I noticed that the 4.4 and 4.5
>> branches are affected as well. Ok for both if testing passes?
>>
>> 4.5 should be identical since it uses autoconf 2.64, too. I'll have to
>> be extra careful on 4.4 where autoconf 2.59 is still in use, maybe
>> copying a different snippet from AC_PATH_XTRA if that changed.
>
> OK.
Testing on the 4.4 branch revealed an additonal quirk: AC_LANG_WERROR in
autoconf 2.59 defaults the werror_flag variables to no, while the rest
of the code expects them to be empty in that case, so AC_LANG_WERROR was
effectively enabled everywhere, which broke Solaris 11/x86 bootstrap
(some warning in the memcpy test vs. __builtin_memcpy).
The following patch fixes this by backporting the autoconf 2.62+
AC_LANG_WERROR to the 4.4 branch as well. It allowed a bootstrap on
i386-pc-solaris2.11 to complete successfully. Will test on IRIX 6.5 to
make extra certain that it fixes the problem there.
Ok for the 4.4 branch then?
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2010-06-03 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
config:
* override.m4 (AC_LANG_WERROR): Redefine to autoconf 2.62 version.
libjava:
Backport from mainline:
2010-05-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR libgcj/44216
* configure.ac (libgcj_cv_exidx): Enable AC_LANG_WERROR.
Save and restore werror flag.
* configure: Regenerate.
diff -r 1051d3dc11c2 config/override.m4
--- a/config/override.m4 Thu Jun 03 00:59:57 2010 +0200
+++ b/config/override.m4 Thu Jun 03 12:33:10 2010 +0200
@@ -249,3 +249,13 @@
[m4_define([_$0_text], [$1])m4_builtin([m4wrap],
[m4_default(m4_defn([_$0_text])m4_undefine([_$0_text]))])])])
])
+
+# AC_LANG_WERROR
+# ------------------
+# This is the same code as in 2.59, but sets the werror_flag to default to
+# empty as expect by the rest of the code.
+m4_version_prereq([2.62],, [
+AC_DEFUN([AC_LANG_WERROR],
+[m4_divert_text([DEFAULTS], [ac_[]_AC_LANG_ABBREV[]_werror_flag=])
+ac_[]_AC_LANG_ABBREV[]_werror_flag=yes])# AC_LANG_WERROR
+])
diff -r 1051d3dc11c2 libjava/configure.ac
--- a/libjava/configure.ac Thu Jun 03 00:59:57 2010 +0200
+++ b/libjava/configure.ac Thu Jun 03 12:33:10 2010 +0200
@@ -893,9 +893,17 @@
AC_CACHE_CHECK([for --no-merge-exidx-entries], [libgcj_cv_exidx],
[saved_ldflags="$LDFLAGS"
LDFLAGS="${LDFLAGS} -Wl,--no-merge-exidx-entries"
+ # The IRIX 6 ld doesn't recognize --no-merge-exidx-entries, but only
+ # warns about unknown options, which breaks the testsuite. So enable
+ # AC_LANG_WERROR, but there's currently (autoconf 2.64) no way to turn
+ # it off again. As a workaround, save and restore werror flag like
+ # AC_PATH_XTRA.
+ ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag
+ AC_LANG_WERROR
AC_LINK_IFELSE([int main(void){ return 0;} ],
[eval "libgcj_cv_exidx=yes"],
[eval "libgcj_cv_exidx=no"])
+ ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag
LDFLAGS="${saved_ldflags}"]
)
if test "${libgcj_cv_exidx}" = "yes"; then