Targetting Sparc/Solaris

Sam Brightman
Tue Jul 31 16:52:00 GMT 2007

Nathan Kidd wrote:
> Sam Brightman wrote:
>> Nathan Kidd wrote:
>> Very glad to hear it's possible. I guess then the more appropriate
>> question would be, how easy is it relative to buying a SPARC box given
>> that knowledge of the toolchain build process is quite minimal.
>> Basically, currently just using crosstool as is - the biggest pain has
>> been setting up the environment.
> After managing builds both ways for many years, I very strongly
> recommend you go the cross-compiler route.  Your individual
> circumstances may vary, but for me there is no way I want to be relying
> on a single old machine, 3 years down the road, to build a critical
> patch for a customer.

I definitely agree, it's more a case of the time to having a first 
version working.

> I've pasted below my (wiki markup) notes from the last time I built a
> Cygwin-hosted sparc-sun-solaris2.8 cross compiler.  They probably are
> not 100% correct, but "work for me".

Thanks. Okay, going with the clean approach:

The differences I have from you are that I'm building for Solaris 2.9 
and using full gcc (for C++) support. Since I was building from Solaris 
2.11 (Nexenta A7) I initially tried to skip the library/header copy 
stuff and mess around with the tree. This just led to trouble (PATH_MAX 
stuff: not fixed by the patch in crosstools), so I've gone with pretty 
much exactly as you wrote.

I had to add --disable-nls as in crosstools as I was getting libintl 
symbol problems. Then binutils built cleanly, but gcc does not. I have 
to leave for the day now, but wondering if the cause of this 
link problem is immediately obvious to anyone? Could it be the issue 
referred to by

where it says:

"We recommend using GNU binutils 2.16 or later in conjunction with GCC 
4.x, or the vendor tools (Sun as, Sun ld). However, for Solaris 10 and 
above, an additional patch is required in order for the GNU linker to be 
able to cope with a new flavour of shared libraries. You can obtain a 
working version by checking out the binutils-2_16-branch from the CVS 
repository or applying the patch to the release."


Here is the tail of the build log:

-O2  -O2 -g -O2   -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings 
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition 
-isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 
-D__GCC_FLOAT_NOT_NEEDED  -shared -nodefaultlibs 
-Wl, -Wl,--version-script=libgcc/./ -o 
./  libgcc/./_muldi3_s.o libgcc/./_negdi2_s.o 
libgcc/./_lshrdi3_s.o libgcc/./_ashldi3_s.o libgcc/./_ashrdi3_s.o 
libgcc/./_cmpdi2_s.o libgcc/./_ucmpdi2_s.o libgcc/./_floatdidf_s.o 
libgcc/./_floatdisf_s.o libgcc/./_fixunsdfsi_s.o 
libgcc/./_fixunssfsi_s.o libgcc/./_fixunsdfdi_s.o libgcc/./_fixdfdi_s.o 
libgcc/./_fixunssfdi_s.o libgcc/./_fixsfdi_s.o libgcc/./_fixxfdi_s.o 
libgcc/./_fixunsxfdi_s.o libgcc/./_floatdixf_s.o 
libgcc/./_fixunsxfsi_s.o libgcc/./_fixtfdi_s.o libgcc/./_fixunstfdi_s.o 
libgcc/./_floatditf_s.o libgcc/./_clear_cache_s.o 
libgcc/./_enable_execute_stack_s.o libgcc/./_trampoline_s.o 
libgcc/./__main_s.o libgcc/./_absvsi2_s.o libgcc/./_absvdi2_s.o 
libgcc/./_addvsi3_s.o libgcc/./_addvdi3_s.o libgcc/./_subvsi3_s.o 
libgcc/./_subvdi3_s.o libgcc/./_mulvsi3_s.o libgcc/./_mulvdi3_s.o 
libgcc/./_negvsi2_s.o libgcc/./_negvdi2_s.o libgcc/./_ctors_s.o 
libgcc/./_ffssi2_s.o libgcc/./_ffsdi2_s.o libgcc/./_clz_s.o 
libgcc/./_clzsi2_s.o libgcc/./_clzdi2_s.o libgcc/./_ctzsi2_s.o 
libgcc/./_ctzdi2_s.o libgcc/./_popcount_tab_s.o 
libgcc/./_popcountsi2_s.o libgcc/./_popcountdi2_s.o 
libgcc/./_paritysi2_s.o libgcc/./_paritydi2_s.o libgcc/./_powisf2_s.o 
libgcc/./_powidf2_s.o libgcc/./_powixf2_s.o libgcc/./_powitf2_s.o 
libgcc/./_mulsc3_s.o libgcc/./_muldc3_s.o libgcc/./_mulxc3_s.o 
libgcc/./_multc3_s.o libgcc/./_divsc3_s.o libgcc/./_divdc3_s.o 
libgcc/./_divxc3_s.o libgcc/./_divtc3_s.o libgcc/./_divdi3_s.o 
libgcc/./_moddi3_s.o libgcc/./_udivdi3_s.o libgcc/./_umoddi3_s.o 
libgcc/./_udiv_w_sdiv_s.o libgcc/./_udivmoddi4_s.o 
libgcc/./unwind-dw2_s.o libgcc/./unwind-dw2-fde_s.o 
libgcc/./unwind-sjlj_s.o libgcc/./gthr-gnat_s.o libgcc/./unwind-c_s.o 
-lc && rm -f ./ && if [ -f ./ ]; then mv -f 
./ ./; else true; fi && mv 
./ ./ && ln -s ./
skipping incompatible /usr/lib/ when searching for -lc
cannot find -lc
collect2: ld returned 1 exit status
make[3]: *** [] Error 1
make[3]: Leaving directory 
make[2]: *** [stmp-multilib] Error 2
make[2]: Leaving directory 
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory 
make: *** [all] Error 2

sam brightman

For unsubscribe information see

More information about the crossgcc mailing list