[#6195] Build xenomai kernel fail with shared_flat format in trunk
Submitted By: Vivi Li
Open Date
2010-08-19 23:32:49 Close Date
2010-11-03 06:19:10
Priority:
Medium Assignee:
Aaron Wu
Status:
Closed Fixed In Release:
N/A
Found In Release:
2010R1 Release:
Category:
N/A Board:
N/A
Processor:
ALL Silicon Revision:
Is this bug repeatable?:
Yes Resolution:
Assigned (Not Start)
Uboot version or rev.:
Toolchain version or rev.:
gcc4.3-2010_Aug_04
App binary format:
N/A
Summary: Build xenomai kernel fail with shared_flat format in trunk
Details:
Build xenomai kernel fail with shared_flat format.
Bellow is the error log:
--
/bin/sh ../../../libtool --tag=CC --mode=compile bfin-uclinux-gcc -DHAVE_CONFIG_H -I. -I../../../../xenomai-2.5.3/src/skins/common -I../../../src/include -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -I../../../../xenomai-2.5.3/include -DEMBED -D__uClinux__ -I/home/test/work/cruise/checkouts/uclinux-dist -mcpu=bf537-0.2 -pipe -Wall -g -O2 -mid-shared-library -mshared-library-id=0 -mcpu=bf537-0.2 -c -o libxenomai_la-bind.lo `test -f 'bind.c' || echo '../../../../xenomai-2.5.3/src/skins/common/'`bind.c
libtool: compile: bfin-uclinux-gcc -DHAVE_CONFIG_H -I. -I../../../../xenomai-2.5.3/src/skins/common -I../../../src/include -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -I../../../../xenomai-2.5.3/include -DEMBED -D__uClinux__ -I/home/test/work/cruise/checkouts/uclinux-dist -mcpu=bf537-0.2 -pipe -Wall -g -O2 -mid-shared-library -mshared-library-id=0 -mcpu=bf537-0.2 -c ../../../../xenomai-2.5.3/src/skins/common/bind.c -o libxenomai_la-bind.o
../../../../xenomai-2.5.3/src/skins/common/bind.c: In function ‘xeno_bind_skin_opt’:
../../../../xenomai-2.5.3/src/skins/common/bind.c:96: error: can't find a register in class ‘PREGS’ while reloading ‘asm’
../../../../xenomai-2.5.3/src/skins/common/bind.c:96: error: ‘asm’ operand has impossible constraints
--
Follow-ups
--- Vivi Li 2010-09-01 23:26:52
I find a version that can work. It is a long time ago(2009-11-28). Since end of
2009, xenomai patch can not applied to kernel.
--
kernel: Linux release 2.6.31.6-ADI-2010R1-pre-svn7890
toolchain: 09r1.1-rc2
user-dist: release svn-9194
--
--- Aaron Wu 2010-09-26 23:43:11
Can not find proper register of PREGS or DREGS in the inline-assembly in
__emit_syscall4 in arch/blackfin/include/asm/xenomai/syscall.h, if move the
constraints from 'd' or 'a' to 'r', the compile will pass but the built kernel
image can not run successfully. This happens only with the Shared_flat,may need
support from toolchain.
--- Mike Frysinger 2010-09-27 01:02:49
try the attached patch. the inline asm syntax is pretty inefficient.
--- Aaron Wu 2010-09-27 03:08:08
Thanks Mike,
compilling pass with this patch, kernel go panic when running the image.
registered protocol family 1
I-pipe: Domain Xenomai registered.
Xenomai: hal/blackfin started.
Xenomai: scheduling class idle registered.
Xenomai: scheduling class rt registered.
Xenomai: real-time nucleus v2.5.3 (Hordes Of Locusts) loaded.
Xenomai: starting default API services.
Xenomai: starting POSIX services.
Xenomai: starting RTDM services.
msgmni has been set to 94
io scheduler noop registered
io scheduler cfq registered (default)
bfin-uart: Blackfin serial driver
bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART
brd: module loaded
bfin_mii_bus: probed
bfin_mii_bus: Can't get IRQ 65535 (PHY)
bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1,
mdc_clk=2500000Hz(mdc_div=24)@sclk=125MHz)
bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1
rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
TCP cubic registered
NET: Registered protocol family 17
P-Config: Complete:tting system clock to 1970-02-25 14:55:19 UTC (4805719)
device=eth0, addr=10.99.29.108, mask=255.255.255.0, gw=10.99.29.1,
host=bf537-stamp, domain=, nis-domain=(none),
bootserver=10.99.29.112, rootserver=10.99.29.112, rootpath=
dma_alloc_init: dma_page @ 0x028b4000 - 256 pages at 0x03f00000
Freeing unused kernel memory: 6300k freed
BINFMT_FLAT: reloc outside program 0x1025b94 (0 - 0x14260/0x2440), killing
init!
Failed to execute /init
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
See Linux Documentation/init.txt for guidance.
Hardware Trace:
0 Target : <0x001434e0> { _dump_stack + 0x0 }
Source : <0x0014355a> { _panic + 0x42 } CALL pcrel
1 Target : <0x0014355a> { _panic + 0x42 }
Source : <0x00143674> { _printk + 0xac } RTS
2 Target : <0x0014366c> { _printk + 0xa4 }
Source : <0x001436a2> { _printk + 0xda } JUMP.S
3 Target : <0x001436a0> { _printk + 0xd8 }
Source : <0x00012d08> { _vprintk + 0x160 } RTS
4 Target : <0x00012cfc> { _vprintk + 0x154 }
Source : <0x0003717a> { ___ipipe_unstall_root + 0x2a } RTS
5 Target : <0x0003716a> { ___ipipe_unstall_root + 0x1a }
Source : <0x00037182> { ___ipipe_unstall_root + 0x32 } JUMP.S
6 Target : <0x00037182> { ___ipipe_unstall_root + 0x32 }
Source : <0x00037206> { ___ipipe_sync_stage + 0x82 } RTS
7 Target : <0x000371ce> { ___ipipe_sync_stage + 0x4a }
Source : <0x0003734e> { ___ipipe_sync_stage + 0x1ca } JUMP.S
8 Target : <0x00037336> { ___ipipe_sync_stage + 0x1b2 }
Source : <0x000373dc> { ___ipipe_sync_stage + 0x258 } JUMP.S
9 Target : <0x000373dc> { ___ipipe_sync_stage + 0x258 }
Source : <0xffa0038c> { _asm_do_IRQ + 0x40 } RTS
10 Target : <0xffa00384> { _asm_do_IRQ + 0x38 }
Source : <0x00016964> { __local_bh_enable + 0x48 } RTS
11 Target : <0x0001694e> { __local_bh_enable + 0x32 }
Source : <0x0001693c> { __local_bh_enable + 0x20 } IF !CC JUMP pcrel
(BP)
12 Target : <0x0001693a> { __local_bh_enable + 0x1e }
Source : <0x00006bba> { ___ipipe_test_root + 0xe } RTS
13 Target : <0x00006bac> { ___ipipe_test_root + 0x0 }
Source : <0x00016936> { __local_bh_enable + 0x1a } CALL pcrel
14 Target : <0x0001691c> { __local_bh_enable + 0x0 }
Source : <0x00016a9a> { ___do_softirq + 0x9e } CALL pcrel
15 Target : <0x00016a92> { ___do_softirq + 0x96 }
Source : <0x00016a86> { ___do_softirq + 0x8a } IF CC JUMP pcrel
Stack info:
SP: [0x0201bf98] <0x0201bf98> /* kernel dynamic memory (maybe
user-space) */
FP: (0x0201bfe4)
Memory from 0x0201bf90 to 0201c000
0201bf90: 0201bf98 00000000 [0017460c] 0014355e 001cefbc 0017460c 001af3ce
001af3ce
0201bfb0: 001af3ce 0201bfc8 00001262 001cefbc 00000000 001fcb88 0085b160
00000000
0201bfd0: 001e21f6 001fcb88 001fcb88 00000000 00000000
(00000000)<000014a6> 00000000
0201bff0: 00000000 00000000 ffffffff 00000006
Return addresses in stack:
frame 1 : <0x000014a6> { _kernel_thread_helper + 0x6 }
--- Mike Frysinger 2010-09-27 03:17:10
are you sure that occurs only with the xenomai stuff ?
the crash is init which should be compiled the same regardless of xenomai
userspace. "BINFMT_FLAT: reloc outside program" means a processing
error in the handling of the FLAT app which should be the same regardless of
xenomai kernel.
try disabling just xenomai in your kernel and boot that.
--- Aaron Wu 2010-11-03 06:19:10
This is due to the register assignment in syscall4 for xenomai, if change the
registers to 'r' from 'd' and 'da', or apply the patch from Mike as attached,
the compilling will pass, but there is another problem at run time, as reported
in bug 6319.
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
xenomai-bfin-syscalls.patch application/octet-stream 4997 Mike Frysinger
config.linux.xenomai application/octet-stream 40331 Vivi Li
config.config.xenomai application/octet-stream 49083 Vivi Li