public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Wrong assembler used with gcc 4.3.0 on Solaris 9
@ 2008-04-01  9:43 Langella Raphael
  2008-04-01 16:39 ` John Morrison
  2008-04-02  6:33 ` Jim Wilson
  0 siblings, 2 replies; 11+ messages in thread
From: Langella Raphael @ 2008-04-01  9:43 UTC (permalink / raw)
  To: gcc-help

Hi,

I've built gcc 4.3.0 (with ada) and binutils 2.18 on Solaris 9. Hello world program works fine in C, but fails in C++ and ada :

# g++ hello.cxx
/usr/ccs/bin/as: "/var/tmp//ccDeMxqh.s", line 139: error: unknown opcode ".weakref"
/usr/ccs/bin/as: "/var/tmp//ccDeMxqh.s", line 139: error: statement syntax
/usr/ccs/bin/as: "/var/tmp//ccDeMxqh.s", line 140: error: unknown opcode ".weakref"
[and a lot more of these errors]

The same happens with gnatmake and an ada helloworld.

I don't understand why the default solaris assembler is used instead of the binutils one (which can be found at the very beginning of my PATH).

This works :
g++ -S hello.cxx
as -xarch=v9 hello.s

How to specify which assembler to use ? Why doesn't it use the first one found in PATH ?

Regards,
Raphaël Langella

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Wrong assembler used with gcc 4.3.0 on Solaris 9
  2008-04-01  9:43 Wrong assembler used with gcc 4.3.0 on Solaris 9 Langella Raphael
@ 2008-04-01 16:39 ` John Morrison
       [not found]   ` <3FAC2F0B26D73F40A8202BB63110F57801AF127E@irvmail.misirvine.printronix      .com>
  2008-04-02  7:55   ` Jim Wilson
  2008-04-02  6:33 ` Jim Wilson
  1 sibling, 2 replies; 11+ messages in thread
From: John Morrison @ 2008-04-01 16:39 UTC (permalink / raw)
  To: Langella Raphael, gcc-help

Hi Raphael.

Does the environment variable GCC_EXEC_PREFIX point to where the binutils are?

I had a similar problem and while searching for answers I some how came across this document:

http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html

I changed the value to the env var and all seems to be working well. 

This is only a suggestion from very brief experience.

Good Luck.
John Morrison
Printronix, Inc.



-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Langella Raphael
Sent: Tuesday, April 01, 2008 1:23 AM
To: gcc-help@gcc.gnu.org
Subject: Wrong assembler used with gcc 4.3.0 on Solaris 9

Hi,

I've built gcc 4.3.0 (with ada) and binutils 2.18 on Solaris 9. Hello world program works fine in C, but fails in C++ and ada :

# g++ hello.cxx
/usr/ccs/bin/as: "/var/tmp//ccDeMxqh.s", line 139: error: unknown opcode ".weakref"
/usr/ccs/bin/as: "/var/tmp//ccDeMxqh.s", line 139: error: statement syntax
/usr/ccs/bin/as: "/var/tmp//ccDeMxqh.s", line 140: error: unknown opcode ".weakref"
[and a lot more of these errors]

The same happens with gnatmake and an ada helloworld.

I don't understand why the default solaris assembler is used instead of the binutils one (which can be found at the very beginning of my PATH).

This works :
g++ -S hello.cxx
as -xarch=v9 hello.s

How to specify which assembler to use ? Why doesn't it use the first one found in PATH ?

Regards,
Raphaël Langella

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Wrong assembler used with gcc 4.3.0 on Solaris 9
       [not found]   ` <3FAC2F0B26D73F40A8202BB63110F57801AF127E@irvmail.misirvine.printronix      .com>
@ 2008-04-01 17:16     ` Dennis Clarke
  2008-04-01 17:32       ` John Morrison
  0 siblings, 1 reply; 11+ messages in thread
From: Dennis Clarke @ 2008-04-01 17:16 UTC (permalink / raw)
  To: John Morrison; +Cc: Langella Raphael, gcc-help


> Hi Raphael.
>
> Does the environment variable GCC_EXEC_PREFIX point to where the binutils
> are?
>
> I had a similar problem and while searching for answers I some how came
> across this document:
>
> http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html
>
> I changed the value to the env var and all seems to be working well.
>

Why would you use binutils when Solaris provides a native as and ld ?

Dennis

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Wrong assembler used with gcc 4.3.0 on Solaris 9
  2008-04-01 17:16     ` Dennis Clarke
@ 2008-04-01 17:32       ` John Morrison
       [not found]         ` <3FAC2F0B26D73F40A8202BB63110F57801AF12BD@irvmail.misirvine.printronix      .com>
  0 siblings, 1 reply; 11+ messages in thread
From: John Morrison @ 2008-04-01 17:32 UTC (permalink / raw)
  To: gcc-help

Hi Dennis.

Solaris is only the host and the target is powerpc-eabi.   We are
upgrading from 2.95 (I think its 2.95, I can't remember right now) to
4.2.0.  The binutils and gcc builds appeared to be ok, but when I tried
to do a compile, the 2.95 assembler was being called.  I posted here on
this problem a few weeks ago and got no response.  

Thanks
John Morrison
Printronix, Inc



-----Original Message-----
From: Dennis Clarke [mailto:dclarke@blastwave.org] 
Sent: Tuesday, April 01, 2008 9:38 AM
To: John Morrison
Cc: Langella Raphael; gcc-help@gcc.gnu.org
Subject: RE: Wrong assembler used with gcc 4.3.0 on Solaris 9


> Hi Raphael.
>
> Does the environment variable GCC_EXEC_PREFIX point to where the 
> binutils are?
>
> I had a similar problem and while searching for answers I some how 
> came across this document:
>
> http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html
>
> I changed the value to the env var and all seems to be working well.
>

Why would you use binutils when Solaris provides a native as and ld ?

Dennis

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Wrong assembler used with gcc 4.3.0 on Solaris 9
       [not found]         ` <3FAC2F0B26D73F40A8202BB63110F57801AF12BD@irvmail.misirvine.printronix      .com>
@ 2008-04-01 18:14           ` Dennis Clarke
  2008-04-01 18:18             ` John Morrison
  0 siblings, 1 reply; 11+ messages in thread
From: Dennis Clarke @ 2008-04-01 18:14 UTC (permalink / raw)
  To: John Morrison; +Cc: gcc-help


> Hi Dennis.
>
> Solaris is only the host and the target is powerpc-eabi.

Ah .. a cross compile.  That makes sense.

> We are upgrading from 2.95 (I think its 2.95, I can't remember right now)

try to run gcc -v

> to
> 4.2.0.  The binutils and gcc builds appeared to be ok, but when I tried
> to do a compile, the 2.95 assembler was being called.  I posted here on
> this problem a few weeks ago and got no response.

hrmmm .. maybe I can help.  How are you doing with this thus far ?

Dennis

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Wrong assembler used with gcc 4.3.0 on Solaris 9
  2008-04-01 18:14           ` Dennis Clarke
@ 2008-04-01 18:18             ` John Morrison
       [not found]               ` <3FAC2F0B26D73F40A8202BB63110F57801AF1316@irvmail.misirvine.printronix      .com>
  0 siblings, 1 reply; 11+ messages in thread
From: John Morrison @ 2008-04-01 18:18 UTC (permalink / raw)
  To: Dennis Clarke; +Cc: gcc-help

Thanks Dennis.

It looks like I've finally got it.   Like I mentioned earlier, setting
the value of GCC_EXEC_PREFIX before running gcc seems to fix the
problem.  The previous value pointed to the place where the GCC 2.95.2
and binutils 2.11 version existed.  I change it to point to where the
4.2.0 and 2.17 (respectively) versions are installed and the compiles
works.  

I was able to do the same upgrade under Linux with no real problems.
But Solaris was a nightmare.  My background is in big iron (IBM)
operating systems and WinTel and I'm still "getting a handle on" unix.
There is obviously a lot of lore I don't know.  As with most things, you
have to know what you are looking for before you can look for it.  I
didn't know that under certain circumstances that an environment
variable would control/override where GCC looks for "things".

Thanks

John Morrison
Printronix, Inc

 

-----Original Message-----
From: Dennis Clarke [mailto:dclarke@blastwave.org] 
Sent: Tuesday, April 01, 2008 10:32 AM
To: John Morrison
Cc: gcc-help@gcc.gnu.org
Subject: RE: Wrong assembler used with gcc 4.3.0 on Solaris 9


> Hi Dennis.
>
> Solaris is only the host and the target is powerpc-eabi.

Ah .. a cross compile.  That makes sense.

> We are upgrading from 2.95 (I think its 2.95, I can't remember right 
> now)

try to run gcc -v

> to
> 4.2.0.  The binutils and gcc builds appeared to be ok, but when I 
> tried to do a compile, the 2.95 assembler was being called.  I posted 
> here on this problem a few weeks ago and got no response.

hrmmm .. maybe I can help.  How are you doing with this thus far ?

Dennis

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Wrong assembler used with gcc 4.3.0 on Solaris 9
       [not found]               ` <3FAC2F0B26D73F40A8202BB63110F57801AF1316@irvmail.misirvine.printronix      .com>
@ 2008-04-02  6:32                 ` Dennis Clarke
  0 siblings, 0 replies; 11+ messages in thread
From: Dennis Clarke @ 2008-04-02  6:32 UTC (permalink / raw)
  To: John Morrison; +Cc: gcc-help


> Thanks Dennis.
>
> It looks like I've finally got it.   Like I mentioned earlier, setting
> the value of GCC_EXEC_PREFIX before running gcc seems to fix the
> problem.  The previous value pointed to the place where the GCC 2.95.2
> and binutils 2.11 version existed.  I change it to point to where the
> 4.2.0 and 2.17 (respectively) versions are installed and the compiles
> works.
>
> I was able to do the same upgrade under Linux with no real problems.
> But Solaris was a nightmare.  My background is in big iron (IBM)
> operating systems and WinTel and I'm still "getting a handle on" unix.
> There is obviously a lot of lore I don't know.  As with most things, you
> have to know what you are looking for before you can look for it.  I
> didn't know that under certain circumstances that an environment
> variable would control/override where GCC looks for "things".

I can relate. I really can. For about a decade I have been bootstrapping GCC
and in all that time I have *never* ever seen it pass its own testsuites.
The problems are always related to Fortran or some bit in the GCC compiler
that isn't just right or some dependency or some tweak of an environment
variable. Sometimes the bootstrap process can go on for days and days only
to see a failure.  Quite maddening.

I find that the Linux From Scratch project is probably the best place around
to look at open source in the Linux world. It allows you to build pretty
much everything yourself step by step and it is very educational. Of course
.. even in that project you will not get a clean testsuite report on a
number of things and it may leave you with a bitter aftertaste about open
source. Look at OpenSolaris for the UNIX version and I know of a few places
that document *that* build process. Not with GCC. I always remember that
closed source proprietary stuff is often full of bugs and we don't get to
see them. We just have to live with them.

Solaris is possibly the best place to play with UNIX but you will run into
different things. I don't know what the utopia is and even if we, as a
global user base, are even heading towards some sort of perfectly working
solution. Maybe the journey is the goal afterall.

Dennis

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Wrong assembler used with gcc 4.3.0 on Solaris 9
  2008-04-01  9:43 Wrong assembler used with gcc 4.3.0 on Solaris 9 Langella Raphael
  2008-04-01 16:39 ` John Morrison
@ 2008-04-02  6:33 ` Jim Wilson
  2008-04-02 12:41   ` Langella Raphael
  1 sibling, 1 reply; 11+ messages in thread
From: Jim Wilson @ 2008-04-02  6:33 UTC (permalink / raw)
  To: Langella Raphael; +Cc: gcc-help

Langella Raphael wrote:
> I don't understand why the default solaris assembler is used instead of the binutils one (which can be found at the very beginning of my PATH).

GCC has its own built-in paths for finding things.  The best solution 
here is to always use the same --prefix when configuring binutils and 
gcc.  And build and install binutils before building and installing gcc. 
  Then gcc should automatically find binutils and everything should just 
work.

If it still doesn't work, you might need to add extra configure options 
like --with-gnu-as=/path/to/gnu/as, but these aren't needed normally.

Jim

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Wrong assembler used with gcc 4.3.0 on Solaris 9
  2008-04-01 16:39 ` John Morrison
       [not found]   ` <3FAC2F0B26D73F40A8202BB63110F57801AF127E@irvmail.misirvine.printronix      .com>
@ 2008-04-02  7:55   ` Jim Wilson
  1 sibling, 0 replies; 11+ messages in thread
From: Jim Wilson @ 2008-04-02  7:55 UTC (permalink / raw)
  To: John Morrison; +Cc: Langella Raphael, gcc-help

John Morrison wrote:
> Does the environment variable GCC_EXEC_PREFIX point to where the binutils are?

A very long time ago GCC_EXEC_PREFIX used to be useful, but nowadays you 
should not set it.  GCC will set it for you if it is really necessary. 
If you don't set it, then you don't have to worry about it pointing to 
the wrong compiler.

Jim

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Wrong assembler used with gcc 4.3.0 on Solaris 9
  2008-04-02  6:33 ` Jim Wilson
@ 2008-04-02 12:41   ` Langella Raphael
       [not found]     ` <092785B790DCD043BA45401EDA43D9B50210CD80@cst-xch-003.cnesnet.ad.cnes.      fr>
  0 siblings, 1 reply; 11+ messages in thread
From: Langella Raphael @ 2008-04-02 12:41 UTC (permalink / raw)
  To: gcc-help

> -----Message d'origine-----
> De : gcc-help-owner@gcc.gnu.org 
> [mailto:gcc-help-owner@gcc.gnu.org] De la part de Jim Wilson
> Envoyé : mercredi 2 avril 2008 08:32
> À : Langella Raphael
> Cc : gcc-help@gcc.gnu.org
> Objet : Re: Wrong assembler used with gcc 4.3.0 on Solaris 9
> 
> Langella Raphael wrote:
> > I don't understand why the default solaris assembler is 
> used instead of the binutils one (which can be found at the 
> very beginning of my PATH).
> 
> GCC has its own built-in paths for finding things.  The best 
> solution here is to always use the same --prefix when 
> configuring binutils and gcc.  And build and install binutils 
> before building and installing gcc. 
>   Then gcc should automatically find binutils and everything 
> should just work.
> 
> If it still doesn't work, you might need to add extra 
> configure options like --with-gnu-as=/path/to/gnu/as, but 
> these aren't needed normally.
> 
> Jim
> 

Thanks for your advice. I've found a solution by setting COMPILER_PATH to my binutils.
To answer Dennis who asked why I don't use the native as and ld, it's because it doesn't work. That's the point of my initial post.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Wrong assembler used with gcc 4.3.0 on Solaris 9
       [not found]     ` <092785B790DCD043BA45401EDA43D9B50210CD80@cst-xch-003.cnesnet.ad.cnes.      fr>
@ 2008-04-02 21:46       ` Dennis Clarke
  0 siblings, 0 replies; 11+ messages in thread
From: Dennis Clarke @ 2008-04-02 21:46 UTC (permalink / raw)
  To: Langella Raphael; +Cc: gcc-help


>> -----Message d'origine-----
>> De : gcc-help-owner@gcc.gnu.org
>> [mailto:gcc-help-owner@gcc.gnu.org] De la part de Jim Wilson
>> Envoyé : mercredi 2 avril 2008 08:32
>> À : Langella Raphael
>> Cc : gcc-help@gcc.gnu.org
>> Objet : Re: Wrong assembler used with gcc 4.3.0 on Solaris 9
>>
>> Langella Raphael wrote:
>> > I don't understand why the default solaris assembler is
>> used instead of the binutils one (which can be found at the
>> very beginning of my PATH).
>>
>> GCC has its own built-in paths for finding things.  The best
>> solution here is to always use the same --prefix when
>> configuring binutils and gcc.  And build and install binutils
>> before building and installing gcc.
>>   Then gcc should automatically find binutils and everything
>> should just work.
>>
>> If it still doesn't work, you might need to add extra
>> configure options like --with-gnu-as=/path/to/gnu/as, but
>> these aren't needed normally.
>>
>> Jim
>>
>
> Thanks for your advice. I've found a solution by setting COMPILER_PATH to my
> binutils.
> To answer Dennis who asked why I don't use the native as and ld, it's
> because it doesn't work. That's the point of my initial post.

As a cross compiler .. right. That would not fly at all.

Dennis

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-04-02 18:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-01  9:43 Wrong assembler used with gcc 4.3.0 on Solaris 9 Langella Raphael
2008-04-01 16:39 ` John Morrison
     [not found]   ` <3FAC2F0B26D73F40A8202BB63110F57801AF127E@irvmail.misirvine.printronix      .com>
2008-04-01 17:16     ` Dennis Clarke
2008-04-01 17:32       ` John Morrison
     [not found]         ` <3FAC2F0B26D73F40A8202BB63110F57801AF12BD@irvmail.misirvine.printronix      .com>
2008-04-01 18:14           ` Dennis Clarke
2008-04-01 18:18             ` John Morrison
     [not found]               ` <3FAC2F0B26D73F40A8202BB63110F57801AF1316@irvmail.misirvine.printronix      .com>
2008-04-02  6:32                 ` Dennis Clarke
2008-04-02  7:55   ` Jim Wilson
2008-04-02  6:33 ` Jim Wilson
2008-04-02 12:41   ` Langella Raphael
     [not found]     ` <092785B790DCD043BA45401EDA43D9B50210CD80@cst-xch-003.cnesnet.ad.cnes.      fr>
2008-04-02 21:46       ` Dennis Clarke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).