Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED]Compiling for 32bit on a 64bit machine?

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
Darexon
Posts: 3
Joined: 2014-07-18 13:50

[SOLVED]Compiling for 32bit on a 64bit machine?

#1 Post by Darexon »

I tried compiling for 32 bit linux on my 64 bit machine using this command

Code: Select all

gcc -m32 stuff.c -o bit
and it returns this error:
In file included from /usr/include/stdio.h:27:0,
from stuff.c:1:
/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
So I tried getting multilib stuff using these commands

Code: Select all

sudo apt-get install gcc-multilib
and

Code: Select all

sudo apt-get install g++-multilib
and they returned these errors, respectively.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
gcc-multilib : Depends: gcc-4.7-multilib (>= 4.7.2-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
g++-multilib : Depends: gcc-multilib (>= 4:4.7.2-1) but it is not going to be installed
Depends: g++-4.7-multilib (>= 4.7.2-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Then I tried getting those dependencies individually but it did not work.

I'm running Wheezy and i'm using some Jessie things such as Steam, Gimp, Gnash and VLC.
Last edited by Darexon on 2014-07-18 17:50, edited 1 time in total.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Compiling for 32bit on a 64bit machine?

#2 Post by stevepusser »

I'm running Wheezy and i'm using some Jessie things such as Steam, Gimp, Gnash and VLC.
And your apt system is broken as a result.

Stealing from Ballmer:

Backports, backports, backports!
MX Linux packager and developer

Darexon
Posts: 3
Joined: 2014-07-18 13:50

Re: Compiling for 32bit on a 64bit machine?

#3 Post by Darexon »

stevepusser wrote:
I'm running Wheezy and i'm using some Jessie things such as Steam, Gimp, Gnash and VLC.
And your apt system is broken as a result.

Stealing from Ballmer:

Backports, backports, backports!
I've installed other things just fine after failing to get those 32 bit libraries.

vbrummond
Posts: 4432
Joined: 2010-03-02 01:42

Re: Compiling for 32bit on a 64bit machine?

#4 Post by vbrummond »

It is likely you have a newer library that you don't have the same version for on 32-bit, and thus 32-bit packages that depend on it will not install. This happens when you mix repositories. Do not get me wrong though, multi-arch is broken even in the best case.
Always on Debian Testing

Darexon
Posts: 3
Joined: 2014-07-18 13:50

Re: Compiling for 32bit on a 64bit machine?

#5 Post by Darexon »

Solved! I fixed this by instead getting those things from the testing repositories.

tomazzi
Posts: 730
Joined: 2013-08-02 21:33

Re: [SOLVED]Compiling for 32bit on a 64bit machine?

#6 Post by tomazzi »

Darexon wrote:Solved! I fixed this by instead getting those things from the testing repositories.
Well, in my opinion (which You don't have to agree with) this is NOT solved -> it worked in Your particular case, but it's not a general solution...

Far more secure and easier solution is to use chroot instead of multilib/multiarch - which are simply broken, as it was already said by vbrummond ;)

Of course I'm curious why the hell You're trying to compile a 32-bit version of Linux under 64-bit, instead of using a ready-to-launch installationj (where You're free to choose the range/set of modules to install) - do You use some custom archiecture or am I missing something?

Regards.
Odi profanum vulgus

tomazzi
Posts: 730
Joined: 2013-08-02 21:33

Re: [SOLVED]Compiling for 32bit on a 64bit machine?

#7 Post by tomazzi »

Darexon wrote:Solved! I fixed this by instead getting those things from the testing repositories.
Well, in my opinion (which You don't have to agree with) this is NOT solved -> it worked in Your particular case, but it's not a general solution...

Far more secure and easier solution is to use chroot instead of multilib/multiarch - which are simply broken, as it was already said by vbrummond ;)

Of course I'm curious why the hell You're trying to compile a 32-bit version of the program for Linux under 64-bit, instead of using a ready-to-launch installation (where You're free to choose the range/set of modules to install) - do You use some custom archiecture or am I missing something?

...and on the other hand, it's trivially easy to write portable apps, unless You Really have to use some platform-specific asm code...


Regards
Odi profanum vulgus

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: [SOLVED]Compiling for 32bit on a 64bit machine?

#8 Post by stevepusser »

So you're running a mixed stable/testing system. Good thing that's never caused anybody else any problems.




I mean in the last 5 minutes.
MX Linux packager and developer

Post Reply