SIZEOF_LONG 4 instead of 8 in 64-bits
John (Eljay) Love-Jensen
eljay@adobe.com
Thu May 20 14:22:00 GMT 2010
Hi Kraiser,
> http://stackoverflow.com/questions/1857296/can-gcc-on-ubuntu-on-a-64-bit-machi
> ne-generate-an-executable-where-long-is-32-bit
> It's my problem actually any possible way to do that ?
Yes.
Take the Ubuntu source code. Change the Ubuntu ABI. Call your new OS
something else, such as Kraiser GNU/Linux.
Applications compiled on Kraiser GNU/Linux will then have your OS's ABI
which would have 32-bit sized long.
Executables compiled for Kraiser GNU/Linux will not run on Ubuntu.
(I've done something similar, back in the day when I was playing around with
Mandrake 6.1 "helios" Linux. I never released my "Eljay GNU/Linux" to the
public, nor intended to. It was just for fun and learning, and never
escaped the dark confines of my basement. There will be bugs.)
> well -m32 isn't actually what i'm looking for because it compiles code for
> 32-bit enviorment along with pointers(32 bit) i need pointers to be 64-bit
> but long = 32bit just like it is on Windows LLP64.
Ubuntu's ABI is different from Windows' ABI.
> If the feature isn't exist maybe it would be awesome to add in future
> releases of GCC :?
That's not a GCC-ism. It's the OS ABI-ism.
Sincerely,
--Eljay
More information about the Gcc-help
mailing list