autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Work around IRIX 6 ld bug creating executables


From: Paul Eggert
Subject: Re: Work around IRIX 6 ld bug creating executables
Date: 09 Feb 2004 13:34:07 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Rainer Orth <address@hidden> writes:

> The following patch fixes this, and introduced no testsuite failures.

Isn't the usual Autoconf philosophy that each test must clean up after
itself?  If so, this patch isn't needed.  If not, then it's
incomplete, as it tests for some files that it doesn't remove first.

Here's a more-complete patch, though I'm not sure that it's needed
(the "Autoconf philosophy" issue):

2004-02-09  Paul Eggert  <address@hidden>

        * lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Remove
        default executables first to avoid IRIX 6 ld bug.  Fixes a problem
        reported by Rainer Orth with building GCC
        <http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00592.html>.
        His original suggested patch is in:
        http://mail.gnu.org/archive/html/autoconf-patches/2004-02/msg00007.html

--- lang.m4.~1.168.~    Sun Feb  1 22:53:51 2004
+++ lang.m4     Mon Feb  9 13:15:50 2004
@@ -467,16 +467,21 @@ m4_define([_AC_COMPILER_EXEEXT_DEFAULT],
 # of exeext.
 AC_MSG_CHECKING([for _AC_LANG compiler default output file name])
 ac_link_default=`echo "$ac_link" | sed ['s/ -o *conftest[^ ]*//']`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+rm -f $ac_files
 AS_IF([AC_TRY_EVAL(ac_link_default)],
-[# Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
+[# Be careful to initialize this variable, since it used to be cached.
 # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
 ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+for ac_file in $ac_files
 do
   test -f "$ac_file" || continue
   case $ac_file in




reply via email to

[Prev in Thread] Current Thread [Next in Thread]