[Qt-creator] Linux 32 bits build on x86_64 host

Christian Gagneraud chgans at gmail.com
Sat Sep 9 02:07:24 CEST 2017


[cross-posted qbs + qt-creator]


Hi there,

I'm using a 64bits Linux host and I have installed the "official"
Qt-5.5-linux-32.

I have then setup QtCreator:

Qt Version:
Name: Qt 5.5.1 (gcc-32)
ABI: x86-linux-generic-elf-32bit
Source: /opt/Qt32/5.5/gcc
mkspec: linux-g++-32
qmake: /opt/Qt32/5.5/gcc/bin/qmake
Version: 5.5.1
QMAKE_SPEC linux-g++-32
QMAKE_VERSION 3.0
QMAKE_XSPEC linux-g++-32

Kit:
Qt Version: Qt 5.5.1 (gcc-32)
C Compiler: GCC (C, x86 32 bit in /usr/bin)
C++ Compiler: GCC (x86 32 bit in /usr/bin)

My Qt version is really 32 bits:
$ file /opt/Qt32/5.5/gcc/lib/libQt5Sql.so.5.5.1
/opt/Qt32/5.5/gcc/lib/libQt5Sql.so.5.5.1: ELF 32-bit LSB shared
object, Intel 80386, version 1 (SYSV), dynamically linked,
BuildID[sha1]=055df3fbcd976602a1ce4f1fcfcaae4151345cfa, stripped

My qbs project files are so far dead simple, I have static libraries
and some apps all have very basic content, eg:
import qbs

StaticLibrary {
    name: "Alarms"
    Depends { name: "cpp" }
    cpp.includePaths: [ ...]
    cpp.libraryPaths: [ ... ]
    cpp.defines: [ ...]
    Depends { ... }
    files: [ ...]
}

Absolutely nowhere I attempt to manipulate compiler flags in any way.

But when I build the project, qbs generate "/usr/bin/g++ -m64"
compiler commands.

Is this a bug in Qbs or QtCreator, or a problem in my setup?

Now if i create custom toolchains using /usr/bin/g++ and adding -m32
to the "platform code gen flags" (Qtc detects correctly that is is a
32 bits ABI) and associate these toochains with my Qt Kit, qbs
generate "/usr/bin/g++ -m64 -m32" compiler commands.

Any help appreciated.

Chris



More information about the Qt-creator mailing list