what needs arm-elf-nonlinux-gcc? what needs arm-elf-nonlinux-gccgo?
Steffen Dettmer
steffen.dettmer@googlemail.com
Wed Apr 20 11:38:00 GMT 2011
Hi,
thanks for you quick reply.
I'm sorry for asking so basic questions, but I didn't find
answers in the documentation, FAQ or Wiki.
Any pointers appreciated.
On Wed, Apr 20, 2011 at 2:10 AM, Ian Lance Taylor <iant@google.com> wrote:
> Steffen Dettmer <steffen.dettmer@googlemail.com> writes:
>
>> I would like to build a cross-compiler toolchain for embedded ARM
>> targets (to replace arm-elf-gcc-3.4.3).
>>
>> The targets are proprietary and has some special system libraries (so
>> -nostdlib is used and linkerscripts).
>> I think gcc needs some functions from the system (such as some
>> malloc() for C++ operator new etc). I searched FAQ and the wiki but
>> did not find much information about how to compile such a compiler
>> toolchain.
>> I've read about "--with-local-prefix". Should I create some
>> somepath/include and copy the systems "libc" headers into it (there
>> are just a very few functions known from ANSI-C) and give
>> --with-local-prefix=somepath/include? I cannot believe that this is
>> really that simple.
>
> Use --with-sysroot instead. It should point to header files in include
> and libraries in lib.
I'm following http://gcc.gnu.org/install/.
Is this right and sufficient?
As I understood, the simplest is to install binutils, gmp, mpc,
mpfr into the gcc source directory; so I did. I symlinked
binutils-2.21 to binutils and so on.
I assume that those packages are built automatically within gcc
building and that I do not need extra configure or make steps, do
I assume correctly?
I created and populated sysroot/include and sysroot/lib and configure with
------------------------------------------------------------------->8=======
# gcc-4.4.1/gcc/config/arm/t-arm-elf. Uncommented:
#
# MULTILIB_OPTIONS += mlittle-endian/mbig-endian
# MULTILIB_DIRNAMES += le be
# MULTILIB_MATCHES += mbig-endian=mbe mlittle-endian=mle
#
# MULTILIB_OPTIONS += mhard-float/msoft-float
# MULTILIB_DIRNAMES += fpu soft
# MULTILIB_EXCEPTIONS += *mthumb/*mhard-float*
#
# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
# MULTILIB_DIRNAMES += normal interwork
#
../gcc-4.6.0/configure \
--prefix=/usr/local/exp/gcc-4.6.0/ \
--enable-languages=c,c++ \
--target=arm-elf \
--program-prefix=arm-elf \
--with-sysroot=../sysroot \
--enable-interwork --enable-multilib \
--enable-target-optspace --with-float=soft
and see:
checking where to find the target ar... just compiled
checking where to find the target as... pre-installed
...
checking where to find the target ld... pre-installed
...
cc, c++, c++, dlltool, gcc, gcc, nm, objdump, ranlib, windres,
windmc also are "just compiled".
I want to use the new ld from ../gcc-4.6.0/binutils/ld.
I want it as /usr/local/exp/gcc-4.6.0/bin/arm-elf-ld.
Did I configure correctly?
I dislike the "target ld... pre-installed" message, if I
understand correctly, it is trying to use a wrong ld, isn't it?
also, the `ld' in $PATH is not `arm-elf-ld' (arm-elf-ld in PATH
would be an old linker, but I would like to use the new version).
> Building full cross-compiler toolchains is still harder than it
> should be. There is a lot of discussion of it on this list and
> on the crossgcc list.
yes, google finds heaps for everthing I searched, but
unfortunately doesn't help a lot. Many issues seem to be related
to c library (which for now I don't want to build). There are
many arm-linux related information, often for old versions. Hard
to know what matches my issues and could help me.
Any pointers appreciated.
BTW, I get a lot of warnings like
Warning: rest of line ignored; first ignored character is `i'
Warning: rest of line ignored; first ignored character is `d'
(gcc-3.2), also when building native compiler, do I need to worry?
oki,
Steffen
More information about the Gcc-help
mailing list