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]

How to genetare multi libgcc


Hi,
Can someone help me for finding the right configuration for a 68k and CondFire toolchain?
Here is my problem:
I need to have a compiler capable to generate fpic code (code accesses by %PC, and data accesses by %A5).
The problem appears when I use float numbers. In this case, the compiler links my program with
../gcc-4.2.4/m68k-elf/lib/gcc/m68k-elf/4.2.4/m528x/libgcc.a(_float.o). So, the analysis of the generated code shows
that this libgcc.a doesn't contain any fpic code, so, my program crashes.
For a long time I have been using the gcc version 4.2.3 without any problems, now I have moved to the 4.2.4 (and I tried also the 4.3.1)
but this problem appears.
If I resume, it seems that for the version 4.2.3 the toolchain generates all the possible libgcc, but this is not the
case for the most recent versions (4.2.4 and 4.3.1).
Questions,:
1. how to modify my toolchain for making possible the generation of a multi libgcc (the normal and the fpic one)?
2. from the makefile how do I have to proceed for informing the linker to use one or the other library?
Thanks
Edo


PS: here is my toolchain for generating the compiler (the 68k generates also for ColdFire)

#!/bin/sh
# usage: toolchain [m68k, arm, bfin] [gcc version]
# ex.    sh toolchain m68k 4.2.4

TARGET_DIR=/Users/Shared

case "$1" in
    'm68k')
   		cpu=$1
   		bin_ver=2.18
   		gcc_ver=$2
   		nlb_ver=1.16.0
   		gdb_ver=6.7.1
		;;
    'arm')
   		cpu=$1
   		bin_ver=2.18
   		gcc_ver=$2
   		nlb_ver=1.16.0
   		gdb_ver=6.7.1
		;;
    'bfin')
   		cpu=$1
   		bin_ver=2.18
   		gcc_ver=$2
   		nlb_ver=1.16.0
   		gdb_ver=6.7.1
		;;
    *)
    	echo CPU not supported ...
		exit 127
		;;
esac

TARGET=$cpu-elf
BIN_VER=$bin_ver
GCC_VER=$gcc_ver
NLB_VER=$nlb_ver
GDB_VER=$gdb_ver

echo " - Create an alias of the library"
cd $TARGET_DIR/GCC/gcc-$GCC_VER
ln -s ../newlib-$NLB_VER/newlib .
ln -s ../newlib-$NLB_VER/libgloss .

export prefix=$TARGET_DIR/cross/gcc-$GCC_VER/$TARGET
export i=$prefix/bin

echo " Build the tools"
mkdir -p $TARGET_DIR/builds/gcc-$GCC_VER/$TARGET/binutils-$BIN_VER
cd $TARGET_DIR/builds/gcc-$GCC_VER/$TARGET/binutils-$BIN_VER
../../../../GCC/binutils-$BIN_VER/configure --target=$TARGET \
											--prefix=$prefix \
											--enable-multilib
make
make install
make clean

echo " - Build the compiler"
cd $TARGET_DIR/builds/gcc-$GCC_VER/$TARGET
mkdir gcc-$GCC_VER
cd gcc-$GCC_VER
../../../../GCC/gcc-$GCC_VER/configure --target=$TARGET \
									   --prefix=$prefix \
									   --enable-multilib \
									   --enable-languages=c \
									   --with-newlib \
									   --enable-newlib-io-long-long \
									   --with-gnu-as \
									   --with-gnu-ld
make "CFLAGS = -DREENTRANT_SYSCALLS_PROVIDED"
make install
make clean

echo " - Build the gdb"
cd $TARGET_DIR/builds/gcc-$GCC_VER/$TARGET
mkdir gdb-$GDB_VER
cd gdb-$GDB_VER
../../../../GCC/gdb-$GDB_VER/configure --target=$TARGET \
									   --prefix=$prefix \
									   --enable-multilib
make
make install
make clean

echo " - Terminate"

Attachment: smime.p7s
Description: S/MIME cryptographic signature


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