This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 64-bit machine generate an executable where long is 32-bits and pointers are 64-bits.


Kraiser <pietiatibia1@gmail.com> writes:

> It's my problem actually any possible way to do that ?
> 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.
> If the feature isn't exist maybe it would be awesome to add this in future
> releases of GCC :?
> seems like more people needs it:
> http://stackoverflow.com/questions/1857296/can-gcc-on-ubuntu-on-a-64-bit-machine-generate-an-executable-where-long-is-32-bit

Compiler options of this sort are problematic because they change the
ABI.  That is, code compiled with this option can not be safely linked
with code compiled without this option.  Code compiled with this
option can not be safely used with dynamic librares compiled without
this option.  Code compiled with this option can not safely make
system calls on a kernel compiled without this option (e.g., on
GNU/Linux, the stat structure includes fields of type unsigned long,
so the stat system call will not work as expected).

So the only people who can safely use this option are people who are
prepared to recompile their entire system.

It's a very simple change to make to the source code, but that doesn't
necessarily mean that it is a good idea.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]