[OE-core] Building python modules using the SDK emit errors

2017-09-28 Thread Gerson Fernando Budke
Hello guys,

I've been facing problems with python and I need some help. My current
branch is morty but I think this could affect others too.
At firstly, it works perfecly and run OK when using bitbake (even using
with distutils in setup.py - see below) but when tring build using SDK I
get this:

inet@ubuntu:~/workspace/upstream/router-ibd$ python setup.py build
running build
running build_py
package init file 'python-ibd/__init__.py' not found (or not a regular file)
package init file 'python-ibd/__init__.py' not found (or not a regular file)
running build_ext
building 'pyibd' extension
powerpc-iep-linux-gnuspe-gcc -m32 -mcpu=8548 -mabi=spe -mspe
-mfloat-gprs=double
--sysroot=/opt/iep/16.2/sysroots/ppce500v2-iep-linux-gnuspe -DNDEBUG -g -O3
-Wall -Wstrict-prototypes -O -fno-omit-frame-pointer -g
-feliminate-unused-debug-types -pipe -fPIC -DMAJOR_VERSION=1
-DMINOR_VERSION=0 -I./include
-I/opt/iep/16.2/sysroots/x86_64-iepsdk-linux/usr/include/python2.7 -c
python-ibd/ibdmodule.c -o build/temp.linux-x86_64-2.7/python-ibd/ibdmodule.o
In file included from
/opt/iep/16.2/sysroots/x86_64-iepsdk-linux/usr/include/python2.7/Python.h:8:0,
 from python-ibd/ibdmodule.c:11:
/opt/iep/16.2/sysroots/x86_64-iepsdk-linux/usr/include/python2.7/pyconfig.h:1193:0:
warning: "_POSIX_C_SOURCE" redefined
 #define _POSIX_C_SOURCE 200112L

In file included from
/opt/iep/16.2/sysroots/ppce500v2-iep-linux-gnuspe/usr/include/stdint.h:25:0,
 from
/opt/iep/16.2/sysroots/x86_64-iepsdk-linux/usr/lib/powerpc-iep-linux/gcc/powerpc-iep-linux/6.2.0/include/stdint.h:9,
 from ./include/ibd.h:12,
 from python-ibd/ibdmodule.c:9:
/opt/iep/16.2/sysroots/ppce500v2-iep-linux-gnuspe/usr/include/features.h:225:0:
note: this is the location of the previous definition
 # define _POSIX_C_SOURCE 200809L

x86_64-iepsdk-linux-gcc -shared -Wl,-O1 -Wl,-O1 -Wl,--hash-style=gnu
-Wl,--as-needed -O -fno-omit-frame-pointer -g
-feliminate-unused-debug-types -pipe
build/temp.linux-x86_64-2.7/python-ibd/ibdmodule.o
-L/opt/iep/16.2/sysroots/x86_64-iepsdk-linux/usr/lib -lrouter-ibd
-lpython2.7 -o build/lib.linux-x86_64-2.7/pyibd.so
/usr/bin/ld: build/temp.linux-x86_64-2.7/python-ibd/ibdmodule.o:
Relocations in generic ELF (EM: 20)
/usr/bin/ld: build/temp.linux-x86_64-2.7/python-ibd/ibdmodule.o:
Relocations in generic ELF (EM: 20)
/usr/bin/ld: build/temp.linux-x86_64-2.7/python-ibd/ibdmodule.o:
Relocations in generic ELF (EM: 20)
/usr/bin/ld: build/temp.linux-x86_64-2.7/python-ibd/ibdmodule.o:
Relocations in generic ELF (EM: 20)
/usr/bin/ld: build/temp.linux-x86_64-2.7/python-ibd/ibdmodule.o:
Relocations in generic ELF (EM: 20)
/usr/bin/ld: build/temp.linux-x86_64-2.7/python-ibd/ibdmodule.o:
Relocations in generic ELF (EM: 20)
/usr/bin/ld: build/temp.linux-x86_64-2.7/python-ibd/ibdmodule.o:
Relocations in generic ELF (EM: 20)
build/temp.linux-x86_64-2.7/python-ibd/ibdmodule.o: error adding symbols:
File in wrong format
collect2: error: ld returned 1 exit status
error: command 'x86_64-iepsdk-linux-gcc' failed with exit status 1

The resulting build tree from SDK (distutils/setuptools) and bitbake
(distutils) is:
.
├── build
│   ├── lib.linux-x86_64-2.7
│   └── temp.linux-x86_64-2.7
│   └── python-ibd
│   └── ibdmodule.o

I can see a build problem here since the platform is ppc. If I change from
distutils to setuptools in setup.py I get the same.
I've seen this been generated by bitbake using distutils in setup.py too
but works on the board, I don't known why.
If I change from distutils to setuptools in setup.py and run bitbake the
system looks correctly.

bitbake (setuptools)
├── deploy-ipks
│   └── ppce500v2
│   ├── python-ibd-dbg_git-r0.5_ppce500v2.ipk
│   ├── python-ibd-dev_git-r0.5_ppce500v2.ipk
│   └── python-ibd_git-r0.5_ppce500v2.ipk

To get that wrong result using the SDK was needed add as follow, otherwise
the Python.h include error appears:

nativesdk-packagegroup-sdk-host.bbappend

+RDEPENDS_${PN} += " \
+nativesdk-gcc \
+\
+nativesdk-python-dev \
+nativesdk-python-setuptools \
+"

There seems to be missing some cross compile patch. Does anyone have any
ideas?
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [morty][PATCH] image.bbclass: Sorted ctypes to avoid basehash error

2017-09-22 Thread Gerson Fernando Budke
When selected multiple subimages a similar error could happend:
  Variable do_image_cpio[subimages] value changed \
from 'cpio.gz.u-boot cpio.gz' to 'cpio.gz cpio.gz.u-boot'
To avoid this, 'ctypes' should be sorted at 'gen_conversion_cmds'.

This garantee that 'CONVERSION_CMD_xxx' are always written in tha same
order and consequently 'do_image_cpio' have the same hash.

(From OE-Core rev: 271f1a5f65b8685a1e3645026876251122ef3974)

Signed-off-by: Gerson Fernando Budke <nando...@gmail.com>
Signed-off-by: Ross Burton <ross.bur...@intel.com>
Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org>
---
 meta/classes/image.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index ef2b38aeaf..9c9f14a99a 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -453,7 +453,7 @@ python () {

 rm_tmp_images = set()
 def gen_conversion_cmds(bt):
-for ctype in ctypes:
+for ctype in sorted(ctypes):
 if bt.endswith("." + ctype):
 type = bt[0:-len(ctype) - 1]
 if type.startswith("debugfs_"):
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] File with a Windows line ending

2017-09-20 Thread Gerson Fernando Budke
I don't know if is important but I'm reporting anyway

remote: error: found carriage return (CR) character in file:
meta/recipes-core/ovmf/ovmf/0004-ovmf-enable-long-path-file.patch
To ssh://gerrit.intelbras.com.br/yocto/openembedded/openembedded-core
 ! [remote rejected] master -> master (contains files with a Windows line
ending)
error: failed to push some refs to 'ssh://
gerrit.intelbras.com.br/yocto/openembedded/openembedded-core'
fatal: remote error: access denied or repository not exported:
/openembedded-core

Gerrit version:
Powered by Gerrit Code Review (2.14.2)
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] image.bbclass: Sorted ctypes to avoid basehash error

2017-09-19 Thread Gerson Fernando Budke
When selected multiple subimages a similar error could happend:
  Variable do_image_cpio[subimages] value changed \
from 'cpio.gz.u-boot cpio.gz' to 'cpio.gz cpio.gz.u-boot'
To avoid this, 'ctypes' should be sorted at 'gen_conversion_cmds'.

This garantee that 'CONVERSION_CMD_xxx' are always written in tha same
order and consequently 'do_image_cpio' have the same hash.

Signed-off-by: Gerson Fernando Budke <nando...@gmail.com>
---
 meta/classes/image.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 3639aa4..bef634b 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -452,7 +452,7 @@ python () {
 
 rm_tmp_images = set()
 def gen_conversion_cmds(bt):
-for ctype in ctypes:
+for ctype in sorted(ctypes):
 if bt.endswith("." + ctype):
 type = bt[0:-len(ctype) - 1]
 if type.startswith("debugfs_"):
-- 
2.7.4

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core