Question about gcc-lib and building on SPARC

Mark Cuss mcuss@cdlsystems.com
Thu Apr 13 16:37:00 GMT 2006




> On 12 April 2006 22:18, Mark Cuss wrote:
>
>>  The
>> guy who was here before me set up the previous version (gcc-3.3.3)
>
>> gcc 3.3.3 was compiled with the following configure flags:
>
>> configure --with-gnu-as --with-as=/cdl/apps/bin/sun/as --with-gnu-ld
>>  --with-ld=/cdl/apps/bin/sun/ld --enable-langauges=c,c++ --disable-shared
>> --prefix=/cdl/apps/.software/sun/gcc-3.3.3
>
>> I've successfully built and installed gcc-3.4.4 with the following 
>> configure
>> flags:
>
>> /cdl/apps/.software/sun/build/gcc-3.4.4-build/gcc-3.4.4/configure
>>  --disable-shared --prefix=/cdl/apps/.software/sun/gcc-3.4.4/
>> --enable-languages=c,c++
>
>> However, in this case, I don't have the "gcc-lib" directory anymore.
>
>> When I
>> try to build stuff with this compiler (a simple helloworld), the linker
>> returns symbol errors, likely because the Sun-supplied ld and not the GNU 
>> ld
>> is being used (even though a GNU ld exists in my PATH)
>
>  I don't understand what your last guy was doing, but he's configured it 
> to
> point at the sun 'as' and 'ld' but tried to tell it that they're gnu 'as' 
> and
> 'ld'.  Weird.  Maybe he's overwritten the binaries in /cdl/apps/bin/sun 
> with
> gnu versions or something odd like that.

The as and ld in /cdl/apps/bin/sun are GNU as and ld, built from binutils 
2.14.  I must not have explained this properly - the whole mess is 
confusing!

>> our Developers need to use Purify Plus on Sun, and if I do this, it 
>> breaks
>> Purify because it somehow uses it's own linker at buld time.  The 
>> solution
>> from Purify tech support was to go into
>> $prefix/lib/gcc-lib/sparc-sun-solaris2.9/<version> and drop in symbolic
>> links to the GNU ld and as.  When I attempted to do this though, I 
>> realized
>> this directory doesn't seem to exist under gcc-3.4.4
>
>  How about $prefix/lib/gcc/sparc-sun-etc.etc.etc. ?  'gcc-lib' got changed 
> to
> 'gcc' at some point between 3.3 and 3.4.

That's the thing I was looking for - I need to know where to put the 
symlinks to the as and ld that I want to use...  It looks like this did the 
trick - thanks!


>> So, to make a painfully long story short, I need to know how gcc 3.4.4
>> decides upon which linker / assembler it uses.  I read the configure
>> instructions and found that when the compiler is built is uses a whole 
>> bunch
>> of rules to find as and ld, and it seems apparent that I'm using the Sun 
>> ld
>> and as instead of the GNU one.  However, the old trick of putting 
>> symlinks
>> in $prefix/lib/gcc-lib/sparc-sun-solaris2.9/<version> doesn't work 
>> anymore.
>> Could someone please point a newbie in the right direction?
>
>  Why didn't you just use the exact same configure options that worked so 
> well
> for the last guy?  That's the first thing I'd try.

I did try that, but if I hardcode the assembler and linker at configure 
time, then this breaks Purify.  This is why I need to do this symbolic link 
thing - apparently Purify needs this...

Thanks!
Mark




More information about the Gcc mailing list