Dear All,
When I got my 64bit laptop, running Fatdog 611, I am missing my 32bit application development.
What is the procedure to compile gcc source to create a cross compiler which can produce i386 executable, on Fatdog 611?
Please suggest.
Sincerely,
Srinivas Nayak
How to make gcc cross compiler (for i386) on 64 bit puppy?
How to make gcc cross compiler (for i386) on 64 bit puppy?
[Precise 571 on AMD Athlon XP 2000+ with 512MB RAM]
[Fatdog 720 on Intel Pentium B960 with 4GB RAM]
[url]http://srinivas-nayak.blogspot.com/[/url]
[Fatdog 720 on Intel Pentium B960 with 4GB RAM]
[url]http://srinivas-nayak.blogspot.com/[/url]
I did this.
Got a working compiler...
Sincerely,
Srinivas Nayak
Code: Select all
wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.23.tar.gz
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-2.4.2.tar.bz2
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-0.8.1.tar.gz
wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.6.2/gcc-core-4.6.2.tar.bz2
tar xvzf binutils-2.23.tar.gz
bunzip2 gmp-4.3.2.tar.bz2
tar xvf gmp-4.3.2.tar
bunzip2 mpfr-2.4.2.tar.bz2
tar xvf mpfr-2.4.2.tar
tar zxvf mpc-0.8.1.tar.gz
bunzip2 gcc-core-4.6.2.tar.bz2
tar xvf gcc-core-4.6.2.tar
mkdir src
mv gmp-4.3.2 mpc-0.8.1 mpfr-2.4.2 binutils-2.23 gcc-4.6.2 src
mkdir -p opt/cross
export PREFIX="$HOME/opt/cross"
export TARGET=i586-elf
export PATH="$PREFIX/bin:$PATH"
cd $HOME/src
mkdir build-binutils
cd build-binutils
../binutils-2.23/configure --target=$TARGET --prefix="$PREFIX" --disable-nls
make
make install
mv gmp-4.3.2 gcc-4.6.2/gmp
mv mpc-0.8.1 gcc-4.6.2/mpc
mv mpfr-2.4.2 gcc-4.6.2/mpfr
mkdir build-gcc
cd build-gcc
../gcc-4.6.2/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c --without-headers
make all-gcc
make all-target-libgcc
make install-gcc
make install-target-libgcc
$HOME/opt/cross/bin/$TARGET-gcc --version
#to add cross compiler location to system path
#export PATH="$HOME/opt/cross/bin:$PATH"
Sincerely,
Srinivas Nayak
Last edited by snayak on Wed 06 Nov 2013, 07:47, edited 1 time in total.
[Precise 571 on AMD Athlon XP 2000+ with 512MB RAM]
[Fatdog 720 on Intel Pentium B960 with 4GB RAM]
[url]http://srinivas-nayak.blogspot.com/[/url]
[Fatdog 720 on Intel Pentium B960 with 4GB RAM]
[url]http://srinivas-nayak.blogspot.com/[/url]
So, now use your new linker and compiler to compile glibc -it should be the same version as that used on the target system, and it should use the same patches (if any) and configuration options as the target systems' glibc. Be sure to use your separate prefix as for binutils and gcc.
Then when compiling apps for the target, you need to export LD_LIBRARY_PATH to the toolchain so that linking is done against the 32-bit libs above. If the app you want to compile rewuires other lobs besides glibc, then you'll need to compile and (subdir) install them before building.
Lot's of luck -cross-compiling can be a nightmare -even when things go well...
Then when compiling apps for the target, you need to export LD_LIBRARY_PATH to the toolchain so that linking is done against the 32-bit libs above. If the app you want to compile rewuires other lobs besides glibc, then you'll need to compile and (subdir) install them before building.
Lot's of luck -cross-compiling can be a nightmare -even when things go well...
By the way, with my default 64bit gcc, is it possible to use -m32 option to create a i386 executable?
I got
Any hope?
Sincerely,
Srinivas Nayak
I got
Code: Select all
~# gcc -march=i386 a.c
a.c:1:0: error: CPU you selected does not support x86-64 instruction set
a.c:1:0: error: CPU you selected does not support x86-64 instruction set
~#
Code: Select all
~# gcc -m32 a.c
/usr/lib64/gcc/x86_64-t2-linux-gnu/4.6.2/../../../../lib/crt1.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
~#
Sincerely,
Srinivas Nayak
[Precise 571 on AMD Athlon XP 2000+ with 512MB RAM]
[Fatdog 720 on Intel Pentium B960 with 4GB RAM]
[url]http://srinivas-nayak.blogspot.com/[/url]
[Fatdog 720 on Intel Pentium B960 with 4GB RAM]
[url]http://srinivas-nayak.blogspot.com/[/url]
Re: How to make gcc cross compiler (for i386) on 64 bit puppy?
http://crosstool-ng.org/snayak wrote:What is the procedure to compile gcc source to create a cross compiler which can produce i386 executable, on Fatdog 611?
Or if you are too lazy http://www.landley.net/aboriginal/downl ... 86.tar.bz2.
And beware of what amigo said, this is so true:
amigo wrote:Lot's of luck -cross-compiling can be a nightmare -even when things go well...
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]