Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: evbarm and evbcf -current builds broken
On 31 Oct, 2013, at 12:40 , Marc Balmer <marc%msys.ch@localhost> wrote:
> Am 30.10.13 20:36, schrieb Dennis Ferguson:
>>
>> On 29 Oct, 2013, at 22:38 , Dennis Ferguson
>> <dennis.c.ferguson%gmail.com@localhost> wrote:
>>> # compile lua/lua_tramp.o
>>> /build/beagle/obj/tooldir.NetBSD-6.99.24-amd64/bin/armv7--netbsdelf-eabihf-gcc
>>> -I/usr/src/common/include --sysroot=/build/beagle/obj/destdir.evbarm
>>> -include /usr/src/sys/modules/lua/luaconf.h
>>> -I/usr/src/sys/../external/mit/lua/dist/src -I/usr/src/common/include
>>> -nostdinc -I. -I/usr/src/sys/modules/lua -isystem /usr/src/sys -isystem
>>> /usr/src/sys/arch -isystem /usr/src/sys/../common/include -D_KERNEL -D_LKM
>>> -D_MODULE -DSYSCTL_INCLUDE_DESCR -x assembler-with-cpp -c lua_tramp.S
>>> ./arm/int_types.h: Assembler messages:
>>> ./arm/int_types.h:45: Error: bad instruction `typedef signed char __int8_t'
>>> ./arm/int_types.h:46: Error: bad instruction `typedef unsigned char
>>> __uint8_t'
>>
>> This patch seems to fix the problem that arm builds are still having:
>>
>> Index: sys/modules/lua/Makefile
>> ===================================================================
>> RCS file: /cvsroot/src/sys/modules/lua/Makefile,v
>> retrieving revision 1.1
>> diff -u -r1.1 Makefile
>> --- sys/modules/lua/Makefile 16 Oct 2013 19:44:57 -0000 1.1
>> +++ sys/modules/lua/Makefile 30 Oct 2013 19:34:32 -0000
>> @@ -42,7 +42,8 @@
>> strpbrk.c \
>> strspn.c
>>
>> -CPPFLAGS+= -include ${.CURDIR}/luaconf.h \
>> - -I${S}/../external/mit/lua/dist/src
>> +CFLAGS+= -include ${.CURDIR}/luaconf.h
>> +
>> +CPPFLAGS+= -I${S}/../external/mit/lua/dist/src
>>
>> .include <bsd.kmodule.mk>
>
> This works for the sys/modules/lua, thank you. However, whith this
> patch applied it stops at the next module, luacore:
>
> dependall ===> sys/modules/luacore
> # compile luacore/luacore_tramp.o
> /usr/tools/bin/arm--netbsdelf-gcc -I/usr/src/common/include
> --sysroot=/usr/distrib/evbarm
> -I/usr/src/sys/../external/mit/lua/dist/src -I/usr/src/sys/modules/lua
> -I/usr/src/common/include -nostdinc -I. -I/usr/src/sys/modules/luacore
> -isystem /usr/src/sys -isystem /usr/src/sys/arch -isystem
> /usr/src/sys/../common/include -D_KERNEL -D_LKM -D_MODULE
> -DSYSCTL_INCLUDE_DESCR -x assembler-with-cpp -c luacore_tramp.S
> luacore_tramp.S: Assembler messages:
> luacore_tramp.S:2: Error: bad instruction `kmodtrampoline(lua_mod_register)'
> luacore_tramp.S:3: Error: bad instruction
> `kmodtrampoline(lua_mod_unregister)'
> luacore_tramp.S:4: Error: bad instruction `kmodtrampoline(memcpy)'
>
> etc.
>
> What's this "trampoline" stuff?
With that patch my builds complete. Maybe you need to try a clean build? The
KMODTROMPOLINE() thing is supposed to be expanded from the macro definition in
<machine/asm.h>.
# compile luacore/luacore_tramp.o
/build/beagle/obj/tooldir.NetBSD-6.99.25-amd64/bin/armv7--netbsdelf-eabihf-gcc
-I/usr/src/common/include --sysroot=/build/beagle/obj/destdir.evbarm
-I/usr/src/sys/../external/mit/lua/dist/src -I/usr/src/sys/modules/lua
-I/usr/src/common/include -nostdinc -I. -I/usr/src/sys/modules/luacore
-isystem /usr/src/sys -isystem /usr/src/sys/arch -isystem
/usr/src/sys/../common/include -D_KERNEL -D_LKM -D_MODULE
-DSYSCTL_INCLUDE_DESCR -x assembler-with-cpp -c luacore_tramp.S
As I understand it (and it is a bit dangerous to believe me) this works around
some difficulty with external symbol resolution in a loadable module on arm by
renaming the external function symbols from X to __wrap_X and then defining a
__wrap_X stub which jumps to the real X, for each X. The generated assembly
file with the stubs is really simple but depends on the C preprocessor, so
if you keep CPPFLAGS clear of anything inappropriate it should work.
Dennis Ferguson
Home |
Main Index |
Thread Index |
Old Index