Targetting Sparc/Solaris

Nathan Kidd
Fri Jul 27 13:49:00 GMT 2007

Sam Brightman wrote:
> I have been trying to build executables for a client who uses
> Sparc/Solaris from an Intel machine. The basic question is: is this
> possible? Is it possible with reasonable effort?

Assuming "from an Intel machine" in your question refers to building the
executables, i.e. "can I use an x86 machine to build native
SPARC/Solaris binaries", the answer is: yes, you can. It isn't too
difficult.  We haven't built on a native SPARC host in years.

> Our application builds on Windows, Linux, Solaris
> (Nexenta/Belenix/sometimes running under VMware), and under crosstools
> 0.43 on Linux/Solaris (targetting Sparc). The crosstools compiled
> version gives a "can't find" error on the client's machine
> (even when built under Solaris). Statically linking gives an illegal
> instruction. ldd on the Solaris (non-crosstools) built ELF shows no link
> to Is this always going to be a problem because crosstools
> is using it's private copy of Linux libraries even under Solaris?

It sounds like your cross compiler is picking up Linux (headers?/)libs.
You need to copy native Solaris SPARC libs and headers into your cross
compile environment, so it builds against them.  I've always built my
cross compilers myself (not with crosstool) so I don't know the details,
but somewhere in the process you need to say where those native libs and
headers are.

> Does anyone have any better suggestions? What are the potential issues
> if we decide to buy an old Sparc machine?

Hardware failure? Backup of machine?  Extra networking layer affecting
speed/reliability.   Having a simple DVD that contains a cross compiler
environment that will work on any dozens of machines laying around is
really nice.  As an example compare:

"Hey, we just upgraded our build machine to a quad-core 8ghz machine,
now a build of all platforms takes 3 seconds!"


"Hey, we just upgraded our build machine to a quad-core 8ghz machine,
now the Linux build finishes in 2 seconds, but the full build still
takes 2 hours because we're waiting on Ye Olde SPARC box to do the
Solaris SPARC build."


For unsubscribe information see

More information about the crossgcc mailing list