This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Targetting Sparc/Solaris


Nathan Kidd wrote:
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.

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.


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 ld-linux.so.2" 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 ld-linux.so. 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.

Well, the current output from the end of the build is shown below. Isn't it possible just to use -I or -isystem to redirect to the Solaris headers, and also use the crt*.o from Solaris with ld via flags? I think I read there is no specific dynamic loader on Solaris, so it should be blank instead of ld-linux... or does the whole toolchain need rebuilding without any linux-y stuff, hence lots of fiddling with crosstool scripts?


nclude <...> search starts here:
../common
/prefix/../../../../include/c++/4.1.0
/prefix/../../../../include/c++/4.1.0/sparc-unknown-linux-gnu
/prefix/../../../../include/c++/4.1.0/backward
/prefix/include
/prefix/../../../../sparc-unknown-linux-gnu/include
End of search list.
GNU C++ version 4.1.0 (sparc-unknown-linux-gnu)
compiled by GNU C version 4.0.3 (GNU_Solaris 4.0.3-1nexenta6).
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32711
Compiler executable checksum: 9650c24a92625de4f0ad6bb624699201
/prefix/../../../../sparc-unknown-linux-gnu/bin/as -V -Qy -s -Av9b -relax -o /var/tmp//cclXa4Yb.o /var/tmp//cc3Wa4Yb.s
GNU assembler version 2.16.1 (sparc-unknown-linux-gnu) using BFD version 2.16.1


/opt/crosstool/gcc-4.1.0-glibc-2.3.6/sparc-unknown-linux-gnu/libexec/gcc/sparc-unknown-linux-gnu/4.1.0/collect2 --eh-frame-hdr -m elf32_sparc -Y P,/usr/lib -relax -dynamic-linker /lib/ld-linux.so.2 -o cross_sm /prefix/../../../../sparc-unknown-linux-gnu/lib/crt1.o /prefix/../../../../sparc-unknown-linux-gnu/lib/crti.o /prefix/crtbegin.o -L../common -L/prefix -L/prefix/../../../../sparc-unknown-linux-gnu/lib /var/tmp//cc4Wa4Yb.o /var/tmp//cc5Wa4Yb.o /var/tmp//cc6Wa4Yb.o /var/tmp//cc7Wa4Yb.o /var/tmp//cc8Wa4Yb.o /var/tmp//cc9Wa4Yb.o /var/tmp//cc.Wa4Yb.o /var/tmp//cc_Wa4Yb.o /var/tmp//ccaXa4Yb.o /var/tmp//ccbXa4Yb.o /var/tmp//cccXa4Yb.o /var/tmp//ccdXa4Yb.o /var/tmp//cceXa4Yb.o /var/tmp//ccfXa4Yb.o /var/tmp//ccgXa4Yb.o /var/tmp//cchXa4Yb.o /var/tmp//cciXa4Yb.o /var/tmp//ccjXa4Yb.o /var/tmp//cckXa4Yb.o /var/tmp//cclXa4Yb.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /prefix/crtend.o /prefix/../../../../sparc-unknown-linux-gnu/lib/crtn.o
sparc-unknown-linux-gnu-strip -R .comment -R .note -R .note.ABI-tag cross_sm


--
sam brightman

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]