On 4/13/06, Mark Cuss <[EMAIL PROTECTED]> wrote: > Hello - this is definitely a newbie question, so bear with me... > > We've been using gcc under Solaris on SPARC hardware for some time now. The > guy who was here before me set up the previous version (gcc-3.3.3) and now > I'm trying to get gcc-3.4.4 to build. > > In the old gcc-3.3.3 install tree, I have the following directory: > $prefix/lib/gcc-lib/sparc-sun-solaris2.9/3.3.3 > > gcc 3.3.3 was compiled with the following configure flags: > [EMAIL PROTECTED] mark]$ gcc -v > Reading specs from > /cdl/apps/.software/sun/gcc-3.3.3/lib/gcc-lib/sparc-sun-solaris2.9/3.3.3/specs > Configured with: > 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 > Thread model: posix > gcc version 3.3.3 > [EMAIL PROTECTED] mark]$ > > I've successfully built and installed gcc-3.4.4 with the following configure > flags: > [EMAIL PROTECTED] bin]$ ./gcc -v > Reading specs from > /cdl/apps/.software/sun/gcc-3.4.4/bin/../lib/gcc/sparc-sun-solaris2.9/3.4.4/specs > Configured with: > /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++ > Thread model: posix > gcc version 3.4.4 > [EMAIL PROTECTED] bin]$ > > 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)
Using a different linker is going to cause many problems .So better using GNU ld. > > The obvious answer is that I didn't specify --with-gnu-ld > and --with-ld=<path> in my gcc-3.4.4 configure. Thats the best thing to do. > I would have done this, but > 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 Which directory doesn't exist ? Well if you built bintuils , you can point a symlink to $prefix/bin. You can find xx-as , xx-ld in that directory or in $prefix/$target/bin. I prefer you but the former . > > 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? Those are some hints . After building the crosstoolchain you find the symlinks if not that directory but some other directory. You have to do a find. Moreover for gnu ld and as you have to build binutils not gcc. > > Thanks in advance, > Mark > > Mark Cuss, B. Sc. > Software Developer > Systems Administrator > CDL Systems Ltd. > Suite 220 > 3553 31 Street NW > Calgary, AB, Canada > T2L 2K7 > > Phone 403 289 1733 ext 226 > Fax 403 289 3967 > [EMAIL PROTECTED] > www.cdlsystems.com > > >