Bug 12173 - IRIX 6 O32 (with as) bootstrap failure due to gcc -g -E warning
Summary: IRIX 6 O32 (with as) bootstrap failure due to gcc -g -E warning
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 3.4.0
: P2 critical
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-04 22:35 UTC by Rainer Orth
Modified: 2005-07-23 22:49 UTC (History)
3 users (show)

See Also:
Host: mips-sgi-irix6.5o32
Target: mips-sgi-irix6.5o32
Build: mips-sgi-irix6.5o32
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Orth 2003-09-04 22:35:57 UTC
Between 20030703 and 20030808, bootstrap of mips-sgi-irix6.5o32 (with
native as) started to fail configuring libf2c and libobjc.

configure: error: Can't find stdio.h.
You must have a usable C system for the target already installed, at least
including headers and, preferably, the library, before you can configure
the G77 runtime system.  If necessary, install gcc now with `LANGUAGES=c',
then the target library, then build with `LANGUAGES=f77'.
make[1]: *** [configure-target-libf2c] Error 1

Looking at config.log, one finds the following:

configure:2442: checking for stdio.h
configure:2452: /vol/gcc/obj/gcc-3.4-20030808/6.5o32-cc-as/gcc/xgcc -B/vol/gcc/obj/gcc-3.4-20030808/6.5o32-cc-as/gcc/ -B/vol/gcc/share/mips-sgi-irix6.5o32/bin/ -B/vol/gcc/share/mips-sgi-irix6.5o32/lib/ -isystem /vol/gcc/share/mips-sgi-irix6.5o32/include -isystem /vol/gcc/share/mips-sgi-irix6.5o32/sys-include -E -O2 -g conftest.c >/dev/null 2>conftest.out
cc1: warning: target system does not support debug output
configure: failed program was:
#line 2447 "configure"
#include "confdefs.h"
#include <stdio.h>

Comparing this with the old (good) bootstrap, the difference is in the cc1
warning.  This boils down to the following minimal testcase:

touch test.c
./xgcc -B./ -E -O2 -g test.c > /dev/null
cc1: warning: target system does not support debug output

I get this warning as of 20030808, but there is no output on 20030703.

This is most certainly due to Neil's option processing rewrite.

The warning happened before when compiling:

./xgcc -B./ -c -g test.c
cc1: warning: `-g': unknown or unsupported -g option

The wording is changed now:

cc1: warning: target system does not support debug output

Environment:
System: IRIX sculptor 6.5 07141608 IP32


	
host: mips-sgi-irix6.5o32
build: mips-sgi-irix6.5o32
target: mips-sgi-irix6.5o32
configured with: /vol/gnu/src/gcc/gcc-dist/configure --prefix=/vol/gcc --with-local-prefix=/vol/gcc --disable-nls mips-sgi-irix6.5o32

How-To-Repeat:
Bootstrap gcc as above.
Comment 1 Rainer Orth 2003-09-04 22:44:53 UTC
Subject: Re:  New: IRIX 6 O32 (with as) bootstrap failure due to gcc -g -E warning

Neil Booth writes:

> What's the real problem?  I think the above, in isolation, is
> an improvement.  I can't tell from your post what is really
> wrong.

The problem is that gcc -g -E on targets without debugging support produced
no warning before, but does now, which breaks bootstrap for all of them.

It may be possible to avoid passing -g for this case, but given that
configure regularly defaults to -g -O2, this may be hard, both for gcc or
in the general case.

	Rainer
Comment 2 Rainer Orth 2003-09-11 21:46:25 UTC
Subject: Re:  IRIX 6 O32 (with as) bootstrap failure due to gcc -g -E warning

Alexandre,

I just found out that this patch of yours

	http://gcc.gnu.org/ml/gcc-patches/2003-08/msg00360.html

introduced this bug by passing -g options to cc1 vi cpp_options.  This
breaks bootstrap on mips-sgi-irix6.5o32 and mips-sgi-irix5.3 (i.e. any
platform where -g isn't supported).  While the warning issued is fine for
compilation, preprocessor output is identical whether or not -g is given,
so there should be now warning.

Any idea for a proper fix?

	Rainer
Comment 3 Neil Booth 2003-09-12 05:26:19 UTC
Subject: Re:  IRIX 6 O32 (with as) bootstrap failure due to gcc -g -E warning

ro at techfak dot uni-bielefeld dot de wrote:-

> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12173
> 
> 
> 
> ------- Additional Comments From ro at techfak dot uni-bielefeld dot de  2003-09-11 21:46 -------
> Subject: Re:  IRIX 6 O32 (with as) bootstrap failure due to gcc -g -E warning
> 
> Alexandre,
> 
> I just found out that this patch of yours
> 
> 	http://gcc.gnu.org/ml/gcc-patches/2003-08/msg00360.html
> 
> introduced this bug by passing -g options to cc1 vi cpp_options.  This
> breaks bootstrap on mips-sgi-irix6.5o32 and mips-sgi-irix5.3 (i.e. any
> platform where -g isn't supported).  While the warning issued is fine for
> compilation, preprocessor output is identical whether or not -g is given,
> so there should be now warning.
> 
> Any idea for a proper fix?

I think the -E should be independent of -g, and should not be in
cpp_options.  I was reluctant to accept this at the time Alexandre
did it.

Neil.
Comment 4 Alexandre Oliva 2003-09-12 15:08:41 UTC
This could be construed as a bug in autoconf.  It's already fixed in autoconf
2.5x, that knows to ignore warning messages from the preprocessor when testing
for header files.  Anyway, if -g is not supported, it shouldn't be passed down
to target library configuration, right?

As for why we have to pass -g to the preprocessor, I might instead pass
-fworking-directory if there's any -g* in the command line and no
-fno-working-directory.  This would solve the immediate problem.  The
alternative would be to have -fworking-directory enabled by default, which would
(slightly) impact those who don't need entirely-accurate debug information (or
error mesasges, FWIW).

Which one would be preferrable?
Comment 5 Rainer Orth 2003-09-15 20:07:33 UTC
Subject: Re:  IRIX 6 O32 (with as) bootstrap failure due to gcc -g -E warning

> I think the -E should be independent of -g, and should not be in
> cpp_options.  I was reluctant to accept this at the time Alexandre
> did it.

I tend to agree: even if -g is not supported, the preprocessor output
should be identical in both cases, so -g is irrelevant.  And even on
platforms without debugging support, -g3 -E is still a very useful tool to
investigate macro expansion problems (though this is handled by passing -dD
to cc1).

	Rainer

Comment 6 Rainer Orth 2003-09-15 20:15:39 UTC
Subject: Re:  IRIX 6 O32 (with as) bootstrap failure due to gcc -g -E warning

> This could be construed as a bug in autoconf.  It's already fixed in autoconf
> 2.5x, that knows to ignore warning messages from the preprocessor when testing

... which seems to cause other problems: this way, e.g. deprecation
warnings from headers are ignored as well.  And even if autoconf 2.5x get
this right (or at least can cope with this case), this neither helps for
the current bootstrap problem nor for building other packages which come
with configure from older autoconf versions.

> for header files.  Anyway, if -g is not supported, it shouldn't be passed down
> to target library configuration, right?

True in principle, though -g isn't passed explicitly, but automatically
added by configure if no {C,CXX,FC,JC}FLAGS (or however they are called for
the language in question) are given.  Thus it might become quite messy to
bootstrap for targets without -g support.

> As for why we have to pass -g to the preprocessor, I might instead pass
> -fworking-directory if there's any -g* in the command line and no
> -fno-working-directory.  This would solve the immediate problem.  The
> alternative would be to have -fworking-directory enabled by default, which would
> (slightly) impact those who don't need entirely-accurate debug information (or
> error mesasges, FWIW).
> 
> Which one would be preferrable?

Since getcwd may be expensive in some environments, I prefer the former.

	Rainer
Comment 7 Rainer Orth 2003-09-25 17:38:02 UTC
Subject: Re:  IRIX 6 O32 (with as) bootstrap failure due to gcc -g -E warning

Alexandre,

any progress on a patch for this problem?  As is, this currently breaks
bootstrap on IRIX 5 and will block integration of my IRIX 6 O32 patches
since that configuration doesn't bootstrap while this bug is unfixed.
Alternatively, one could apply the following stop-gap patch until you've
provided a real fix

	Rainer


Fri Sep 12 00:12:52 2003  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* gcc.c (cpp_options): Don't pass -g*.

Index: gcc/gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.393
diff -u -p -r1.393 gcc.c
--- gcc/gcc.c	4 Sep 2003 06:30:02 -0000	1.393
+++ gcc/gcc.c	23 Sep 2003 21:40:34 -0000
@@ -755,7 +755,7 @@ static const char *cpp_unique_options =
    in turn cause preprocessor symbols to be defined specially.  */
 static const char *cpp_options =
 "%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*}\
- %{g*} %{O*} %{undef}";
+ %{O*} %{undef}";
 
 /* This contains cpp options which are not passed when the preprocessor
    output will be used by another program.  */

Comment 8 Alexandre Oliva 2003-09-29 17:30:30 UTC
No progress.  I'm still waiting for Neil's answer to my question.

Personally, I'd go with:

- %{g*} %{O*} %{undef}";
+ %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef}";

Would you give it a try and formally propose it if it fixes the problem for you?
Comment 9 Rainer Orth 2003-09-29 17:36:55 UTC
Subject: Re:  IRIX 6 O32 (with as) bootstrap failure due to gcc -g -E warning

Will do, thanks.

I'm just running fresh bootstraps with the current version of my IRIX 6
cleanup/O32 integration patches anyway.

Thanks.
	Rainer
Comment 10 Rainer Orth 2003-10-02 00:21:08 UTC
Subject: Re:  IRIX 6 O32 (with as) bootstrap failure due to gcc -g -E warning

Done:

	http://gcc.gnu.org/ml/gcc-patches/2003-10/msg00086.html

	Rainer
Comment 11 GCC Commits 2003-10-07 21:14:24 UTC
Subject: Bug 12173

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ro@gcc.gnu.org	2003-10-07 21:14:15

Modified files:
	gcc            : ChangeLog gcc.c 

Log message:
	2003-10-07  Alexandre Oliva  <aoliva@redhat.com>
	
	* gcc.c (cpp_options): Only pass -fworking-directory for -g* if
	not overridden.
	Fixes PR bootstrap/12173.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1328&r2=2.1329
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/gcc.c.diff?cvsroot=gcc&r1=1.393&r2=1.394

Comment 12 Rainer Orth 2003-10-07 21:16:46 UTC
Fixed for 3.4.