This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Can I build gcc 4.2.4 for 64 bit Intel Solaris 10 on a 64 bit Linux machine?
<randux@inmail.sk> writes:
> On Fri, 17 Apr 2009 08:28:55 -0700
> Ian Lance Taylor <iant@google.com> wrote:
>
>> <randux@inmail.sk> writes:
>>
>> > Can I build a complete gcc toolchain (I don't want gcc-java, but I
>> > do want Ada) on my 64 bit Linux box with a 64 bit Intel Solaris
>> > target? How do I get started?
>>
>> You need to first build a GNU/Linux -> Solaris cross-compiler,
>> including Ada support (configure with --target=sparc-sun-solaris),
>> and then use that cross-compiler to build a Solaris hosted compiler
>> (configure with --host=sparc-sun-solaris
>> --target=sparc-sun-solaris). Copy all the Solaris system libraries
>> and header files onto your GNU/Linux box, and use --with-sysroot when
>> building the GNU/Linux -> Solaris cross-compiler.
>
> When I build the cross-compiler do I need to specify any options other
> than the --target you mentioned? I still use the gnu Linux linker at
> this point, correct?
Well, you should specify --prefix and --with-sysroot. You will need to
build a complete set of cross-tools, including the linker from the GNU
binutils. In fact, you should build the cross-binutils before you build
the cross-gcc.
> Am I supposed to create the same path to the Solaris libraries and
> system files on my Linux box when I build the cross compiler as are in
> use on the Solaris machine?
The path itself doesn't have to be the same, and indeed since you will
be copying over /usr/include it should not be the same--you don't want
to replace your Linux /usr/include with the Solaris /usr/include.
Instead, pick a system root, e.g. /home/randux/solaris. Then copy the
files from Solaris into that root, so that you wind up with, e.g.,
/home/randux/solaris/usr/include. Then run configure using
--with-sysroot=/home/randux/solaris.
> I forgot to ask, is the target reall sparc-sun-solaris for Solaris on
> Intel? This is one of the confusing things. I couldn't find on the gcc
> web pages which target to specify for x64 Solaris.
I'm not sure that gcc has explicit support for x86_64 Solaris systems.
That might be very easy to add, I don't know. For 32-bit Intel Solaris
systems use something like i686-sun-solaris2.
Ian