autoconf-patches
[Top][All Lists]
Advanced

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

Work around IRIX 6 ld bug creating executables


From: Rainer Orth
Subject: Work around IRIX 6 ld bug creating executables
Date: Fri, 6 Feb 2004 23:17:53 +0100 (MET)

The following patch arised when building current GCC mainline on IRIX 6.5
with GNU as:

        http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00592.html

Consider the following configure.ac:

AC_INIT(aout_perm, 0.1)
touch a.out
AC_PROG_CC

On IRIX 6, configure fails like this:

$ ./configure 
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... configure: error: cannot run C 
compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

This happens because ld writes into an existing a.out instead of removing
it first or making it executable.

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

        Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Fri Feb  6 22:18:33 2004  Rainer Orth  <address@hidden>

        * lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Remove
        default executables first to avoid IRIX 6 ld bug.

Index: lib/autoconf/lang.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/lang.m4,v
retrieving revision 1.168
diff -u -p -r1.168 lang.m4
--- lib/autoconf/lang.m4        30 Jan 2004 14:21:36 -0000      1.168
+++ lib/autoconf/lang.m4        6 Feb 2004 21:16:52 -0000
@@ -467,6 +467,10 @@ 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[^ ]*//']`
+# The IRIX 6 linker writes into existing a.out or similar files which may
+# not be executable, retaining their permissions.  Remove them first so
+# a subsequent execution test works.
+rm -f a.out a.exe b.out
 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




reply via email to

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