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]

Re: Can't build gcc for embedded ARC cpu


Angel Manchado wrote:
> 
> I am trying to build GCC-2.95.3 as a cross-compiler on a i686-pc-linux-gnu host
> for an embedded ARC cpu core as target (arc-unknown-elf).
> 
> I guess that it fails due to the lack of standard library headers.
> ../../src/gcc-2.95.3/gcc/libgcc2.c:41: stdlib.h: No such file or directory
> ../../src/gcc-2.95.3/gcc/libgcc2.c:42: unistd.h: No such file or directory
> 
> Now if I add the option '--with-newlib' it arrives much far away in the
> building process, up to file "choose-temp.c" in the "libiberty" directory,
> but with a similar error message.

 If you mean that it was compiling 'libiberty' for 'arc-elf' and then
you
got this error, then what on earth is the problem when you have got GCC
built (the stuff in 'gcc') ?
 
> It seems that it is trying to use the just-built cross-compiler, xgcc, to
> compile some files with standard library headers.
> This is wrong since those headers don't exist.
> I don't know of any standard library that support the ARC cpu, and it probably
> shouldn't be necessary for an embedded target.

 This is also hard to understand... You defined '--with-newlib', which
means that you know what newlib is and that you are going to use newlib
as the selected C-library.

 There is support for 'arc-elf' in newlib-1.8.2 and newlib-1.9.0, newlib
includes the standard C-headers, so they do really exist. A standard C
library is needed if any standard C functions will be used... I haven't
yet seen a C-compiler for embedded use which doesn't have at least some
headers and some standard C functions implemented.

 The ARC-support in newlib however is really 'minimal', nothing like
'newlib/libc/machine/arc', 'newlib/libc/sys/arc' or 'libgloss/arc'
in newlib-1.9.0...

> So, isn't it possible to build GCC without those headers/libraries?

 It seems that you already succeeded, only by using the
'--with-newlib' option... How you did succeed is weird.

 Generally GCC may need some info about the CPU and the target system
for compiling the routines in libgcc.a and if newlib supports the
target, the question is why someone would like to meet all the problems
appearing when trying to avoid using newlib...

 If newlib doesn't support the target, the ARC-port serves as an very
good template, mimicking the definitions for 'arc' in
'newlib/configure.host'
adds just same kind of 'minimal' support, no CPU-specific things, no
system-specific things, only the 'pure' standard functions compiled for
the target.

Cheers, Kai



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


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