public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Odd problem with building 3.4.2 on Solaris (use of as and ld)
@ 2004-09-22 16:42 Timothy Borgeaud
  2004-09-22 23:16 ` Eric Botcazou
  0 siblings, 1 reply; 4+ messages in thread
From: Timothy Borgeaud @ 2004-09-22 16:42 UTC (permalink / raw)
  To: gcc


I've run across a bit of a strange problem while trying to build gcc 3.4.2
on a solaris 5.8 system (sparc-sun-solaris2.8). It is probably something 
I'm
doing wrong but perhaps it is a feature/problem of gcc.

Note that I have found a work around for this.

I'm building from the source tarball.

I have gcc already installed in /usr/local
This was installed from a sun freeware package:

% ggc -c

  Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.3.2/specs
  Configured with: ../configure --with-as=/usr/ccs/bin/as 
--with-ld=/usr/ccs/bin/ld
     --disable-nls
  Thread model: posix
  gcc version 3.3.2

I also have binutils 2.11.2 and gnu make 3.80 installed in /usr/local

I have Sun supplied bin utils in /usr/ccs/bin

What I'm trying to do is build version 3.4.2 with the prefix /opt/hi and 
which will use
the gnu binutils which will also be in /opt/hi (actually they are in 
place already but /opt/hi is currently a link to a temporary space).

If I build 3.4.2 with just --prefix=/opt/hi everything works ok and I 
end up with a
working version of 3.4.2 that uses /usr/ccs/bin.

However if I use the configure options:

--with-gnu-as --with-as=/opt/hi/bin/as

and

--with-gnu-ld --with-ld=/opt/hi/bin/ld

I have a problem. After the configure I use:    make -j 4 bootstrap
and a little way into the build I get:

./xgcc -B./ -B/opt/hi/sparc-sun-solaris2.8/bin/ -isystem 
/opt/hi/sparc-sun-solaris2.8/i
nclude -isystem /opt/hi/sparc-sun-solaris2.8/sys-include 
-L/appvol/build/gcc-3.4.2/tmpo
bj/gcc/../ld -O2  -DIN_GCC    -W -Wall -Wwrite-strings 
-Wstrict-prototypes -Wmissing-pr
ototypes -Wold-style-definition  -isystem ./include  -fPIC -g 
-DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. 
-I../../gcc-3.4.2-src/gcc -I../../gcc-3.4.2-src/gcc/. 
-I../../gcc-3.4.2-src/gcc/../include -I../intl  -m64 -DL_negdi2 -c 
../../gcc-3.4.2-src/gcc/libgcc2.c -o libgcc/sparcv9/_negdi2.o
/usr/ccs/bin/as: error: unknown option '6'
/usr/ccs/bin/as: error: unknown option '4'
/usr/ccs/bin/as: error: unknown option 'A'
/usr/ccs/bin/as: error: unknown option 'v'
/usr/ccs/bin/as: error: unknown option '9'
usage: /usr/ccs/bin/as [-V] [-Q{y,n}] [-f[O][if]#] [-q] [-s]

So, for some reason the build is assuming that I'm using gnu as (I think 
that is what is going on). But at various stages in the build I see 
messages:

checking for GNU ld... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no

Which is what I expect. The --with-gnu-as --with-as=/opt/hi/bin/as 
options seem to
trigger the build into assuming Gnu as is being used to perform the 
build as well as
configuring the new compiler to use this tool.

Maybe it's just something else that is broken on my build/system.


My work-around for this problem is to temporarily replace the tools in 
/usr/ccs/bin with links to /usr/local/bin tools
eg. /usr/ccs/bin/as  -> /usr/local/bin/as

Then I get messages such as :

checking for GNU ld... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... yes

and no problems with ld or as.



Tim

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

* Re: Odd problem with building 3.4.2 on Solaris (use of as and ld)
  2004-09-22 16:42 Odd problem with building 3.4.2 on Solaris (use of as and ld) Timothy Borgeaud
@ 2004-09-22 23:16 ` Eric Botcazou
  2004-09-23 11:49   ` Timothy Borgeaud
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Botcazou @ 2004-09-22 23:16 UTC (permalink / raw)
  To: Timothy Borgeaud; +Cc: gcc

> What I'm trying to do is build version 3.4.2 with the prefix /opt/hi and
> which will use the gnu binutils which will also be in /opt/hi (actually
> they are in place already but /opt/hi is currently a link to a temporary
> space).
>
> If I build 3.4.2 with just --prefix=/opt/hi everything works ok and I
> end up with a working version of 3.4.2 that uses /usr/ccs/bin.
>
> However if I use the configure options:
>
> --with-gnu-as --with-as=/opt/hi/bin/as
>
> and
>
> --with-gnu-ld --with-ld=/opt/hi/bin/ld

Just to be sure: are GNU as and GNU ld installed where you tell the configure 
script they are?

> Which is what I expect. The --with-gnu-as --with-as=/opt/hi/bin/as
> options seem to trigger the build into assuming Gnu as is being used to
> perform the build as well as configuring the new compiler to use this tool.

Note that the line you pasted starts with ./xgcc.  The newly built compiler 
attempts to compile its libgcc, so it will invoke /opt/hi/bin/as and 
/opt/hi/bin/ld as you instructed it to do.

-- 
Eric Botcazou

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

* Re: Odd problem with building 3.4.2 on Solaris (use of as and ld)
  2004-09-22 23:16 ` Eric Botcazou
@ 2004-09-23 11:49   ` Timothy Borgeaud
  2004-09-23 11:53     ` Eric Botcazou
  0 siblings, 1 reply; 4+ messages in thread
From: Timothy Borgeaud @ 2004-09-23 11:49 UTC (permalink / raw)
  To: Eric Botcazou, gcc

Eric Botcazou wrote:

>>What I'm trying to do is build version 3.4.2 with the prefix /opt/hi and
>>which will use the gnu binutils which will also be in /opt/hi (actually
>>they are in place already but /opt/hi is currently a link to a temporary
>>space).
>>
>>If I build 3.4.2 with just --prefix=/opt/hi everything works ok and I
>>end up with a working version of 3.4.2 that uses /usr/ccs/bin.
>>
>>However if I use the configure options:
>>
>>--with-gnu-as --with-as=/opt/hi/bin/as
>>
>>and
>>
>>--with-gnu-ld --with-ld=/opt/hi/bin/ld
>>    
>>
>
>Just to be sure: are GNU as and GNU ld installed where you tell the configure 
>script they are?
>
>  
>
No, when I build gcc /opt/hi actually points to an empty area. Building 
with /opt/hi
pointing to the place where all the stuff is actually installed causes 
me a problem with
conflicting copies of libiconv. It's a bit of a mess because I'm 
building a version of gcc
designed to run from /opt/hi on a machine with a bunch of stuff in 
/usr/local/.
I suppose I might have to remove the conflicting packages from 
/usr/local/ which is
not really a problem but means I have to be more careful about where 
/opt/hi points
during various installs as the system will be more dependent upon 
/opt/hi rather than
/usr/local/.

>>Which is what I expect. The --with-gnu-as --with-as=/opt/hi/bin/as
>>options seem to trigger the build into assuming Gnu as is being used to
>>perform the build as well as configuring the new compiler to use this tool.
>>    
>>
>
>Note that the line you pasted starts with ./xgcc.  The newly built compiler 
>attempts to compile its libgcc, so it will invoke /opt/hi/bin/as and 
>/opt/hi/bin/ld as you instructed it to do.
>
>  
>
Thanks. I see that when /opt/hi/bin/ld etc are not found then the build 
uses /usr/bin/ccs/ld.
Which is why my fudge of linking /usr/bin/ccs/as to /usr/local/bin/as 
(Gnu) works.

Tim

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

* Re: Odd problem with building 3.4.2 on Solaris (use of as and ld)
  2004-09-23 11:49   ` Timothy Borgeaud
@ 2004-09-23 11:53     ` Eric Botcazou
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Botcazou @ 2004-09-23 11:53 UTC (permalink / raw)
  To: Timothy Borgeaud; +Cc: gcc

> >Just to be sure: are GNU as and GNU ld installed where you tell the
> > configure script they are?
>
> No, when I build gcc /opt/hi actually points to an empty area.

Ok, that's the problem.

> Building with /opt/hi pointing to the place where all the stuff is actually 
> installed causes me a problem with conflicting copies of libiconv.

Oh! yes, this tricky libiconv conflict.  I think it can be solved by making 
sure that the bootstrap compiler and the final compiler will see the same 
libiconv library.  You can browse Bugzilla for more detailed info.

-- 
Eric Botcazou

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

end of thread, other threads:[~2004-09-23  8:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-22 16:42 Odd problem with building 3.4.2 on Solaris (use of as and ld) Timothy Borgeaud
2004-09-22 23:16 ` Eric Botcazou
2004-09-23 11:49   ` Timothy Borgeaud
2004-09-23 11:53     ` Eric Botcazou

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).