This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
3.4/3.5 PATCH: Remove a.out etc. from gcc assembler version test
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 6 Feb 2004 21:15:20 +0100 (MET)
- Subject: 3.4/3.5 PATCH: Remove a.out etc. from gcc assembler version test
Trying to bootstrap mainline on IRIX 6 with GNU as 2.14.90 and the native
ld initially failed:
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.
It turns out that this happens as follows:
$ gas -v < /dev/null
GNU assembler version 2.14.90 (mips-sgi-irix6.5) using BFD version 2.14.90 20030717
$ ls -l a.out
-rw-r--r-- 1 ro rbg 545 Feb 6 21:12 a.out
$ gcc test.c
$ ./a.out
bash: ./a.out: Permission denied
$ > ls -l a.out
-rw-r--r-- 1 ro rbg 55424 Feb 6 21:13 a.out
I.e. the linker doesn't remove the output file, but simply overwrites it,
retaining the permissions which are of course insufficient for execution.
The following patch fixes this and allowed the configure run to continue.
Ok for 3.4 branch and mainline?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Fri Feb 6 21:07:47 2004 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* configure.ac (DEFAULT_ASSEMBLER): Remove as -v output files.
* configure: Regenerate.
Index: gcc/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.12
diff -u -p -r2.12 configure.ac
--- gcc/configure.ac 5 Feb 2004 17:09:05 -0000 2.12
+++ gcc/configure.ac 6 Feb 2004 20:04:39 -0000
@@ -230,6 +230,11 @@ if test x"${DEFAULT_ASSEMBLER+set}" = x"
elif $DEFAULT_ASSEMBLER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
gas_flag=yes
fi
+ # GNU as creates a mode 644 a.out even if invoked with -v only.
+ # The IRIX 6 native ld just overwrites the existing file, even when
+ # creating an executable, so an execution test fails. Remove possible
+ # default assembler output files to avoid this.
+ rm -f a.out a.exe b.out
AC_DEFINE_UNQUOTED(DEFAULT_ASSEMBLER,"$DEFAULT_ASSEMBLER",
[Define to enable the use of a default assembler.])
fi