Article View: gnu.gcc.help
Article #51431Re: as error in Gcc version 2.4.2 on Sun SS2
From: Casper H.S. Dik
Date: Wed, 02 Jun 1993 14:56
Date: Wed, 02 Jun 1993 14:56
103 lines
3411 bytes
3411 bytes
arthurc@doe.carleton.ca (Arthur Castonguay) writes:
>I'm getting an error from as whenever I try to compile a C++ program
>using gcc version 2.4.2 (also on version 2.4.0 last Friday).
>The test program is:
> #include <stream.h>
> main()
> {
> cout << "Hello world\n";
> }
I can't reproduce this error (gcc 2.4.2/libg++ 2.3/ SunOS 4.1.2)
Configured as: ./configure --prefix=/usr/local/gnu sun4
(But this gives the same config files as --target=sparc-sun-sunos4.1.2)
>The compiler invocation line is:
> g++ test.cc -o test-cc
>The error returned is:
> as: "/usr/tmp/cca26475.s", line 8: error: statement syntax
> as: "/usr/tmp/cca26475.s", line 14: error: statement syntax
> collect: gcc returned 1 exit status
> Sun Sparc II
> SunOS 4.1.2
> Configured as: configure --target=sparc-sun-sunos4.1.2
> libg++ version 2.2
The only thing different from our configuration is the libg++ version.
Other points of interest: which version of as do you use?
GNU as? SunOS 4.1.2 as? SPARC compiler 1.x or 2.x as?
The code gcc is trying to compile looks like:
typedef void entry_pt();
extern entry_pt x1 __asm__ ("__GLOBAL_$I$tie__C3ios");
entry_pt * __CTOR_LIST__[] = {
(entry_pt *) 1,
x1,
0
};
extern entry_pt x2 __asm__ ("__GLOBAL_$D$tie__C3ios");
entry_pt * __DTOR_LIST__[] = {
(entry_pt *) 1,
x2,
0
};
extern entry_pt __main;
entry_pt *__main_reference = __main;
And results in the following assembly on my machine:
gcc2_compiled.:
___gnu_compiled_c:
.global ___CTOR_LIST__
.data
.align 4
___CTOR_LIST__:
.word 1
.word __GLOBAL_$I$tie__C3ios
.word 0
.global ___DTOR_LIST__
.align 4
___DTOR_LIST__:
.word 1
.word __GLOBAL_$D$tie__C3ios
.word 0
.global ___main_reference
.align 4
___main_reference:
.word ___main
CHeck whether gcc and your assembler grok the above code.
(And whether gcc produces the correct assembler output)
My g++ -v test.cc -o test-cc output is:
gcc version 2.4.2
/usr/local/gnu/lib/gcc-lib/sun4/2.4.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__GCC_NEW_VARARGS__ -D__sparc__ -D__sun__ -D__unix__ -D__GCC_NEW_VARARGS__ -D__sparc -D__sun -D__unix -D__GCC_NEW_VARARGS__ test.cc /usr/tmp/cca29139.i
GNU CPP version 2.4.2 (sparc)
/usr/local/gnu/lib/gcc-lib/sun4/2.4.2/cc1plus /usr/tmp/cca29139.i -quiet -dumpbase test.cc -version -o /usr/tmp/cca29139.s
GNU C++ version 2.4.2 (sparc) compiled by GNU C version 2.4.2.
as -o /usr/tmp/cca291391.o /usr/tmp/cca29139.s
/usr/local/gnu/lib/gcc-lib/sun4/2.4.2/ld -e start -dc -dp -o test-cc /lib/crt0.o -L/usr/local/gnu/lib/gcc-lib/sun4/2.4.2 -L/usr/local/gnu/lib /usr/tmp/cca291391.o -lg++ -lgcc -lc -lgcc
Casper
Technical Details
Message-ID:
<1uif3r$6qm@mail.fwi.uva.nl>Path:
arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!mcsun!sun4nl!fwi.uva.nl!casperReferences:
<ARTHURC.93Jun1110722@keiko.doe.carleton.ca>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,91c8ac48f8305a3d X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-06-02 08:36:17 PST Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!mcsun!sun4nl!fwi.uva.nl!casper From: casper@fwi.uva.nl (Casper H.S. Dik) Newsgroups: gnu.gcc.help Subject: Re: as error in Gcc version 2.4.2 on Sun SS2 Date: 2 Jun 1993 14:56:59 GMT Organization: FWI, University of Amsterdam Lines: 103 Distribution: gnu Message-ID: <1uif3r$6qm@mail.fwi.uva.nl> References: <ARTHURC.93Jun1110722@keiko.doe.carleton.ca> NNTP-Posting-Host: adam.fwi.uva.nl