init segfaults when compiled with glibc
On Tue, Mar 30, 2010 at 4:20 PM, Yann E. MORIN
<[email protected]> wrote:
Sasha, All,
On Tuesday 30 March 2010 142701 Sasha Sirotkin wrote:
> I compiled an external toolchain with glibc support using
crosstools-ng
> as recommended. I managed to compile buildroot without any issues. > However, when I try to use the resulting image /sbin/init segfaults. > With uclibc there are no such issues. I'm using the latest
versions of
> everything on ARM with EABI.
By default, gcc will emit armv5t instructions. What's your target CPU? init segfaulting can be a symptom of using a bad instruction set, so if your CPU is armv4, and you did not tell gcc to default to armv4, then you will hit this segfault issue.
As I already mentioned, it works fine with uClibc, so it is definitely not a CPU instructions issue. At any rate, my CPU is AT91, i.e. armvte instruction set.
Sasha, All,
Quoted 7 lines · On Tuesday 30 March 2010 16:26:14 Sasha Sirotkin wrote:
On Tue, Mar 30, 2010 at 4:20 PM, Yann E. MORIN <[email protected]> wrote:
On Tuesday 30 March 2010 142701 Sasha Sirotkin wrote:
> I compiled an external toolchain with glibc support using
crosstools-ng
> as recommended. I managed to compile buildroot without any issues. > However, when I try to use the resulting image/sbin/initsegfaults.
Standard init, or busybox' ?
Quoted 3 lines
> With uclibc there are no such issues. I'm using the latest
versions of
> everything on ARM with EABI.
In crosstool-NG, there's a sample that is quite up-to-date and that builds an arm-unknown-linux-gnueabi:
# ct-ng show-arm-unknown-linux-gnueabi
arm-unknown-linux-gnueabi [l ]
OS : linux-2.6.31.12
Companion libs : gmp-4.3.1 mpfr-2.4.2 libelf-0.8.12
binutils : binutils-2.19.1
C compiler : gcc-4.3.2 (C,C++,Fortran,Java)
C library : glibc-2.9
Tools : sstrip dmalloc-5.5.2 duma-2_5_15 gdb-6.8 ltrace-0.5.3 strace-4.5.19Quoted 7 lines
By default, gcc will emit armv5t instructions. What's your target CPU? init segfaulting can be a symptom of using a bad instruction set, so if your CPU is armv4, and you did not tell gcc to default to armv4, then you will hit this segfault issue.
As I already mentioned, it works fine with uClibc, so it is definitely not a CPU instructions issue. At any rate, my CPU is AT91, i.e. armvte instruction set.
Ahem. Right, sorry.
I'll read you back on crossgcc... :-)
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
Le 30/03/2010 16:26, Sasha Sirotkin a ?crit :
Quoted 4 lines
As I already mentioned, it works fine with uClibc, so it is definitely not a CPU instructions issue. At any rate, my CPU is AT91, i.e. armvte instruction set.
AT91RM9200 is armv4
Eric
Quoted 8 lines · Eric BENARD
Le 30/03/2010 16:26, Sasha Sirotkin a ?crit :
As I already mentioned, it works fine with uClibc, so it is definitely
Quoted 4 lines
not a CPU instructions issue. At any rate, my CPU is AT91, i.e. armvte instruction set.
AT91RM9200 is armv4
You are right, nevertheless the isssue, i.e. init sudden death is not related to the instruction set - as I already mentioned, it works just fine with uClibc. The problem appears only when I use external glibc based toolchain.
Quoted 8 lines
Eric
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20100331/689a90b7/attachment.htm>
Quoted 5 lines · Alexander (Sasha) Sirotkin
You are right, nevertheless the isssue, i.e. init sudden death is not related to the instruction set - as I already mentioned, it works just fine with uClibc. The problem appears only when I use external glibc based toolchain.
I had the same problem a month ago more or less. With a glibc toolchain built with crosstool-NG the init process was dying and the kernel panic'ing as a result because init (pid=1) was not supposed to die.
Unfortunately i could not manage to find what the problem was. All i found is that it was happening with some versions of glibc while it was working with other versions: glibc-2.9 was failing, so my workaround was finally to select EGLIBC-2.10 to build the toolchain. With that version it worked for me.
Give it a try to a newer version of glibc/eglibc (starting with 2.10) and let us know if it works.
Signature · 7 lines
Regards, Javier Viguera Software Engineer Digi International Spain, S.A. http://www.digi.com
Quoted 13 lines · Javier Viguera
Quoted 6 lines · Alexander (Sasha) Sirotkin
You are right, nevertheless the isssue, i.e. init sudden death is not related to the instruction set - as I already mentioned, it works just fine with uClibc. The problem appears only when I use external glibc based toolchain.
I had the same problem a month ago more or less. With a glibc toolchain built with crosstool-NG the init process was dying and the kernel panic'ing as a result because init (pid=1) was not supposed to die.
Quoted 6 lines
Unfortunately i could not manage to find what the problem was. All i found is that it was happening with some versions of glibc while it was working with other versions: glibc-2.9 was failing, so my workaround was finally to select EGLIBC-2.10 to build the toolchain. With that version it worked for me.
I did not manage to compile crosstoll-ng with eglibc yet. It looks like eglibc support is broken in crosstool-ng and glibc support is broken in buildroot.
Dead end...
Quoted 10 lines
Give it a try to a newer version of glibc/eglibc (starting with 2.10) and let us know if it works.
--
Regards,Javier Viguera
Software Engineer
Quoted 9 lines
Digi International Spain, S.A.
http://www.digi.com_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20100331/6c65079c/attachment-0001.htm>
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Alexander" == Alexander (Sasha) Sirotkin <[email protected]> writes:
Alexander> I did not manage to compile crosstoll-ng with eglibc yet. It Alexander> looks like eglibc support is broken in crosstool-ng and Alexander> glibc support is broken in buildroot.
uClibc? We don't have glibc support (except for external toolchains), so it cannot really be broken ;)
Signature · 1 line
Bye, Peter Korsgaard
Quoted 11 lines · Peter Korsgaard
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Alexander" == Alexander (Sasha) Sirotkin <[email protected]> writes:
Alexander> I did not manage to compile crosstoll-ng with eglibc yet. It Alexander> looks like eglibc support is broken in crosstool-ng and Alexander> glibc support is broken in buildroot.
uClibc? We don't have glibc support (except for external toolchains), so it cannot really be broken ;)
Well... it is broken in a sense that buildroot does not work with an external toolchain based on glibc. Please see above.
Quoted 8 lines · Sasha Sirotkin
Quoted 7 lines · Peter Korsgaard
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Alexander" == Alexander (Sasha) Sirotkin <[email protected]> writes:
Alexander> I did not manage to compile crosstoll-ng with eglibc yet. It Alexander> looks like eglibc support is broken in crosstool-ng and Alexander> glibc support is broken in buildroot.
Quoted 6 lines
Quoted 4 lines
uClibc? We don't have glibc support (except for external toolchains), so it cannot really be broken ;)
Well... it is broken in a sense that buildroot does not work with an external toolchain based on glibc. Please see above.
FWIW, I'm using an external glibc toolchain (created with crosstoo-NG) with no problems.
Regards,
Hartley
Quoted 20 lines · H Hartley Sweeten
Quoted 9 lines · Sasha Sirotkin
Quoted 7 lines · Peter Korsgaard
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
"Alexander" == Alexander (Sasha) Sirotkin <[email protected]> writes:
Alexander> I did not manage to compile crosstoll-ng with eglibc yet. It Alexander> looks like eglibc support is broken in crosstool-ng and Alexander> glibc support is broken in buildroot.
Quoted 8 lines
Quoted 5 lines
uClibc? We don't have glibc support (except for external toolchains), so it cannot really be broken ;)
Well... it is broken in a sense that buildroot does not work with an external toolchain based on glibc. Please see above.
Quoted 5 lines
FWIW, I'm using an external glibc toolchain (created with crosstoo-NG) with no problems.
Regards,
Hartley
I'd be extremely grateful to know how you managed to do this. As you can see above I could not compile crosstool-ng with eglibc and when I used glibc version created with crosstool-ng I ran into this "init death" problem that at least one other person could reproduce.
Quoted 2 lines · On Wed, 31 Mar 2010 21:28:29 +0300 Sasha Sirotkin <[email protected]>…
Well... it is broken in a sense that buildroot does not work with an external toolchain based on glibc. Please see above.
Could you please stop making false assertions, and start being nice so that we can have some interest in helping you ?
The fact that using Buildroot, with glibc external toolchain, does not work in *your* *particular* configuration, does not mean at all that Buildroot does not support glibc external toolchains. Just like Hartley, I successfully build and run systems generated by Buildroot, and that used a glibc external toolchain.
It is quite possible that the configuration mistake is on your side, so instead of being offensive about the status of Buildroot, could you just be nice and help us to constructively solve the problem you're having ?
Thanks!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Quoted 8 lines · Thomas Petazzoni
Quoted 2 lines · On Wed, 31 Mar 2010 21:28:29 +0300 Sasha Sirotkin <[email protected]>…
Well... it is broken in a sense that buildroot does not work with an external toolchain based on glibc. Please see above.
Could you please stop making false assertions, and start being nice so that we can have some interest in helping you ?
Sorry about that, it is simply a frustration of somebody who's been trying to compile buildroot with glibc for a few weeks already.
Quoted 25 lines
The fact that using Buildroot, with glibc external toolchain, does not work in *your* *particular* configuration, does not mean at all that Buildroot does not support glibc external toolchains. Just like Hartley, I successfully build and run systems generated by Buildroot, and that used a glibc external toolchain.
It is quite possible that the configuration mistake is on your side, so instead of being offensive about the status of Buildroot, could you just be nice and help us to constructively solve the problem you're having ?
Thanks!
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Quoted 11 lines · Javier Viguera
Quoted 5 lines · Alexander (Sasha) Sirotkin
You are right, nevertheless the isssue, i.e. init sudden death is not related to the instruction set - as I already mentioned, it works just fine with uClibc. The problem appears only when I use external glibc based toolchain.
I had the same problem a month ago more or less. With a glibc toolchain built with crosstool-NG the init process was dying and the kernel panic'ing as a result because init (pid=1) was not supposed to die.
Quoted 8 lines
Unfortunately i could not manage to find what the problem was. All i found is that it was happening with some versions of glibc while it was working with other versions: glibc-2.9 was failing, so my workaround was finally to select EGLIBC-2.10 to build the toolchain. With that version it worked for me.
Give it a try to a newer version of glibc/eglibc (starting with 2.10) and let us know if it works.
Eventually I managed to compile crosstool-ng with eglibc 2.10 after downgrading the compiler to 4.3.2 from 4.4.1 and binutils to 2.19 from 2.20. This one seems to work OK with buildroot.
Quoted 15 lines
--
Regards,Javier Viguera
Software EngineerDigi International Spain, S.A.
http://www.digi.com_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot