This is the mail archive of the crossgcc@sources.redhat.com 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]

Re: problems compiling gcc-3.3.5 with newlib-1.12.0


Carlos de wrote:
I'm tring to compile a cross-toolchain for arm-elf on
a IA32 linux box using gcc-3.3.5, binutils-2.15,
newlib-1.12.0 against linux-2.6.9 headers.
>>> [I applied all the patches in crosstool...]

It's a good idea to start with clean unpatched sources, and only add patches as you discover you need them.

Agreed. But then why were those patches there in the first place? I thought they were to be applied to any cross-compiler binutils-2.15.

Read the comments at the top of each patch to see why it's there. Some are to solve problems building on Solaris, some are to solve problems building various flavors of Linux, some are to solve problems building ld with gcc-3.4, etc. The comments let you choose intelligently.

Anyway aside of that thanks Kai for the info on
copying newlib headers into sys-include. The final gcc
build went thru without any problems

Yes, Kai has many helpful insights. One should beware his bias against building from pristine sources, though; his first instinct is always "just copy the headers from the target system", which is fine in many cases (even required, for the case of closed-source targets) but which isn't always the best idea for open-source targets.

However my troubles seem to have increased. It appears
that what is required is posix thread support (the
same as that provided by the glibc-linuxthreads
library ). On checking the configure options for
newlib-1.13.0  I find that --enable-newlib-multithread
apparently enables support for multiple theads. Also
on compiling  newlib with this option i get a
pthread.h header in $prefix/arm-elf/include which
(apparently - i havent checked fully) defines the
thread function headers. However on then trying to
compile the full gcc (with --enable-threads=posix) [fails.] ...
I'm still working on this but any inputs here would be
most welcome as from what info ive found so far
indicates that newlib does not support pthreads !

I have no experience with newlib, so I can't comment. (But the --enable-newlib-multithread option seems to be a funny beast. I don't know what it does, but judging from what's in newlib's source tree, I see a copy of linuxthreads, so I bet pthread support in newlib is a nasty hack that only works when you're building newlib programs to run on x86 linux!)

Also a (hopefully)minor confusion -when
cross-compiling for target=arm-linux the linux headers
are required while for arm-elf the linux headers are
not used. Is this because the target in the first case
uses glibc which requires linux ? and arm-elf using
newlib does not require this? I thought any library
would necessarily require the kernel headers.

The arm-elf target is not a Linux target, so the Linux headers are not required. arm-elf is a bare metal target, no OS, I think. - Dan

--
Trying to get a job as a c++ developer?  See http://kegel.com/academy/getting-hired.html

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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