[oe] Stuck with AVR32 segfaults in init
Geoffrey Wossum
geoffrey at pager.net
Tue Mar 11 22:46:58 UTC 2008
Hi all,
I can't seem to get past a problem with init segfaulting at boot time on my
AVR32 board. Here's the error I get:
Freeing init memory: 64K (90000000 - 90010000)
init[1]: segfault at 00000008 pc 2aaabc84 sp 7fec2f30 ecr 24
init has generated signal 11 but has no handler for it
Kernel panic - not syncing: Attempted to kill init!
I started out using the toolchain already in OE. This was:
binutils 2.17.atmel.0.0.99 20060623
gcc 4.1.2-atmel.1.1.0
uClibc 0.9.28-avr32-20061019 (or somesuch)
It was suggested I move up to uClibc 0.9.29, so I got that working quickly.
No dice. Exact same error.
I tried passing init=/bin/sh, and that segfaulted with almost exactly the same
error message, so it seems to be a more general problem than with sysvinit.
Now, Atmel's buildroot for the AVR32 version 2.1.0 can build a fully bootable
image (with a little prodding). It uses:
binutils 2.17.atmel.0.0.99 20060623
gcc 4.2.1-atmel.1.0.3
uClibc 0.9.29-atmel.1 (or somesuch)
So I hacked around a little bit, and got OE setup with:
binutils 2.17.atmel.0.0.99 20060623
gcc 4.2.1-atmel.1.0.3
uClibc 0.9.29-atmel.1
That ought to work the same. No, same exact error. Comparing the source code
of the tool chains, binutils and uClibc are the same, but gcc is only ALMOST
the same. I don't think the differences I found impact this problem, but
here they are:
--- gcc-4.2.1/gcc/config/avr32/avr32.c 2007-10-16 03:21:32.000000000 -0500
+++ /home/geoff/src/buildroot-avr32-v2.1.0/toolchain_build_avr32_nofpu/gcc-4.2.1/gcc/config/avr32/avr32.c
2008-02-25 09:09:42.000000000 -0600
@@ -705,8 +705,8 @@
{
if (avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21"))
{
- fprintf (file, "\tsub\t%s, -0x%x\n", reg_names[this_regno],
- mi_delta);
+ fprintf (file, "\tsub\t%s, %d\n", reg_names[this_regno],
+ -mi_delta);
}
else
{
--- gcc-4.2.1/gcc/config/avr32/linux-elf.h 2007-10-01 08:43:09.000000000 -0500
+++ /home/geoff/src/buildroot-avr32-v2.1.0/toolchain_build_avr32_nofpu/gcc-4.2.1/gcc/config/avr32/linux-elf.h
2008-02-25 09:09:42.000000000 -0600
@@ -68,7 +68,7 @@
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
#undef ASM_SPEC
-#define ASM_SPEC "%{!mno-pic:%{!fno-pic:--pic}} %{mrelax|O*:%{mno-relax|O0|
O1: ;:--linkrelax}} %{mcpu=*:-mcpu=%*}"
+#define ASM_SPEC "%{!mno-pic:--pic} %{mrelax|O*:%{mno-relax|O0|
O1: ;:--linkrelax}} %{mcpu=*:-mcpu=%*}"
#undef LINK_SPEC
#define LINK_SPEC "%{version:-v} \
Since both sysvinit and busybox both segfault with about the same error, I'm
thinking it might be related to runtime linking. I tried configuring uClibc
to with SUPPORT_LD_DEBUG and SUPPORT_LD_DEBUG_EARLY, and then passing
LD_DEBUG=all on the kernel command line to get it to the init environment.
Nothing was printed out, so either I didn't do the LD debug properly, or
something is really wrong.
I've never had an issue building a kernel that boots, but I haven't been able
to get past whatever the init process is segfaulting.
Does anyone have an ideas?
Thanks,
---
Geoffrey
More information about the Openembedded-devel
mailing list