Bug 9362 - solaris 'as' dies when fed .s and "-gstabs"
Summary: solaris 'as' dies when fed .s and "-gstabs"
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: driver (show other bugs)
Version: 3.2.1
: P3 normal
Target Milestone: 3.3.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-18 06:16 UTC by jmcp
Modified: 2003-07-25 23:16 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
os_SunOS_x86.s (1.66 KB, application/octet-stream)
2003-05-21 15:17 UTC, jmcp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jmcp 2003-01-18 06:16:00 UTC
Compiling mozilla-1.2.1 using the tarball and cvs. got to
file

mozilla/nsprpub/pr/src/md/unix/os_SunOS_x86.s

and saw this on my screen:

/usr/local/bin/gcc-3.2.1 -o os_SunOS_x86.o     -Wall -pthreads -gstabs -Wa,-s -fPIC  -UNDEBUG -DDEBUG_jmcp  -DMOZILLA_CLIENT=1 -DDEBUG=1 -DXP_UNIX=1 -DSVR4=1 -DSYSV=1 -D__svr4=1 -D__svr4__=1 -DSOLARIS=1 -DHAVE_FCNTL_FILE_LOCKING=1 -Di386=1 -D_PR_HAVE_OFF64_T=1 -D_LARGEFILE64_SOURCE=1 -DHAVE_LCHOWN=1 -DHAVE_STRERROR=1 -D_REENTRANT=1 -DHAVE_POINTER_LOCALTIME_R=1  -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -D_NSPR_BUILD_ -I/d00/mozilla/mozilla/dist/include/nspr -I../../../../pr/include -I../../../../pr/include/private  -Wa,-P -c os_SunOS_x86.s
Assembler: 
        "", line 1 : Warning: Illegal flag (-) - ignored
        "", line 1 : Warning: Illegal flag (g) - ignored
        "", line 1 : Warning: Illegal flag (t) - ignored
        "", line 1 : Warning: Illegal flag (a) - ignored
gcc-3.2.1: Internal error: Segmentation Fault (program as)
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
gmake[8]: *** [os_SunOS_x86.o] Error 1


core was dumped, with stack trace:

(gdb) where
#0  0x80766aa in cb_cpp_protocol ()
#1  0x8068982 in cb_as_cpp_protocol ()
#2  0x805d816 in buf_nextchar ()
#3  0x805d75e in buf_nextchar ()
#4  0x805da1a in buf_nextchar ()
#5  0x805fe81 in yyparse ()
#6  0x805bde6 in aspass1 ()
#7  0x805b647 in main ()
#8  0x8055f37 in _start ()


(or from mdb):
$ mdb core         
Loading modules: [ libc.so.1 ld.so.1 ]
> $c
cb_cpp_protocol+0x1ca(47, 8068a00, 8068a2e, 806c478, 80c1600)
cb_as_cpp_protocol+0x18c(80c1600, 1)
0x805d816()
buf_nextchar+0x15a()
0x805da1a()
yyparse+0x1d6()
aspass1+0x255()
main+0x47e(9, 8046e4c, 8046e74)
_start+0x77()


/usr/ccs/bin/as accepts -b and -s:


  Common Options
     The following flags are common to both SPARC  and  IA.  They
     may be specified in any order:

     -b    Generates extra symbol table information for  
           the Sun SourceBrowser.
...
     -s    Places all stabs in the .stabs  section.  By 
           default, stabs  are placed  in  stabs.excl 
           sections, which are stripped out by the static 
           linker, ld(1), during final execution. When the 
           -s option is used, stabs remain in the final 
           executable because .stab  sections  are  not
           stripped by the static  linker.


It looks like I might need to file a bug/rfe with Sun for
this issue too.

Release:
gcc-3.2.1

Environment:
i386-pc-solaris2.9 == solaris 9/x86

How-To-Repeat:
throw a .s file at gcc-3.2.1 which is configured to use
/usr/ccs/bin/as, and use the "-gstabs" option to gcc
Comment 1 jmcp 2003-01-18 06:16:00 UTC
Fix:
reconfig gcc to not use /usr/ccs/bin/as, and
get Sun to fix /usr/ccs/bin/as so it doesn't die when passed
options is doesn't accept.
Comment 2 Geoff Keating 2003-01-19 13:14:39 UTC
From: Geoff Keating <geoffk@geoffk.org>
To: jmcp@jjcma.isa-geek.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: driver/9362: solaris 'as' dies when fed .s and "-gstabs"
Date: 19 Jan 2003 13:14:39 -0800

 This is some kind of configury problem, configure is failing to detect
 that the assembler doesn't support --gstabs.
 
 -- 
 - Geoffrey Keating <geoffk@geoffk.org>
Comment 3 Eric Botcazou 2003-03-22 14:16:18 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: By Geoff.
Comment 4 GCC Commits 2003-06-20 13:55:49 UTC
Subject: Bug 9362

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	ro@gcc.gnu.org	2003-06-20 13:55:43

Modified files:
	gcc            : ChangeLog configure.in configure 

Log message:
	* configure.in (gcc_cv_as_gstabs_flag): Disable if assembler warns.
	* configure: Regenerate.
	Fixes PR driver/9362.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.597&r2=1.16114.2.598
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/configure.in.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.627.2.10&r2=1.627.2.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/configure.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.641.2.11&r2=1.641.2.12

Comment 5 GCC Commits 2003-06-20 13:59:37 UTC
Subject: Bug 9362

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ro@gcc.gnu.org	2003-06-20 13:59:34

Modified files:
	gcc            : ChangeLog configure.in configure 

Log message:
	* configure.in (gcc_cv_as_gstabs_flag): Disable if assembler warns.
	* configure: Regenerate.
	Fixes PR driver/9362.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.87&r2=2.88
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/configure.in.diff?cvsroot=gcc&r1=1.689&r2=1.690
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/configure.diff?cvsroot=gcc&r1=1.705&r2=1.706

Comment 6 Rainer Orth 2003-06-20 14:02:10 UTC
Fixed for 3.3.1, 3.4:

http://gcc.gnu.org/ml/gcc-patches/2003-06/msg02388.html