tags:

views:

271

answers:

3

In other words is compilation with data-model LLP64 possible in this environment? Please note that my pointers should be 64-bit.

+1  A: 

Looks like it's possible (at least for AMD)

-m32
-m64
Generate code for a 32-bit or 64-bit environment. The 32-bit environment sets int, long and pointer to 32 bits and generates code that runs on any i386 system. The 64-bit environment sets int to 32 bits and long and pointer to 64 bits and generates code for AMD's x86-64 architecture.

Martin Beckett
You mean "not possible". That compiles in ILP32 or LP64 modes -- not LLP64. In fact, I'm not convinced that GCC support LLP64 at all... even on arches where there exists a `-mlong32/-mlong64` switch, it still doesn't choose LLP64.
ephemient
The original Q said could they have 32bit longs and 64bit pointers. Which my reading of this option seems possible
Martin Beckett
The original question did not explicitly state pointer size, but LLP64 means "64-bit long long and pointer".
ephemient
+1  A: 

Yes, you can use the -m32

http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/i386-and-x86%5F002d64-Options.html#i386-and-x86%5F002d64-Options

EDIT: I wrote this answer before he mentioned pointers in the question. See my other answer

Davide
That compiles in ILP32 mode (32-bit int, long, pointer; 64-bit long long). I would have guessed that OP wanted 64-bit pointers (otherwise why call it LLP64?)...
ephemient
You are right, but since he didn't mention pointers at all, I believe he's just concerned about longs. In addition true LLP64 is not possible in Linux (to best of my knowledge, I can be wrong).
Davide
Actually ephemient is right, I was indeed looking for 32-bit long and 64-bit pointer like MS Windows 64-bit compiler works.
Murali
After compiling with -m32 my pointers became 4 bytes! Not what I was looking for.
Murali
A: 

I don't think this is possible on Linux. See wikipedia for details.

Davide