Bug 7680 - Python3 modules not build
Summary: Python3 modules not build
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 1.8
Hardware: x86 arm
: Medium normal
Target Milestone: 1.9 M1
Assignee: Robert Yang
QA Contact: Bogdan Alexandru Voiculescu
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-04-30 12:01 UTC by condo4
Modified: 2015-09-07 13:05 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description condo4 2015-04-30 12:01:55 UTC
Since I switch to fido branch, python3-elementtree and python3-fcntl packages are not generated by python3 recipe...

When I try to understand why, I can see that packages-split/python3-elementtree  and packages-split/python3-fcntl are empty...

If I revert patch b2f8367dff8a2db49b9296bd27a2e94a3619884d (python3: fix for cross compiling), all this modules build and works fine...
Comment 1 Paul Eggleton 2015-04-30 12:47:12 UTC
Robert, could you take a look at this?
Comment 2 Robert Yang 2015-05-04 07:56:17 UTC
I tried on fido and master branch, both of them are OK, so mark it as need info:

$ rpm -qpl tmp/deploy/rpm/i586/python3-elementtree-3.3.3-r1.0.i586.rpm
/usr
/usr/lib
/usr/lib/python3.3
/usr/lib/python3.3/lib-dynload
/usr/lib/python3.3/lib-dynload/_elementtree.cpython-33m.so

$ rpm -qpl tmp/deploy/rpm/i586/python3-fcntl-3.3.3-r1.0.i586.rpm
/usr
/usr/lib
/usr/lib/python3.3
/usr/lib/python3.3/lib-dynload
/usr/lib/python3.3/lib-dynload/fcntl.cpython-33m.so
Comment 3 condo4 2015-05-04 09:03:20 UTC
I build for armv7a_vfp_neon architecture... I don't know if it can change somethings...

In my case, 

ls -l tmp/work/armv7a-vfp-neon-jdsu-linux-gnueabi/python3/3.3.3-r1.0/packages-split/python3-elementtree/
total 0

ls -l tmp/work/armv7a-vfp-neon-jdsu-linux-gnueabi/python3/3.3.3-r1.0/packages-split/python3-fcntl/
total 0

Since this folders are empty, there is no RPM generate, so, in  tmp/deploy/rpm/armv7a_vfp_neon there is no python3-fcntl*.rpm

In fact, "find tmp/work/armv7a-vfp-neon-jdsu-linux-gnueabi/python3/3.3.3-r1.0/build/ -name "*cpython-33m*"" 
return nothing, so, all native lib are missings...

In the do_configure, I can find:

/home/foo/Yocto/fido/build/target/tmp/sysroots/x86_64-linux/usr/libexec/arm-bar-linux-gnueabi/gcc/arm-bar-linux-gnueabi/4.9.2/ld: build/temp.linux-arm-3.3/home/foo/Yocto/fido/build/mts1000/tmp/work/armv7a-vfp-neon-bar-linux-gnueabi/python3/3.3.3-r1.0/Python-3.3.3/Modules/_struct.o: relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
build/temp.linux-arm-3.3/home/foo/Yocto/fido/build/mts1000/tmp/work/armv7a-vfp-neon-bar-linux-gnueabi/python3/3.3.3-r1.0/Python-3.3.3/Modules/_struct.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
building '_ctypes_test' extension
Comment 4 condo4 2015-05-04 09:08:40 UTC
oops, I would say, in the do_compile...
Comment 5 condo4 2015-05-04 09:13:18 UTC

arm-my-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=softfp -mfpu=neon -DNDEBUG -fno-inline -D__SOFTFP__ --sysroot=/home/foo/Yocto/fido/build/bar/tmp/sysroots/bar -O2 -pipe -g -feliminate-unused-debug-types -I/home/foo/Yocto/fido/build/bar/tmp/work/armv7a-vfp-neon-my-linux-gnueabi/python3/3.3.3-r1.0/Python-3.3.3/Include -I/home/foo/Yocto/fido/build/bar/tmp/work/armv7a-vfp-neon-my-linux-gnueabi/python3/3.3.3-r1.0/build -c /home/foo/Yocto/fido/build/bar/tmp/work/armv7a-vfp-neon-my-linux-gnueabi/python3/3.3.3-r1.0/Python-3.3.3/Modules/_struct.c -o build/temp.linux-arm-3.3/home/foo/Yocto/fido/build/bar/tmp/work/armv7a-vfp-neon-my-linux-gnueabi/python3/3.3.3-r1.0/Python-3.3.3/Modules/_struct.o

I think the problem is -fPIC was missing...
With dizzy, I added a bbappend with
SRC_URI_remove = "file://python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch"
To fix the same problem...

In this case (this is working), I have following logs (with -fPIC):


arm-my-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -DNDEBUG -fno-inline -D__SOFTFP__ --sysroot=/home/foo/Yocto/dizzy/build/bar/tmp/sysroots/bar -fPIC -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -O2 -pipe -g -feliminate-unused-debug-types -O2 -pipe -g -feliminate-unused-debug-types -I./Include -I. -IInclude -I/home/foo/Yocto/dizzy/build/bar/tmp/work/armv7a-vfp-neon-my-linux-gnueabi/python3/3.3.3-r0.0/Python-3.3.3/Include -I/home/foo/Yocto/dizzy/build/bar/tmp/work/armv7a-vfp-neon-my-linux-gnueabi/python3/3.3.3-r0.0/Python-3.3.3 -c /home/foo/Yocto/dizzy/build/bar/tmp/work/armv7a-vfp-neon-my-linux-gnueabi/python3/3.3.3-r0.0/Python-3.3.3/Modules/_struct.c -o build/temp.linux-arm-3.3/home/foo/Yocto/dizzy/build/bar/tmp/work/armv7a-vfp-neon-my-linux-gnueabi/python3/3.3.3-r0.0/Python-3.3.3/Modules/_struct.o
Comment 6 Robert Yang 2015-05-05 06:18:26 UTC
Hi, I tried MACHINE=qemuarm which is armv5e, it also works well for me, where can I get your MACHINE's layer, please ?
Comment 7 condo4 2015-05-05 08:26:37 UTC
(In reply to comment #6)


In my <machine>.conf I have:

require conf/machine/include/tune-zynq.inc
IMAGE_FSTYPES ?= "cpio tar.gz"
IMAGE_CLASSES += "image_types_uboot"
KERNEL_IMAGETYPE = "uImage.fit"
KERNEL_ITB_BASE_NAME="zynq-nymphea"
MACHINE_FEATURES += " mtp zynq qt5 "
QEMU_TARGETS = "arm"

I have many other option, but it is own configurations or kernel specific options...

In any case, the board use a Xilinx Zynq from layer https://github.com/Xilinx/meta-xilinx from branch dizzy (I will update to fido, but there is only 1 change... I try to apply it in my conf (9b386bc9f7710643cc76672e5f1d21f909b51500)
Comment 8 Peter Bergin 2015-05-17 21:48:17 UTC
I can also confirm this bug. I am building for i.Mx6 with the Freescale community BSP. 


petber@petber-linux-laptop:/work/yocto/fido/qep$ ls -la tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/python3/3.3.3-r1.0/packages-split/python3-elementtree/
total 8
drwxr-xr-x  2 petber petber 4096 May 13 16:08 .
drwxr-xr-x 72 petber petber 4096 May 13 16:08 ..

petber@petber-linux-laptop:/work/yocto/fido/qep$ ls -la tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/python3/3.3.3-r1.0/packages-split/python3-fcntl/
total 8
drwxr-xr-x  2 petber petber 4096 May 13 16:08 .
drwxr-xr-x 72 petber petber 4096 May 13 16:08 ..


When my image is baked I get this error:

error: Can't install python3-subprocess-3.3.3-r1.0.0@cortexa9hf_vfp_neon: no package provides python3-fcntl


Could you try to reproduce with this BSP if you not have succeeded with the Zync? (https://github.com/Freescale/fsl-community-bsp-platform)
Comment 9 Stephen K Jolley 2015-05-18 19:26:40 UTC
Robert,

It appears your questions have been answered.  Please reword the question if you need additional information.  I am moving this to New.
Comment 11 Bogdan Alexandru Voiculescu 2015-09-07 13:05:27 UTC
verified on poky c80b582212336044c55052ad0d39f9da06d71438
using https://github.com/Freescale/fsl-community-bsp-platform and building manually python3 recipe after a core-image-sato.
./python3-fcntl/usr/lib/python3.3/lib-dynload/fcntl.cpython-33m.so
./python3-elementtree/usr/lib/python3.3/lib-dynload/_elementtree.cpython-33m.so