public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* setting pointer width
@ 2008-10-09 12:49 Shah Harshit
  2008-10-09 13:09 ` John Love-Jensen
  0 siblings, 1 reply; 2+ messages in thread
From: Shah Harshit @ 2008-10-09 12:49 UTC (permalink / raw)
  To: gcc-help

Hi,

I need to set pointer (e.g., int *ptr) width to 64 bits on a 32 bit machine
for some experiments. 

intptr is defined as long (32 bits). Is there any way to change this through
command line arguments to gcc while compiling the input program? OR, is it
possible by changing the gcc source and compiling it?

Any help regarding the same would be appreciated.

Thanks.
Regards,
harshit shah



 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: setting pointer width
  2008-10-09 12:49 setting pointer width Shah Harshit
@ 2008-10-09 13:09 ` John Love-Jensen
  0 siblings, 0 replies; 2+ messages in thread
From: John Love-Jensen @ 2008-10-09 13:09 UTC (permalink / raw)
  To: Shah Harshit, GCC-help

Hi harshit shah,

I do not understand what you are trying to do.

Do you want ints to be 64-bit on a 32-bit word architecture?

Do you want pointers to be 64-bit on a 32-bit memory address architecture?

Do you want both ints and pointers to be 64-bit on a 32-bit word & 32-bit
memory address architecture?

Either change will violate your platform's ABI.

You wont be able to access system calls or the standard C library (or any
other shared library), or use input or output, from the object code compiled
from a non-ABI compliant compiler.  You'll need to recompile any libraries
you use.  If you want to access system calls or standard C library, you'll
need to write your own springboard routines*, probably in assembly, to
convert from your non-ABI-compliant ints and pointers to ABI-compliant.

As an alternative to consider, I recommend using a 64-bit platform.
Probably a lot less work.

Another alternative is to write your own virtual machine that uses 64-bit
ints and pointers, and then write a cross-compiler to your virtual machine.

Sincerely,
--Eljay

* springboard routines / thunk routines / trampoline routines ... I'm not
sure what the correct terminology is.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-09 13:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-09 12:49 setting pointer width Shah Harshit
2008-10-09 13:09 ` John Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).