Weird Qt cross compiling issue

211 views
Skip to first unread message

srg...@googlemail.com

unread,
Oct 5, 2013, 6:12:41 PM10/5/13
to beagl...@googlegroups.com
Hi

I recently bought a Beaglebone Black, with the LCD4 cape as I want to start learning about ARM development and embedded linux.

The board has worked for be flawlessly and I easily now have the board with Qt4-embedded running on the built in Angstrom distro. The videos by Derek Molloy were very helpfull, though they seem a bit out of date now.

Anyway over the last several weeks of weekends and some weekday nights, what has been causing me pain is trying to setup an anstrom sdk and cross-compiling toolchain, but I'm almost there, I just have a weird Qt linking issue.

As a background, I'm doing this all on a Debian Virtual machine because the Angstrom 2012.12 setup doesn't work in my normal Fedora 19 (relies of some deprecated functionality that was removed in one program in F19).

To setup my tool chain I did these commands:

mkdir angstrom_beaglebone
cd angstrom_beaglebone
cd setup-scripts
MACHINE=beaglebone ./oebb.sh config beaglebone MACHINE=beaglebone ./oebb.sh update MACHINE=beaglebone ./oebb.sh bitbake virtual/kernel
MACHINE=beaglebone ./oebb.sh bitbake systemd-image
MACHINE=beaglebone ./oebb.sh bitbake meta-toolchain

Then I found out about meta-toolchain-qte, so I then ran:

MACHINE=beaglebone ./oebb.sh bitbake meta-toolchain-qte

Then I installed the SDK:

cd ~/angstrom_beaglebone/setup-scripts/build/tmp-angstrom_v2012_12-eglibc/deploy/sdk

Installed into default place, but had some permissions issues so in
/usr/local
ran:
sudo chmod -R 777 oecore.i686

finally I've added this into my .bashrc:

source /usr/local/oecore-i686/environment-setup-armv7a-vfp-neon-angstrom-linux-gnueabi

Now for the test project, which is based on Derek's video though slightly tweaked.

I've installed the Qt5.1.1 SDK and am using the QtCreator 2.8.1 from that, though using the 4.8.1 that comes with the sdk.
 Here's my .pro file:

#-------------------------------------------------
#
# Project created by QtCreator 2013-10-05T14:41:31
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = qttest
TEMPLATE = app
    target.files = qttest
    target.path = /home/root
INSTALLS += target

SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

QMAKE_CXXFLAGS +=  -Wno-psabi

I've set the kit to use the adk's GCC and the sdk's qmake2 file.

Now, release build works great. I have it setup for deploying onto the BBB and that works fine. The release build qmake's, compiles, links, deploys and runs great on the BBB.

I'm having trouble with debug mode, qmake2 runs fine, and it compiles, but I get this issue when I think it tries to link:

arm-angstrom-linux-gnueabi-g++ -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-rpath-link,/usr/local/oecore-i686/sysroots/armv7a-vfp-neon-angstrom-linux-gnueabi//usr/lib -o qttest main.o mainwindow.o moc_mainwindow.o    -L/usr/local/oecore-i686/sysroots/armv7a-vfp-neon-angstrom-linux-gnueabi//usr/lib -lQtGuiE -lQtNetworkE -lQtCoreE -lpthread 
{ test -n "" && DESTDIR="" || DESTDIR=.; } && test $(gdb --version | sed -e 's,[^0-9]\+\([0-9]\)\.\([0-9]\).*,\1\2,;q') -gt 72 && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $DESTDIR" -ex quit 'qttest' && test -f qttest.gdb-index && objcopy --add-section '.gdb_index=qttest.gdb-index' --set-section-flags '.gdb_index=readonly' 'qttest' 'qttest' && rm -f qttest.gdb-index || true
Traceback (most recent call last):
  File "/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/lib/python2.7/site.py", line 569, in <module>
    main()
  File "/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/lib/python2.7/site.py", line 551, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/lib/python2.7/site.py", line 278, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/lib/python2.7/site.py", line 253, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/lib/python2.7/site.py", line 242, in getuserbase
    from sysconfig import get_config_var
  File "/usr/local/oecore-i686/sysroots/i686-angstromsdk-linux/usr/lib/python2.7/sysconfig.py", line 10, in <module>
    'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
AttributeError: 'module' object has no attribute 'lib'
/bin/sh: line 0: test: -gt: unary operator expected

After weeks trying to get this all working and I feel I'm almost there, I'm kinda stuck, any ideas as to what I'm doing wrong?

Thanks!
srg

deu...@gmail.com

unread,
Nov 4, 2013, 8:32:05 AM11/4/13
to beagl...@googlegroups.com
Hello,

I have a similar problem.

bitbake meta-toolchain
source ...
hg or any python script give the following error :
    'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
AttributeError: 'module' object has no attribute 'lib'

Did you find out how to fix it ?

Best regards,
Richard

Maxim Podbereznyy

unread,
Nov 4, 2013, 10:26:09 AM11/4/13
to beagleboard


2013/11/4 <deu...@gmail.com>

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

Richard Buchmann

unread,
Nov 4, 2013, 10:31:48 AM11/4/13
to beagl...@googlegroups.com
Thank you.


2013/11/4 Maxim Podbereznyy <lisa...@gmail.com>
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/ZqFu2YJRqjE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages