[Interest] 32bits builds on 64bits Linux platform

Jean-Michaël Celerier jeanmichael.celerier at gmail.com
Sun Aug 27 10:44:43 CEST 2017


> eg, issue with hard-coded path to binaries, ...

A good solution for this (on linux!) is to ship your app as :

app/myApp
app/myApp.sh
app/libs/libQt5Whatever.so ...

and in myApp.sh have

#!/bin/sh
LD_LIBRARY_PATH="$(dirname $0)/libs" ./myApp

This way you don't have any doubt on whether your app will run: it will
always look for the libs there first. The more "common" stuff you put in
the "libs" folder, the more linux distros it will run in (up to libc and
libstdc++ if you really want to be on the safe side; eg build on ubuntu
17.04 and run on centos 6).


Best,
-------
Jean-Michaël Celerier
http://www.jcelerier.name

On Sun, Aug 27, 2017 at 3:02 AM, Christian Gagneraud <chgans at gmail.com>
wrote:

> On 27 August 2017 at 01:06, Jean-Michaël Celerier
> <jeanmichael.celerier at gmail.com> wrote:
> > I'd say that the simplest is to spin up a 32-bit docker image
> corresponding
> > to your OS and do the build on it.
>
> I didn't consider docker, but i did consider a 32 bits chroot and a 32
> bits VM.
> The reason i didn't go this way is that i was afraid that I might
> build Qt successfully on such a setup, but the resulting binaries
> might not run on a 32/64 bits environment. eg, issue with hard-coded
> path to binaries, ...
>
> I don't know if might concerns are right thought.
>
> My rational for choosing to build a 32 bits Qt on the 64bits machine
> was that if i can successfully build Qt and successfully run its test
> suites, then there would be no reason why my 32 bits apps would fail
> to build/run (if i ignore extra dependencies)...
>
> Chris
>
> >
> >
> >
> > -------
> > Jean-Michaël Celerier
> > http://www.jcelerier.name
> >
> > On Sat, Aug 26, 2017 at 10:03 AM, Christian Gagneraud <chgans at gmail.com>
> > wrote:
> >>
> >> On 26 August 2017 at 14:27, Oliver Niebuhr
> >> <googleersatz at oliverniebuhr.de> wrote:
> >> > Am 26.08.2017 um 03:26 schrieb Christian Gagneraud:
> >> >> Hi there,
> >> >>
> >> >> I have an application that requires a 32 bits version of Qt-5.6 and
> >> >> fixing the 32 vs 64 bits issues of this app is not option at this
> >> >> stage.
> >> >>
> >> >> So I need to build Qt-6.6 in 32 bits mode on a 64 bits Linux
> platfrom,
> >> >> and then i need to build and run my 32 bits app on the same 64 bits
> >> >> Linux platform against this 32 bits Qt-5.6.
> >> >>
> >> >> Is it possible to to build 32 bits Qt on 64 bits platform? Has anyone
> >> >> manage to do that? Any advice, tips or tricks to share?
> >> >>
> >> >> Thanks in advance,
> >> >> Chris
> >> >> _______________________________________________
> >> >> Interest mailing list
> >> >> Interest at qt-project.org
> >> >> http://lists.qt-project.org/mailman/listinfo/interest
> >> >>
> >> >
> >> > Good Morning.
> >>
> >> Good evening,
> >>
> >> > Yes it is possible. To build 32-Bit Binaries and Libs on a 64-Bit OS,
> >> > you must install the "Multilib" Version of the Compiler and the used
> >> > Dev-Packages. So in example for the GCC Compiler (G++): Remove the
> "GCC"
> >> > Package and replace it with "GCC-Multilib" (at least this is the Name
> >> > under Antergos Linux (Arch based). Not sure about other Distros. My
> main
> >> > OS is still Windows so I am still kind-a noob when it comes to Linux
> >> > Development :)
> >> >
> >> > Some 32-Bit Libraries (or Package Names to be more precise) are named
> >> > like "lib32-example1". Others like "example2-multilib". Depending on
> the
> >> > Library itself and your Distribution.
> >> >
> >> > You propably need to activate the Multilib Repository for your
> >> > Distribution first, if you dont have any 32-Bit Stuff installed yet.
> >> >
> >> > Qt Configure Parameter for the GCC / G++ Compiler:
> >> > The important Configure Parameter for you (so that Qt tells the
> >> > Compiler to build 32-Bit Binaries etc.) is:
> >> > "/your/qt56/sourcefolder/configure -platform linux-g++-32"
> >> >
> >> > No Idea about other Distros or Compiler like LLVM/Clang.
> >>
> >> Thanks for sharing, i'm running Ubuntu, so it's a bit different. But
> >> yes, one need the multilib stuff and then intall the Qt dependencies
> >> in 32 mode....
> >>
> >> Chris
> >>
> >> >
> >> > Good Luck :)
> >> >
> >> > Greetings
> >> > Oliver
> >> > _______________________________________________
> >> > Interest mailing list
> >> > Interest at qt-project.org
> >> > http://lists.qt-project.org/mailman/listinfo/interest
> >> _______________________________________________
> >> Interest mailing list
> >> Interest at qt-project.org
> >> http://lists.qt-project.org/mailman/listinfo/interest
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170827/3970f878/attachment.html>


More information about the Interest mailing list