This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
RE: Error in glibc make
- From: "Manoj Verma, Noida" <manojv at noida dot hcltech dot com>
- To: crossgcc at sources dot redhat dot com, libc-alpha at sources dot redhat dot com
- Cc: kai dot ruottu at luukku dot com, mingw-msys at lists dot sourceforge dot net
- Date: Wed, 22 Oct 2003 19:47:56 +0530
- Subject: RE: Error in glibc make
I have completed insatlling the GLIBC with some hacking.
I also completed building the final GCC.
But while compiling a sample file, sample.c I am getting the following
error:
c:\MinGW\msys\home\manojv\cinstall_arm\bin\..\lib\gcc-lib\arm-linux\3.2.2\..
\..\..\..\arm-linux\bin\ld.exe: cannot find /lib/libc.so.6
When I do:
$ arm-linux-ld --start-group -lc --end-group --verbose
I see:
==================================================
attempt to open c:/MinGW/msys/home/manojv/cinstall_arm/arm-linux/lib/libc.so
succeeded
opened script file
c:/MinGW/msys/home/manojv/cinstall_arm/arm-linux/lib/libc.so
opened script file
c:/MinGW/msys/home/manojv/cinstall_arm/arm-linux/lib/libc.so
attempt to open /lib/libc.so.6 failed
attempt to open /lib/libc.so.6 failed
attempt to open /lib/libc.so.6 failed
c:\MinGW\msys\home\manojv\cinstall_arm\bin\arm-linux-ld.exe: cannot find
/lib/libc.so.6
==================================================
While attempting to open libc.so.6 it fails.
It is a known bug with MinGW-hosted GNU ld, as stated by Kai. I have already
spent 1.5 weeks reaching at this stage. Could you suggest me where to go
from here? Is there any fix / patch available for this bug?
I am suppose to so all these stuffs on Windows platform only.
one more observation:
When I remove '-lc' from the ld option I get the following errors:
######################################################################
sample.o: In function `main':
sample.o(.text+0x20): undefined reference to `printf'
c:/MinGW/msys/home/manojv/cinstall_arm/arm-linux/lib/crt1.o: In function
`_start':
c:/MinGW/msys/home/manojv/cinstall_arm/arm-linux/lib/crt1.o(.text+0x20):
undefined reference to `__libc_start_main'
c:/MinGW/msys/home/manojv/cinstall_arm/arm-linux/lib/crt1.o(.text+0x24):
undefined reference to `abort'
######################################################################
If I build the sample program as:
$ arm-linux-gcc --static sample.c,
The program compiles and executes properly on the target.
BACKGROUND:
I am trying to build cross-compiler for "target=arm-linux",
"host=i686-pc-mingw32" on Win-2k.
The packages I am using are:
1) binutils-2.13.1.tar
2) For Kernel headers I am using linux-2.4.19.tar & patch-2.4.19-rmk4
(Kernel patch for arch=arm)
3) gcc-3.2.2
4) glibc-2.3.1.tar & glibc-linuxthreads-2.3.1.tar
Also see my comments below.
Thanks,
Manoj
> -----Original Message-----
> From: Kai Ruottu [mailto:kai.ruottu@luukku.com]
> Sent: Tuesday, October 21, 2003 3:17 AM
> To: Manoj Verma, Noida
> Subject: RE: Error in glibc make
>
>
> "Manoj Verma, Noida" <manojv@noida.hcltech.com> wrote:
>
> > programs/localedef.c:449:44: warning: unknown escape sequence '\l'
>
> Windoze is not the best build platform...
>
> >
> c:\MinGW\msys\home\manojv\cinstall_arm\bin\..\lib\gcc-lib\arm-
> linux\3.2.2\..
> > \..\..\..\arm-linux\bin\ld.exe: warning: ld-linux.so.2, needed by
> > C:/MinGW/msys/home/manojv/build_glibc/libc.so.6, not found
> (try using -rpath
> > or -rpath-link)
>
> This is a known bug with MinGW-hosted GNU ld's -- the
> 'NEEDED' shared libraries
> being 'linked' or 'chained' (please see with 'objdump -p') to
> other shared libs,
> will not be automagically found. For instance the
> 'ld-linux.so.2' is listed as
> 'NEEDED' inside the 'libc.so.6'. Although the error says that the
> '-rpath-link <libdir>' would s´resolve this, neither it will
> help... The only
> choice here is to add the 'ld-linux.so.2' into the link
> command, or fix the GNU
> ld for the MinGW host... All this if building glibc on
> Windoze is the only
> possibility available.
>
1) How do I add ld-linux.so.2 into the link command
2) I am suppose to so all these stuffs on Windows platform only.
> > make[2]: Leaving directory `/home/manojv/glibc-2.3.1/locale'
> > Kai Wrote: "The normal method is to copy the already built
> > glibc-2.2.5 from the target, then build GCC against it. No delimited
> > 'bootstrap-GCC', but the fully working GCC immediately"
>
> Please define your "target" a little more precisely! If you
> target is
> an existing Linux distribution for ARM, you should use the
> glibc coming
> with it, ie. the one used to produce all the
> applications/tools stuff in
> the distribution. If you are building your own Linux distribution from
> scratch, then you can use some existing glibc for Linux/ARM in your
> bootstrap stage, ie. to get a toolchain for some Linux/ARM
> system which
> you can later customize to your precise needs by building the
> glibc for
> it using some special options like '-msoft-float' (for
> ARM-CPUs without
> a FPU). The 'arm-linux-gnu' target has a CPU with FPU as the
> default...
>
> > My question is "Is there any location where the cross compiler for
> > "target=arm-linux" and "host=i686-pc-mingw32" is available??
>
> The produced glibc is for the target, not for the host... So you can
> build it anywhere where building glibc is possible and then copy the
> result to your Windoze host. On the build platform you will need the
> cross-GCC for 'arm-linux-gnu'. One can get a car be built in
> a suitable
> factory and then use it in a garage and on the road, so one can also
> build the Windoze hosted cross-GCC for 'arm-linux-gnu' on some other
> host which has the cross-GCC for MinGW...
>
> As told, if the Linux/ARM is an existing system with Linux
> on it, like
> RedHat 8.0 on x86, YelloDog on PPC, a ported Linux/ARM-PDA for iPaq or
> something, then rebuilding glibc for it will be vain because it should
> already exist as prebuilt and be 'customized' for just this "target".
>
> > If they are not available then the correct steps in
> building one are:
> > a) binutils, then (b) bootstrap GCC, then (C)Glibc,
> then (d) Final
> > GCC. ??
> > > 2) For Kernel headers I am using linux-2.4.19.tar &
> patch-2.4.19-rmk4
>
> What is this 'rmk4' ? Does it mean that the "target" is
> some "custom"
> Linux/ARM for some "custom" hardware?
>
patch-2.4.19-rmk4 is the Linux kernel patch for arch=arm.
> My advice would be to use some more sane build platform for
> the MinGW-
> hosted stuff... Ok, the only problem left seems to be the
> glibc, so 1st
> building a 'arm-linux-gnu' targeted cross-GCC on a Linux/x86 host and
> then using it to build the final glibc(s) for 'arm-linux-gnu' would be
> at least 10 times as easy as trying the same build on
> Windoze. Linux is
> like a modern factory with nice CNC-machines while the
> Windoze with MSYS
> is still like a garage with some simple manual tools... After
> the needed
> stuff has been built on the bakery/brewery, it can be moved
> to your mouth,
> easily as a piece of cake/can of beer, meanwhile trying to produce the
> cake/beer in your mouth may be hard...
>
> Cheers, Kai
>