RE: SuSE Linux 8.1 Alpha ... -m32 switch in gcc ?

"Jim McCarthy" <[email protected]> Sun, 21 Nov 2004 14:26:19 -0800
Newsgroups gmane.linux.suse.axp
Message-ID <[email protected]>
Thanks to those who responded --

> On Sun, Nov 21, 2004 at 01:12:10PM +0100, Robert Schiele wrote:
>> On Sat, Nov 20, 2004 at 07:23:26PM -0800, Jim McCarthy wrote:
>>> Hello --
>>> 
>>> Can anyone tell me if the SuSE Linux 8.1 Alpha Edition's gcc 
>>> compiler also supports the -m32 switch, or if there is another
>>> (better/recommended) approach for building (on Alpha) C code
>>> written for 32-bit Intel PC Linux where addresses are assumed
>>> to be 32-bits ?
>> 
>> Alpha machines have 64-bit pointers.  There is no option for 
>> 32-bit pointers, thus a compiler cannot do anything for you.
>> Your only option is to fix your broken software if you want it
>> to run on Alpha machines.
> 
> Not with the gcc compiler, but the Compaq C Compiler (ccc) does
> have such an option.
> 

I've now installed 'ccc', but according to 'man ccc' the relevant
compiler switches are not available for ccc on Linux - only Tru64.
Did I miss something relevant to Linux Alpha reading the man page,
Major Chai ?  Or ??

      -- Jim

% man ccc
...
Options That Affect the Linker or Loader
...
[Linux] This section describes the linker options available
on Tru64 UNIX.  For each, the equivalent GNU linker option
on Linux Alpha (if any) is identified, as well as the effect
of specifying the Tru64 UNIX option on the ccc command line.
...
[Tru64] -taso

    Directs the linker to load the executable file in the
    lower 31-bit addressable virtual address range.  The
    -T and -D options to the ld command can also be used,
    respectively, to ensure that the text and data segments
    are loaded into low memory.

    The -taso option, however, in addition to setting
    default addresses for text and data segments, also
    causes shared libraries linked outside the 31-bit
    address space to be appropriately relocated by the
    loader.  If you specify -taso and also specify that
    text and data segment addresses with -T and -D, those
    addresses override the -taso default addresses.  The
    -taso option can be helpful when porting programs that
    assume address values can be stored in 32-bit variables
    (that is, programs that assume that pointers are the
    same length as int variables).

    [Linux]  There is no equivalent option on Linux Alpha.

    [Linux]  This option is not passed to ld and generates
    a warning.
...
Stack-handling and Pointer-handling Options
...
[Tru64] -xtaso

    Causes the compiler to respect "#pragma pointer_size"
    directives, which control the size of pointers.  These
    directives are ignored otherwise.  Also, causes the
    -taso option to be passed to the linker (if linking).

    Pointers are 64-bits by default.  This option, when
    used in conjunction with the pointer_size pragmas,
    allows applications to use 32-bit pointers. [...]

[Tru64] -xtaso_short

    Same as the -xtaso option, except -xtaso_short also
    directs the compiler to allocate 32-bit pointers by
    default.  You can still use 64-bit pointers, but only
    by use of pointer_size pragmas.

    The use of the -xtaso_short option can cause conflicts
    between the compiler's assumptions about pointer sizes
    and data layouts and the default values that were in
    effect when the system libraries were created.  See
    protect_headers_setup(8) for details on how to avoid
    this conflict.
...