我正在使用yocto jethro
为OMAP3630
处理器构建我的定制Linux发行版。我有一个预编译的linaro工具链版本gcc-4.7.3
,我的内核是版本3.2
。我正在尝试将我的交叉编译器升级到gcc-4.8.4
(使用yocto提供的gcc版本,而不是linaro)。
一切似乎都正确编译,但是当我运行内核时,我收到以下对齐异常错误消息:
[ 0.516387] Unhandled fault: alignment exception (0x001) at 0x0073656b
[ 0.523193] Internal error: : 1 [#1] PREEMPT
[ 0.527679] Modules linked in:
[ 0.530914] CPU: 0 Tainted: G W (3.2.0-rc1 #6)
[ 0.536834] PC is at rb_next+0x24/0x68
[ 0.540771] LR is at sysfs_remove_dir+0x84/0xcc
[ 0.545532] pc : [<c0194948>] lr : [<c0130084>] psr: 20000013
[ 0.545532] sp : cf837f70 ip : 22222222 fp : 00000000
[ 0.557525] r10: 00000000 r9 : c04c95e0 r8 : 00000000
[ 0.562988] r7 : c04c9724 r6 : cf837f40 r5 : fffffffe r4 : cf801cc0
[ 0.569793] r3 : 69766564 r2 : 00736563 r1 : 22222222 r0 : cf801cc0
[ 0.576629] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
[ 0.584228] Control: 10c5387f Table: 80004019 DAC: 00000015
[ 0.590240] Process swapper (pid: 1, stack limit = 0xcf8362f0)
[ 0.596313] Stack: (0xcf837f70 to 0xcf838000)
[ 0.600891] 7f60: cf812310 00000000 c04c95e8 fffffffe
[ 0.609405] 7f80: 00000000 c01900a4 c04c95e8 c01d7ae4 00000000 00000000 c04c95e0 ffff6a0e
[ 0.617919] 7fa0: 00000000 c01e40b8 00000000 c0497aa4 00007fb0 c000f1b8 00000013 00000000
[ 0.626434] 7fc0: 00000000 00000000 00000000 c0475784 c0497aa4 c0475818 cf80f8c0 c045d80c
[ 0.634948] 7fe0: 00000000 00000000 00000000 00000000 c045d78c c000f1b8 2b22d90f 18552020
[ 0.643463] [<c0194948>] (rb_next+0x24/0x68) from [<c0130084>] (sysfs_remove_dir+0x84/0xcc)
[ 0.652160] [<c0130084>] (sysfs_remove_dir+0x84/0xcc) from [<c01900a4>] (kobject_del+0x10/0x38)
[ 0.661224] [<c01900a4>] (kobject_del+0x10/0x38) from [<c01d7ae4>] (device_add+0x12c/0x59c)
[ 0.669921] [<c01d7ae4>] (device_add+0x12c/0x59c) from [<c0475784>] (platform_bus_init+0x14/0x4c)
[ 0.679168] [<c0475784>] (platform_bus_init+0x14/0x4c) from [<c0475818>] (driver_init+0x1c/0x28)
[ 0.688293] [<c0475818>] (driver_init+0x1c/0x28) from [<c045d80c>] (kernel_init+0x80/0x120)
[ 0.696990] [<c045d80c>] (kernel_init+0x80/0x120) from [<c000f1b8>] (kernel_thread_exit+0x0/0x8)
[ 0.706146] Code: e3520000 1a000001 ea000005 e1a02003 (e5923008)
[ 0.712524] ---[ end trace 1b75b31a2719ed22 ]---
[ 0.717407] Kernel panic - not syncing: Attempted to kill init!
我之前在使用gcc-4.7.3
时遇到了类似的问题,我在编译内核时解决了将-mno-unaligned-access
添加到EXTRA_CFLAGS
的问题,但它似乎无法解决{{1}的问题}}。我还在编译内核时使用一个版本和另一个版本来比较gcc命令,它们是相同的。我已经对gcc-4.8.4
进行了简短的测试,结果也类似。这让我觉得yocto gcc可能配置错误,但不知道具体的配置值可能导致这种情况。
有关我gcc-4.9
的一些信息:
gcc-4.7.3
同样适用于$ arm-none-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=/home/alima/projects/yocto/build/../poky/external-precompiled-toolchain/toolchains/arm-linaro-5//bin/arm-none-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/home/alima/projects/yocto/poky/external-precompiled-toolchain/toolchains/Thumb2_linaro-4.7-2012.11_eglibc-2.16/bin/../libexec/gcc/arm-none-linux-gnueabi/4.7.3/lto-wrapper
Target: arm-none-linux-gnueabi
Configured with: /tmp/build/src/gcc-linaro-4.7-2012.11/configure --build=x86_64-build_unknown-linux-gnu --host=x86_64-build_unknown-linux-gnu --target=arm-none-linux-gnueabi --prefix=/opt/toolchains/arm-linaro-5 --with-sysroot=/opt/toolchains/arm-linaro-5/arm-none-linux-gnueabi/sysroot --enable-languages=c,c++ --with-arch=armv7-a --with-fpu=neon --with-float=hard --with-pkgversion='crosstool-NG hg+default-2af20cfd210b - arm-linaro-4' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --with-gmp=/tmp/build/arm-none-linux-gnueabi/buildtools --with-mpfr=/tmp/build/arm-none-linux-gnueabi/buildtools --with-mpc=/tmp/build/arm-none-linux-gnueabi/buildtools --with-ppl=/tmp/build/arm-none-linux-gnueabi/buildtools --with-cloog=/tmp/build/arm-none-linux-gnueabi/buildtools --with-libelf=/tmp/build/arm-none-linux-gnueabi/buildtools --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm -L/tmp/build/arm-none-linux-gnueabi/buildtools/lib -lpwl' --enable-threads=posix --enable-target-optspace --disable-nls --disable-multilib --with-local-prefix=/opt/toolchains/arm-linaro-5/arm-none-linux-gnueabi/sysroot --enable-c99 --enable-long-long --with-mode=thumb --with-float=hard --disable-clocale
Thread model: posix
gcc version 4.7.3 20121106 (prerelease) (crosstool-NG hg+default-2af20cfd210b - arm-linaro-4)
:
gcc-4.8.4
我的问题是:有谁知道造成这种情况的原因是什么?即使你不确定,请你评论一下,我可以检查一下吗?
提前谢谢大家。