|
|
Home » Developing U++ » U++ Developers corner » Building 32 bit apps on Ubuntu64
Building 32 bit apps on Ubuntu64 [message #29152] |
Thu, 07 October 2010 18:24 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
As it costed me some effort to find it out how to do it, I'll post the results here, just in case somebody needs it
1) Create a new build method, naming it, for example, GCC32
2) Copy ALL settings from GCC build method to the newly created one (ALL, including include directories, flags, etc).
You can omit the LIB directories point, see later
3) Install IA32-LIBS package, it's available on repo. You'll still miss some libs... in particular this damn'd libnotify which costed me some effort.
4) Using getlibs command (install it from repo), install libnotify 32 bit library. You may need also libdbus-1 and libdbus-glib-1, I don't remember if I had them already installed or they were in IA32-LIBS repo. If you still get linker error after last point, just install them with getlibs.
5) in GCC32 build method, Add the following :
in "Debug options" add "-m32" (without quotes !)
in "Optimize for speed" add "-m32" (without quotes !)
in "Optimize for size" add "-m32" (without quotes !)
in "Debug link options" add "-ldbus-glib-1"
in "Release link options" add "-ldbus-glib-1"
wipe all contents of "LIB Directories" and put there these 2 lines :
/lib32
/usr/lib32
That's all. If you STILL get linker errors, annotate them and install the missing 32 bit libs with getlibs command. Google for getlibs examples if you have some doubt.
If you get this linker errors starting with
"undefined reference to `dbus_g_bus_get'"
You missed to add the lines in Debug link option and/or Release link options.
Hope that's useful for somebody
Ciao
Max
[Updated on: Thu, 07 October 2010 23:09] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Building 32 bit apps on Ubuntu64 [message #29178 is a reply to message #29177] |
Fri, 08 October 2010 20:39 |
|
mdelfede wrote on Fri, 08 October 2010 19:44 | It would be nice to test on a "clean" ubuntu install to see the complete list of needed packages and make a script to install them.... And maybe to make automatically a GCC32 builder.
|
I can add the GCC32 build method into the amd64 packages. It should be quite simple if you send me the file (GCC32.bmc).
Honza
|
|
|
Re: Building 32 bit apps on Ubuntu64 [message #29179 is a reply to message #29178] |
Fri, 08 October 2010 21:26 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
dolik.rce wrote on Fri, 08 October 2010 20:39 |
mdelfede wrote on Fri, 08 October 2010 19:44 | It would be nice to test on a "clean" ubuntu install to see the complete list of needed packages and make a script to install them.... And maybe to make automatically a GCC32 builder.
|
I can add the GCC32 build method into the amd64 packages. It should be quite simple if you send me the file (GCC32.bmc).
Honza
|
Hi Honza,
the problem are dependencies AND the libnotify, in particular.
And adding all 32 bit dependencies to 64 bit package seems overkilling.
Maybe an additional package that provides just the GCC32 build method and all required 32 bit dependencies would be great.
That one could be an ide-version-independent package.
BTW, there's still the libnotify problem that I couldn't solve completely.... on GUI apps you need it, and you MUST include in linker option the "-ldbus-glib-1", otherwise you get linker errors.
On console apps it's not needed and, if you include by default, the console app will run just when dbus-glib-1 is present.
I really don't understand why the "-ldbus-glib-1" is needed on commandline, it should be requested automatically by libnotify, but......
Max
Edit : I'll add anyways both .bm files
-
Attachment: GCC32.zip
(Size: 0.85KB, Downloaded 255 times)
[Updated on: Fri, 08 October 2010 21:31] Report message to a moderator
|
|
|
Re: Building 32 bit apps on Ubuntu64 [message #29180 is a reply to message #29179] |
Fri, 08 October 2010 22:02 |
|
Yes, additional simple package is probably the best way to go. I'll look at it at the weekend.
I can't help you with the dbus-glib-1 problem, as all I know is that on regular 32b system it is linked in automatically. BTW: I don't have 64b system so you will have to do all the testing
Honza
|
|
|
|
Re: Building 32 bit apps on Ubuntu64 [message #29183 is a reply to message #29181] |
Fri, 08 October 2010 22:41 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
Novo wrote on Fri, 08 October 2010 22:14 | I'm personally getting different linking issues including not correctly installed libz.so
$ ls -l /usr/lib32/libz.so
lrwxrwxrwx 1 root root 20 2010-10-08 16:04 /usr/lib32/libz.so -> /lib/libz.so.1.2.3.3
getlibs is not a miracle after all.
|
No, getlibs isn't a miracle at all
I guess the best would be to setup a clean ubuntu64 box, install IA32-LIBS and then install missing libs by hand one by one annotating them.
When the list is ready, we can create a script that to the job.
BTW, If I remember, I had to add a soft link from a .so.xx.yy to a .so library (don't remember which )
IMHO it would be quite good to have a 32 bit build method, it's useful to build apps designed, for example, to run on a remote linux box.
@dolik-rce : hmmmmm.... I can't test that one reliabily, as I have my box full of 32 bit libs, mostly because of wine builds
But, we could test all that on an usb stick with a clean ubuntu64....
Max
|
|
|
|
Re: Building 32 bit apps on Ubuntu64 [message #29193 is a reply to message #29183] |
Sat, 09 October 2010 17:49 |
Novo
Messages: 1361 Registered: December 2006
|
Ultimate Contributor |
|
|
mdelfede wrote on Fri, 08 October 2010 16:41 |
IMHO it would be quite good to have a 32 bit build method, it's useful to build apps designed, for example, to run on a remote linux box.
|
IMHO TheIDE has GCC32 Builder (at least in my case).
What I personally would like to see is the ability to set up a target platform for a compiler in the builder configuration UI. That would let me to set up WIN32 target for the MinGW compiler on Linux. Now it is hardcoded to LINUX, I believe. This small change would make cross-compilation much easier. Instead of installing UPP under Wine I would be able to compile everything on Linux.
Regards,
Novo
[Updated on: Sat, 09 October 2010 17:52] Report message to a moderator
|
|
|
Re: Building 32 bit apps on Ubuntu64 [message #29194 is a reply to message #29193] |
Sat, 09 October 2010 18:26 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
Novo wrote on Sat, 09 October 2010 17:49 |
mdelfede wrote on Fri, 08 October 2010 16:41 |
IMHO it would be quite good to have a 32 bit build method, it's useful to build apps designed, for example, to run on a remote linux box.
|
IMHO TheIDE has GCC32 Builder (at least in my case).
|
yep, but in my case didn't work out of the box.... I don't know if it has the -m32 hardcoded. Anyways I added it as a compiler flag and it runs well
Quote: |
What I personally would like to see is the ability to set up a target platform for a compiler in the builder configuration UI. That would let me to set up WIN32 target for the MinGW compiler on Linux. Now it is hardcoded to LINUX, I believe. This small change would make cross-compilation much easier. Instead of installing UPP under Wine I would be able to compile everything on Linux.
|
Yes, that would be useful, even if mingw isn't a so reliable compiler. I use wine too, with MSC to build windows apps.
BTW... did you solve the libnotify -- -ldbus-glib-1 problem ?
I had to setup 2 builds methods, one for gui apps and one without, because of it.
Max
|
|
|
Re: Building 32 bit apps on Ubuntu64 [message #29195 is a reply to message #29194] |
Sat, 09 October 2010 21:09 |
Novo
Messages: 1361 Registered: December 2006
|
Ultimate Contributor |
|
|
mdelfede wrote on Sat, 09 October 2010 12:26 |
BTW... did you solve the libnotify -- -ldbus-glib-1 problem ?
I had to setup 2 builds methods, one for gui apps and one without, because of it.
|
Not yet. This is actually strange because linker should drop unused dependencies by itself.
I traced loading of a console application and it actually loads and binds libdbus-glib-1.so.2. This is strange.
Regards,
Novo
|
|
|
Re: Building 32 bit apps on Ubuntu64 [message #29346 is a reply to message #29195] |
Fri, 15 October 2010 18:39 |
Novo
Messages: 1361 Registered: December 2006
|
Ultimate Contributor |
|
|
I made a couple more experiments with building of 32 bit executables on 64 bit Linux and it turned out that "-m32" option with compiler and "-ldbus-glib-1" option with linker are not necessary. It is just enough to choose a GCC32 builder. I haven't had any linking issues so far and there is no redundant dependency on dbus-glib-1.so.2 in console applications.
My release builder options look like below.
Optimize for speed: -O3 -ffunction-sections -fdata-sections
Optimize for size: -Os -finline-limit=20 -ffunction-sections -fdata-sections
Release link options: -Wl,--gc-sections
Regards,
Novo
|
|
|
Goto Forum:
Current Time: Mon Jun 03 23:53:13 CEST 2024
Total time taken to generate the page: 0.03614 seconds
|
|
|