Subject: RE: Problems building ARM toolchain under Linux.

From: Dan Jakubiec <[email-masked]>
Date: Tue, 7 Sep 1999 16:00:25 -0700

>Try these instructions from a recent posting some weeks ago :
>
>Edit gcc/config/arm/t-linux and add "-Dinhibit_libc" and
>"-D__gthr_posix_h"
>to TARGET_LIBGCC2_CFLAGS
>Delete #include "gthr.h" in libgcc2.c
>Add the "--disable-threads" option to configure

Thanks for the info.  This seemed to fix my problem, but here are some more
questions:

1) What effect will the "inhibit_libc", "__gthr_posix_h", and
"--disable-threads" options have on my compiler?

2) Would it be better to add a "-D/usr/include" instead the the above
defines?  I am building a gcc cross-compiler for an ARM Linux system on an
Intel Linux box.  Will the system header files be close enough, or should I
not take this chance?

3) Finally, I think the reason I hit this problem is that the Linux source
base does not contain all the header files I need (such as stdlib.h,
unistd.h, etc.).  Why are these files not in the Linux kernel source base?
Where do they come from?

Thanks again for your help.

--
Dan Jakubiec
Systech Corporation
[email-masked]

-----Original Message-----
From: Jan-Uwe Finck [mailto:[email-masked]]
Sent: Friday, September 03, 1999 11:39 PM
To: [email-masked]'
Subject: Re: Problems building ARM toolchain under Linux.

On Fri, Sep 03, 1999 at 05:17:28PM -0700, Dan Jakubiec wrote:
>        ../../gcc-2.95.1/gcc/libgcc2.c -o ${name}.o; \
>   if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>   arm-linux-ar rc tmplibgcc2.a ${name}.o; \
>   rm -f ${name}.o; \
> done
> _muldi3
> ../../gcc-2.95.1/gcc/libgcc2.c:41: stdlib.h: No such file or directory
> ../../gcc-2.95.1/gcc/libgcc2.c:42: unistd.h: No such file or directory

Hope it helps,
-- 
CU	
	Jan-Uwe
-------------------------------------------------
PGP-Public-Key on Request.
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Philip Blundell <[email-masked]>
Date: Wed, 08 Sep 1999 09:56:10 +0100

>"--disable-threads" options have on my compiler?

The generated libraries will not be thread safe.  This will bite you if, for 
example, you have a multithreaded C++ program that uses exceptions.

>Intel Linux box.  Will the system header files be close enough, or should I

You would probably get away with this most of the time, but it's probably not 
a good idea.

>unistd.h, etc.).  Why are these files not in the Linux kernel source base?

They are part of the C library.  I think Chris Rutter's notes explain how to 
bootstrap a cross-compile environment from scratch, including how you can get 
the right headers in place.

p.

---

From: Marco Pantaleoni <[email-masked]>
Date: Wed, 8 Sep 1999 10:45:40 +0200

> Intel Linux box.  Will the system header files be close enough, or should I

I think you should build a parallel include tree, something like /usr/arm-include
with includes from ARM libc (I don't know if there are any differences in include
files) and the proper subdirectories from the ARM version of kernel source
(asm, linux, net, scsi subdirs).

> unistd.h, etc.).  Why are these files not in the Linux kernel source base?

Kernel code can't rely on libc (ie, you can't call malloc or printf from
kernel-space). Since the header files you mention are part of libc, and
can therefore be used only by user-space programs, they can't be distributed
with kernel sources.
Hope it helps,

Marco

========================================================================
Marco Pantaleoni                                           [email-masked]
Padova, Italy                                        Tel: ++39-49-686951
Software Engineering for the people      -        PLUTO Linux User Group
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Paul Kinzelman <[email-masked]>
Date: Wed, 08 Sep 1999 10:37:48 -0700

Phillip - Could you please point me to where Chris Rutter's notes
are located? I'm a very recent lurker so I probably missed them if
they were sent out to this list. Thanks!

--
-Paul Kinzelman, San Jose, CA, ISD Corp
email: [email-masked]
web:   http://www.timesync.com/kinz