Age | Commit message (Collapse) | Author |
|
|
|
Since python source base has its own copy of libffi, it fixes the issue
here. Note similar fix is committed into separate libffi library.
cffi code creates trampoline for python callback function, which is
supposed to be called from another C function and it does not take into
account that in ARMv7a in big endian mode instructions are still in
little endian. Since written by big endian code they have to be
byteswapped. Proposed fix uses byteswap codes for instructions.
Here is python code snippet that will fail when libffi is used by
ctypes in python code (func1 and func2 are C functions):
from ctypes import *
mylib = CDLL("libmytest.so")
func1 = mylib.func1
print func1(1, 2)
CBFUNC = CFUNCTYPE(c_int, c_int, c_int)
def myfunc2(a, b):
return a * a + b * b
cb_func = CBFUNC(myfunc2)
func2 = mylib.func2
print func2(cb_func, 1, 2)
code will produce illegal instruction when func2 will call myfunc2
through trampoline
Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
|
|
cffi code creates trampoline for python callback function, which is
supposed to be called from another C function and it does not take into
account that in ARMv7a in big endian mode instructions are still in
little endian. Since written by big endian code they have to be
byteswapped. Proposed fix uses byteswap codes for instructions.
Here is python code snippet that will fail when libffi is used by
ctypes in python code (func1 and func2 are C functions):
from ctypes import *
mylib = CDLL("libmytest.so")
func1 = mylib.func1
print func1(1, 2)
CBFUNC = CFUNCTYPE(c_int, c_int, c_int)
def myfunc2(a, b):
return a * a + b * b
cb_func = CBFUNC(myfunc2)
func2 = mylib.func2
print func2(cb_func, 1, 2)
code will produce illegal instruction when func2 will call myfunc2
through trampoline
Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
|
|
on ARM V7 operating in big endian mode strace does not work:
root@genericarmv7ab:~# strace ls
pid 1356 unknown syscall trap 0x000000ef
it happens because ARM V7 when runs as big endian operates in be8 mode,
where instruction are still in little endian form. Strace get_scno reads
instructions and matches it to certain pattern, but in armeb case it needs
to byteswap it before that.
Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
|
|
dds the same patches into SRC_URI_append_armeb as
SRC_URI_append_arm does.
Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
|
|
Adds the same patches into SRC_URI_append_armeb as
SRC_URI_append_arm does.
Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
|
|
Create meta-linaro/meta-bigendian meta layer that holds oe changes
to build ARM big endian images
Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
|