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: uClinux


Thanks for the tips Bill,

I'm trying to build uClibc with an arm-elf-gcc I built using gcc-2.95.2 and
newlib-1.9.0, I don't know if the --with-newlib has polluted this gcc as far
as using it to build uClibc? It was the only way I could find to get a
working arm cross gcc from source.

The host is i686-pc-cygwin, I know this is sick, but if I can make it work
it fits in much better with the rest of our tools.

David Korn suggested the current trouble I'm having with compiling uClibc
has to do with CRLF in the source. I ran the conversion he's recommended
many times in the archives but it doesn't seem to change anything.

When I run a make menuconfig on the uClinux-2.4.x source it complains about
not being able to find arm-elf-linux-gcc. It seems it does still want this
flavour of gcc.

One thing that looked very bad to me in the uClibc error output was a
message at the very beginning about unknown operand true. When I ran the
CRLF converter I only ran it on the uClibc source tree, maybe I need to run
it through all of the system header directories?

I've read everything I can find about including appropriate target headers
and I'm still not clear on the details. I guess I'm in the stage of mucking
it up a few times as you said. Once I get this straightened out I am willing
to try to document it as an example in the FAQ if its deemed that my simple
contribution can help prevent the savants here from having to answer the
same questions over and over again.

Below is the uClibc make error output.

Thanks to All for your help...

John E. A.

$ make
[: true: unknown operand
make -C  extra
make[1]: Entering directory `/usr/src/uClibc/extra'
make -C  gcc-uClibc
make[2]: Entering directory `/usr/src/uClibc/extra/gcc-uClibc'
rm -f gcc-uClibc.h gcc-uClibc-* core
ls: /lib/ld*.so.[0-9]: No such file or directory
gcc -s gcc-uClibc.c -o gcc-uClibc-arm
make[2]: Leaving directory `/usr/src/uClibc/extra/gcc-uClibc'
make[1]: Leaving directory `/usr/src/uClibc/extra'
make -C  misc
make[1]: Entering directory `/usr/src/uClibc/misc'
make -C  assert
make[2]: Entering directory `/usr/src/uClibc/misc/assert'
arm-elf-gcc  -Wall -Os -fno-builtin -nostdinc  -Dlinux -D__linux__
-I../../inclu
de -I/usr/local/lib/gcc-lib/arm-elf/2.95.2/include -I. -D__LIBC__   -DNDEBUG
-D
__HAS_NO_MMU__ -c __assert.c -o __assert.o
Assembler messages:
 for reading.open
: No such file or directory
make[2]: *** [__assert.o] Error 1
make[2]: Leaving directory `/usr/src/uClibc/misc/assert'
make[1]: *** [_dir_assert] Error 2
make[1]: Leaving directory `/usr/src/uClibc/misc'
make: *** [_dir_misc] Error 2

-----Original Message-----
From: bgat@open-widgets.com [mailto:bgat@open-widgets.com]
Sent: Friday, March 23, 2001 2:11 PM
To: crossgcc@sources.redhat.com
Subject: Re: uClinux


John et al:


> >>  If you want a linux target, then you will need to obtain glibc and
> >> build with that.  If you want newlib, then I suggest you use a more
> >> appropriate cross configuration, such as plain "arm-elf".
> 
>   Given that, as you have just stated, you want to build a linux system,
> why didn't you follow the first part of his advice rather than the
> second ?  I don't know if uClinux is some embedded variant, but it
> probably still needs glibc rather than newlib.

uClinux is an MMU-less Linux, albeit with tons of other changes as
well.  Don't make any assumptions about one vs. the other--- they're
different enough that you need to think of them as being almost
totally unrelated...

Put another way, uClinux is *not* Linux, at least not from the
perspective of crossgcc reader.

You don't want glibc or newlib, you want uClibc--- a runtime library
written specifically for uClinux.  Check Lineo's website, as they
consider themselves the "owners" (and not always in the Free sense,
IMO) of uClinux et al.

Yes, newlib-1.9.0 supports the Linux ABI, but that isn't the "uClinux"
ABI, so I don't think it will work.

>  I think MontaVista (www.mvista.com or something) provides a prebuilt
> 'arm-linux' targeted toolkit and this includes the prebuilt target libs
> and headers for something possibly quite near to the uClinux. How their
> 'HardHat-Linux' differs is then another subject, but getting something
> working first could help.

Yes, MV has an arm-linux, but it isn't uClinux so it's of no use.

>  I built my 'arm-linux-gnu' toolset by first compiling GCC using the
copied
> glibc-headers from my 'i586-linux-gnu' machine, first replacing the links
> to the kernel headers (the 'asm' and 'linux' subdirs in 'include') to the
> right ones. Then built glibc-2.1.3 and rebuilt GCC using the installed
glibc
> (to make sure the right headers were used) and  then built glibc-2.2.1 as
> another glibc...

Ugh.  I have no idea what you've ended up with here.  :^(

When you build uClinux (or Linux for a different target, for that
matter), you're in a complete crossdevelopment environment.  If you
have to touch the build platform's configuration, then something is
wrong.

> So I built from scratch, but I knew all the time what I was
> doing... If things are still unclear, following the "Installation /
> Cross-Compiler" from the GCC manual, getting first the target libs
> and headers, and then building GCC using them, is the sure way...

I haven't done a uClinux build yet, but I don't think the compilers
will be "arm-linux", I think they're just "arm-elf".  In any case,
they pretty much do their own thing over there--- the CrossGCC FAQ
won't be much help on this until I get some time to update it.

> Generally it sounds absurd that someone could be a novice and to be
> the first to build binutils+gcc+glibc for something called
> 'uClinux-2.4' for ARM...

You probably aren't.  :^)

Unfortunately, uClinux isn't all that well documented yet.

The important parts are that you don't need binutils+gcc+glibc, you
need tools that have been (heavily) tweaked for uClinux.  At the
moment, they're only available at uClinux.org or Lineo.com unless they
say otherwise.

> Prebuilt binutils and gcc binaries aren't necessary, but the
> prebuilt glibc is... Anyone trying to build GCC for his/hers host,
> will need some target libs & headers first if not being familiar
> with building from scratch. So I would expect the 'arm-linux'
> C-library being easily available in the net...

Me myself, I *hate* prebuilt stuff.  Although, I'm using RHN to manage
a few of my workstations/servers, so that's all prebuilt.  But all my
crossdevelopment tools are homegrown, even installed in my own /opt
directory.

I've had an idea for a while to put together some RPMs for cross
compilers et al... anyone interested?

For the record, to build glibc you only need glibc itself and the
kernel headers for the OS you're building for, so glibc can get the OS
calls right.  But again, glibc isn't intended for use with uClinux.

> The prebuilt libs can be for a wrong ARM-processor type etc., but if
> GCC can be built using them, producing glibc for just the right type
> later isn't hard... Just following the build/install instructions in
> glibc sources...

Kai is right that building glibc is kind of a pain, however.  And the
instructions aren't all that clear until you've mucked it up a few
times.

>> Why on earth complicate matters with trying to build from scratch?
> 
> For the sheer joy and sense of discovery of learning something new?
> That's always seemed a good enough reason to try something
> complicated to me.... :)

Bravo!  :^)

I didn't catch the type of your build host, but you should just run
Linux if you can--- Cygwin is pretty good, but you'll find things go
*much* smoother if you run the full penguin.


b.g.
-- 
Bill Gatliff
bgat@open-widgets.com

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

------
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]