Hello!

I've been trying to build a python package which has a component
written in c that is used through cython.

But when I try to build in the SDK I first got:

#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."

I figured it had to do with
"-I/home/einar/tmp/sdk/poky/3.0.2/sysroots/x86_64-pokysdk-linux/usr/lib/python3.7/site-packages/numpy/core/include"
since that points to my native sysroot instead of the target sysroot.

So I added:

numpy_incdir = numpy.get_include()
python_incdir = '.' # Just some harmeless directory
try:
    native = os.environ['OECORE_NATIVE_SYSROOT']
    target = os.environ['OECORE_TARGET_SYSROOT']
except KeyError:
    pass
else:
    rel_path = Path(numpy_incdir).relative_to(native)
    numpy_incdir = target / rel_path
    python_incdir = target + '/usr/include/python3.7m/'

to my setup.py and got passed the first compiler error.

So now my extension module is built ok but after that there is a step
that fails:

creating build/lib.linux-x86_64-3.7
x86_64-pokysdk-linux-gcc -shared -Wl,-O1 -L -Wl,-O1 -Wl,-O1
-Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong
-Wl,-z,relro,-z,now -O2 -pipe -g -feliminate-unused-debug-types
build/temp.linux-x86_64-3.7/myext.o
build/temp.linux-x86_64-3.7/extlib.o
build/temp.linux-x86_64-3.7/myextmodule.o
-L/home/einar/tmp/poky/3.0.2/sysroots/x86_64-pokysdk-linux/usr/lib
-lpython3.7m -o
build/lib.linux-x86_64-3.7/bbfit.cpython-37m-x86_64-linux-gnu.so -lm
unable to execute 'x86_64-pokysdk-linux-gcc': No such file or directory
error: command 'x86_64-pokysdk-linux-gcc' failed with exit status 1

And I can't get passed this error and I think it's weird that it's
trying to use x86_64-pokysdk-linux-gcc since my extension module is
built with

CC=arm-poky-linux-gnueabi-gcc  -mthumb -mfpu=neon-vfpv4
-mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security
--sysroot=/home/einar/tmp/poky/3.0.2/sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi

Should building a cython extension in the SDK work? Any ideas why ming
won't compile. Or why it's trying to use a compiler for host instead
of target in the end?

Best regards,
Einar
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#49321): https://lists.yoctoproject.org/g/yocto/message/49321
Mute This Topic: https://lists.yoctoproject.org/mt/73974417/21656
Group Owner: [email protected]
Unsubscribe: 
https://lists.yoctoproject.org/g/yocto/leave/6691583/737036229/xyzzy  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to