This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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: Cross Compiler and Linker for Linux


Hi, folks.

Try using absolute pathnames in the configure:
  ../gcc-%{gcc_version}/configure --target=sparc-solaris \
    --with-gnu-as --with-gnu-ld --without-newlib --verbose \
    --disable-shared --disable-nls --enable-languages=c,ada \
    --prefix=%{prefix}

With a combination of absolute pathmanes and specifying the extra options on the command-line, I have managed to compile (and install!) a "working" sparc-solaris-gcc-3.3 compiler on Linux. I'm so excited that I'm sharing the news before I have actually tried compiling something (the executable pulls up version information just fine, so I figure it will compile without problems).


Please find attached the complete instructions on how to create a cross compiler on Linux Mandrake i686 (probably RedHat, Slackware, and Debian too) for a Solaris sparc machine. You have my permission to include them (with modifications and appropriate attributions to myself, Joel, and Peter) in any and all GCC-related documentation. (If you believe them to be of any use.)

Thanks for all your help!

Sincerely,
Dave Jarvis
-----------------------------------------------------------
1.0 Goal
-----------------------------------------------------------
To build a series of cross-compilers and linkers on an i686 Mandrake Linux
box.  Targets include: SunOS 5.8 (sparc), HP-UX 11i (PA-Risc 1 and 2), and
AIX 5.2 (RS/6K).

-----------------------------------------------------------
2.0 Attempt Details
-----------------------------------------------------------
Target: SunOS 5.8 sparc
Host  : Linux Mandrake i686

-----------------------------------------------------------
2.1 Definitions
-----------------------------------------------------------
HOST = Machine on which you want to use for compiling programs.  Defaults
to the current machine.
TARGET = Machine architecture (OS + CPU) on which the compiled programs
should execute.

-----------------------------------------------------------
2.2 Libraries and Header Files
-----------------------------------------------------------
1) mkdir /usr/local/cc/sparc-solaris
2) Copy /usr/lib from TARGET machine to HOST machine at:
         /usr/local/cc/sparc-solaris/sparc-solaris
3) Copy /usr/include from TARGET machine to HOST machine at:
         /usr/local/cc/sparc-solaris/sys-include

-----------------------------------------------------------
2.3 Software Packages
-----------------------------------------------------------
1) binutils v2.13.2.1
2) gcc v3.3

-----------------------------------------------------------
3.0 Software Preparation
-----------------------------------------------------------
1) mkdir /usr/local/cc
2) cd /usr/local/cc
3) Download binutils from GNU from mirror
4) Download gcc from GNU from mirror (includes libraries)
5) tar jxf binutils-2.13.2.1.tar.bz2
6) tar jxf gcc-3.3.tar.bz2
7) mkdir build-binutils
8) mkdir build-gcc

-----------------------------------------------------------
3.1 Compilation and Installation
-----------------------------------------------------------
1) cd build-binutils
2) ../binutils-2.13.2.1/configure --prefix=/usr/local/cc/sparc-solaris \
  --target=sparc-solaris \
  --with-libs=/usr/local/cc/sparc-solaris/sparc-solaris \
  --with-headers=/usr/local/cc/sparc-solaris/sys-include
3) make && make install

4) cd ../build-gcc
5) export PATH=/usr/local/cc/sparc-solaris/bin:$PATH
6) ../gcc-3.3/configure --prefix=/usr/local/cc/sparc-solaris \
  --target=sparc-solaris --without-newlib --disable-shared --disable-nls \
  --enable-languages=c \
  --with-libs=/usr/local/cc/sparc-solaris/sparc-solaris \
  --with-headers=/usr/local/cc/sparc-solaris/sys-include \
  --with-gnu-as --with-gnu-ld
7) make && make install

-----------------------------------------------------------
4.0 Result
-----------------------------------------------------------


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