Qt 4.7 cross-compilation issues from source for ARM

I am trying to cross-compile Qt 4.7.1 from source, here are some notes about my setup:

  • My expected result is libraries of shared objects that must be present in order to run the Qt application.
  • My target platform is the TI AM335x processor, which has the ARM Cortex-A8 architecture.
  • My development platform is the 64-bit Ubuntu x86 virtual machine.

My understanding of how this should work is that I download the toolchain for my target platform (this is the Linaro toolchain from TI), I download the Qt 4.7.1 source code , I installed mkspec to use my tool chain, run configure, and then you just need to run make/ make install, and I would have to find everything .sowhere I said to install. I have a lot of problems getting this idea to work.


First I downloaded the TI SDK version: ti-sdk-am335x-evm-06.00.00.00, which is equipped with a tool: [root_install_dir]/linux-devkit/sysroots/i686-arago-linux/usr/bin

I updated mine $PATHusing this directory:

mike @ mike-VirtualBox: ~ $ echo $ PATH /home/mike/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin : / usr / local / Trolltech /Qt-4.8.5/bin:/Home/microphone/ben:/USR/Library/LightDM/LightDM: / USR / local / SBIN: / USR / local / bin: / USR / SBIN: / USR / bin: / SBIN: / bin: / USR / games: / Home / microphone / bin

Then I created my own mkspec based on the closest example: cp -R [qt_install_dir]/mkspecs/qws/linux-arm-gnueabi-g++/ [qt_install_dir]/mkspecs/qws/linux-am335x-g++

and I changed linux-am335x-g++/qmake.confto point to tools from TI sdk:

# modifications to g++.conf
QMAKE_CC                = arm-linux-gnueabihf-gcc
QMAKE_CXX               = arm-linux-gnueabihf-g++
QMAKE_LINK              = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = arm-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = arm-linux-gnueabihf-objcopy
QMAKE_STRIP             = arm-linux-gnueabihf-strip

Then I ran the configure command:

./configure -prefix / home / mike / qt4.7.1_source / my_qt -embedded arm -platform qws / linux-x86_64-g ++ -xplatform qws / linux-am335x-g ++ -no-mmx -no-3dnow -no -sse - no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -fast -opensource

, , make/make install. make , :

/home/mike/qt4.7.1_source/qt-everywhere-opensource-src-4.7.1/bin/moc -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DELF_INTERPRETER =\ "/lib64/--x86-64.so.2 \" -DHB_EXPORT = Q_CORE_EXPORT -DQT_HAVE_NEON -DQT_NO_DEBUG -I../../mkspecs/qws/linux-am335x-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared-emb-arm -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared-emb-arm kernel/qobject.h -o.moc/release-shared-emb-arm/moc_qobject.cpp arm-linux-gnueabihf-g++ - - .pch/release-shared-emb-arm/QtCore -pipe -fno-exceptions -mfpu = neon -O2 -fvisibility = hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DELF_INTERPRETER =\ "/lib64/--x86-64.so.2 \" -DHB_EXPORT = Q_CORE_EXPORT -DQT_HAVE_NEON -DQT_NO_DEBUG -I../../mkspecs/qws/linux-am335x-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared-emb-arm -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared-emb-arm -o.obj/release-shared-emb-arm/qobject.o kernel/qobject.cpp
{standard input}: :
{ }: 1294: : Thumb "swp r6, r4, [r3]"
[1]: [.obj/release-shared-emb-arm/qobject.o] 1 *
[1]:
'/home/mike/qt4.7.1_source/qt-everywhere-opensource-src-4.7.1/src/corelib'
make: * [sub-corelib-make_default-ordered] 2

, ... , ? - ARM, . , , make - g++.

, , ?

+4
2

{ }: 1294: : Thumb 'swp r6, r4, [r3]'

, ?

: , swp . , thumb2 ARM. Cortex swp ldrex/strex.

, , ?

gcc __ARM_ARCH_7__; -mcpu=cortex-a8, -mtune=cortex-a8 -march=armv7-a , , Qt.

. qatomic_arm.h . ARM ( ), qatomic_armv5.h 1 125. - qatomic_armv7.h, qatomic_armv6.h. ldrex/strex, , gcc.

-fast. , OP , ; , .

-armfpa . ./configure -embedded arm --help . configure, , NEON, , , CPU ( NEON armv5, configure).

, , swp ldrex/strex , swp - . . -xplatform qws/linux-am335x-g++, -mcpu , , -D__ARM_ARCH_7__. arm-gcc -mcpu=cortex-a8 -dM -E - < /dev/null, , __ARM_ARCH_7__. , moc , -D__ARM_ARCH_7_.

-mthumb . , -mcpu=cortex-a8 -mthumb , /. -mthumb . -Os. - gcc. -, ++, "C" ; . , , . , , Qt .

1: qatomic_armv5.h , gcc binutils , .

 asm volatile("swpb %0,%2,[%3]"
: "=&r"(ret), "=m" (*ptr)
: "r"(newval), "r"(ptr)
: "cc", "memory");

, . , ..

asm volatile("swpb %0,%1,[%2]"
             : "=r"(ret)
             : "0"(newval), "r"(ptr)
             : "memory");

gcc binutils. Qt ; , ret newval, .

[x] swp. , %0 , %3. , %0 %1 , %2 .

+2

usr: , , ( ) , , :

-, .configure, :

./configure -prefix /home/mike/qt4.7.1_source/my_qt -embedded arm -platform qws/linux-x86_64-g++ -xplatform qws/linux-am335x-g++ -no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -opensource -qt-mouse-tslib

configure - -fast.

linux-am335x-g++/qmake.conf :

QMAKE_CFLAGS= -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8
QMAKE_CXXFLAGS= -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8

, Qt4.7.1.

Qt4.8.5, , . /configure:

-no-pch

, :.pch , " "

+1

All Articles