Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* 32-bit gcc help
@ 2004-07-07  2:41 js290
  2004-07-07  5:22 ` mharris
  0 siblings, 1 reply; 6+ messages in thread
From: js290 @ 2004-07-07  2:41 UTC (permalink / raw)


I'm trying to compile a 32-bit program on my Alpha.  The configure
script is expecting 32-bit integers:

  checking "size of time_t"... "bad"
  configure: error: "one or more basic data types has an incompatible size: giving up"

How do I force gcc to compile with 32-bit integers?  I tried
passing "-msmall-data" as part of the CFLAGS variable.  Some
architectures allow for a "-m32", but Alpha isn't one of them.  Thanks
for any tips.


Jiann-Ming Su
"Yeah, Lois, that'll be about as much fun as a lecture on
 				   ontological empiricism."  --Peter Griffin




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

* 32-bit gcc help
  2004-07-07  2:41 32-bit gcc help js290
@ 2004-07-07  5:22 ` mharris
  2004-07-07 16:22   ` steve
  0 siblings, 1 reply; 6+ messages in thread
From: mharris @ 2004-07-07  5:22 UTC (permalink / raw)


On Tue, 6 Jul 2004, Jiann-Ming Su wrote:

>Date: Tue, 6 Jul 2004 22:41:06 -0400 (EDT)
>From: Jiann-Ming Su <js290 at bellsouth.net>
>To: axp-list at redhat.com
>Content-Type: TEXT/PLAIN; charset=US-ASCII
>Reply-To: Linux and Red Hat on Alpha processors <axp-list at redhat.com>
>X-BeenThere: axp-list at redhat.com
>Subject: 32-bit gcc help
>
>I'm trying to compile a 32-bit program on my Alpha.  The configure
>script is expecting 32-bit integers:
>
>  checking "size of time_t"... "bad"
>  configure: error: "one or more basic data types has an incompatible size: giving up"
>
>How do I force gcc to compile with 32-bit integers?  I tried
>passing "-msmall-data" as part of the CFLAGS variable.  Some
>architectures allow for a "-m32", but Alpha isn't one of them.  Thanks
>for any tips.

On Alpha, the standard types are of the following sizes:

sizeof(char)=1
sizeof(short)=2
sizeof(int)=4
sizeof(long)=8
sizeof(long long)=8

The above is typical for the majority of 64bit platforms out 
there (but not all).  It looks to me from the above error 
message, that the application you're trying to compile is not 
compatible with a 64bit system and needs to be ported to be 64bit 
clean.

If you were using AMD64 architecture, you could use -m32 to
compile 32bit x86 binaries, as the CPU can run both native 32bit
and 64bit code.  ia64 can do similar with emulation, and ppc64
can run 32bit ppc binaries also.  There never was a 32bit Alpha,
so it has no such capability.

I don't think there's any other option than to fix the 
application to be 64bit clean, or to use a 32bit processor or an 
alternative 64bit architecture which has compatibilty with it's 
32bit predecessor.

Hope this helps.


-- 
Mike A. Harris        ftp://people.redhat.com/mharris
OS Systems Engineer   -   X11 Developer   -   Red Hat




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

* 32-bit gcc help
  2004-07-07  5:22 ` mharris
@ 2004-07-07 16:22   ` steve
  2004-07-07 17:13     ` michal
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: steve @ 2004-07-07 16:22 UTC (permalink / raw)


Mike A. Harris wrote:

> If you were using AMD64 architecture, you could use -m32 to
> compile 32bit x86 binaries, as the CPU can run both native 32bit
> and 64bit code.  ia64 can do similar with emulation, and ppc64
> can run 32bit ppc binaries also.  There never was a 32bit Alpha,
> so it has no such capability.

Actually, Windows NT/alpha and Microsoft C/RISC edition was
definitely *32* bit. It was not compatible with any 32bit alpha
which never existed) but int/long/void* were 32bit as the
compiler generated them, so 32bit applications didn't need to
be ported, per se. (M$ never made a 64bit system/compiler for
alpha, so far as I know.)

Also, the DEC compiler for alpha had a "32bit" mode that limited
the sizes of things in the same way. It needed operating system
support to keep the application address space within a 32bit
pointer.

Of course, compared to fixing the application, all this is
cheating:-)

-- 
Steve Williams                "The woods are lovely, dark and deep.
steve at icarus.com           But I have promises to keep,
http://www.icarus.com         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."




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

* 32-bit gcc help
  2004-07-07 16:22   ` steve
@ 2004-07-07 17:13     ` michal
  2004-07-08  0:29     ` france
  2004-07-08  2:11     ` mharris
  2 siblings, 0 replies; 6+ messages in thread
From: michal @ 2004-07-07 17:13 UTC (permalink / raw)


On Wed, Jul 07, 2004 at 09:22:09AM -0700, Stephen Williams wrote:
> 
> Also, the DEC compiler for alpha had a "32bit" mode that limited
> the sizes of things in the same way. It needed operating system
> support to keep the application address space within a 32bit
> pointer.

If you will dig deep enough then you will find out that gcc has also
this '-taso' (or this was '-xtaso'?) mode.  At least in some version.
Pointers really have then an upper half always zero and you have to fix
binutils, a loader in particular, to load your program that way that
addresses satisfy that "zeros in high bits" condition.  If you will dig
deep enough you should find some patches.  I do not think that anybody
ever pursued that in depth and checked what else may then break. I guess
that you need to ensure somehow that library calls will not ever return
a "too wide" address or value which probably means "32-bit library
variants".  A flag EF_ALPHA_32BIT for an ELF header is most likely still
there.

For the particular problem of OP I would rather look at fixing
that configure script and/or program. :-)

   Michal




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

* 32-bit gcc help
  2004-07-07 16:22   ` steve
  2004-07-07 17:13     ` michal
@ 2004-07-08  0:29     ` france
  2004-07-08  2:11     ` mharris
  2 siblings, 0 replies; 6+ messages in thread
From: france @ 2004-07-08  0:29 UTC (permalink / raw)


Hi,

On Wednesday 07 July 2004 12:22 pm, Stephen Williams wrote:
> Mike A. Harris wrote:
> > If you were using AMD64 architecture, you could use -m32 to
> > compile 32bit x86 binaries, as the CPU can run both native 32bit
> > and 64bit code.  ia64 can do similar with emulation, and ppc64
> > can run 32bit ppc binaries also.  There never was a 32bit Alpha,
> > so it has no such capability.
>
> Actually, Windows NT/alpha and Microsoft C/RISC edition was
> definitely *32* bit. It was not compatible with any 32bit alpha
> which never existed) but int/long/void* were 32bit as the
> compiler generated them, so 32bit applications didn't need to
> be ported, per se. (M$ never made a 64bit system/compiler for
> alpha, so far as I know.)
>

Windows NT/Alpha was 64bit, not 32. The product announce is at the URL below:

http://www.winnetmag.com/Article/ArticleID/16872/16872.html


> Also, the DEC compiler for alpha had a "32bit" mode that limited
> the sizes of things in the same way. It needed operating system
> support to keep the application address space within a 32bit
> pointer.

This is also not accurate, but not worth going into at this time.

Best Regards,


--George




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

* 32-bit gcc help
  2004-07-07 16:22   ` steve
  2004-07-07 17:13     ` michal
  2004-07-08  0:29     ` france
@ 2004-07-08  2:11     ` mharris
  2 siblings, 0 replies; 6+ messages in thread
From: mharris @ 2004-07-08  2:11 UTC (permalink / raw)


On Wed, 7 Jul 2004, Stephen Williams wrote:

>Date: Wed, 07 Jul 2004 09:22:09 -0700
>From: Stephen Williams <steve at icarus.com>
>To: Linux and Red Hat on Alpha processors <axp-list at redhat.com>
>Content-Type: text/plain; charset=us-ascii; format=flowed
>Reply-To: Linux and Red Hat on Alpha processors <axp-list at redhat.com>
>X-BeenThere: axp-list at redhat.com
>Subject: Re: 32-bit gcc help
>
>Mike A. Harris wrote:
>
>> If you were using AMD64 architecture, you could use -m32 to
>> compile 32bit x86 binaries, as the CPU can run both native 32bit
>> and 64bit code.  ia64 can do similar with emulation, and ppc64
>> can run 32bit ppc binaries also.  There never was a 32bit Alpha,
>> so it has no such capability.
>
>Actually, Windows NT/alpha and Microsoft C/RISC edition was
>definitely *32* bit. It was not compatible with any 32bit alpha
>which never existed) but int/long/void* were 32bit as the
>compiler generated them, so 32bit applications didn't need to
>be ported, per se. (M$ never made a 64bit system/compiler for
>alpha, so far as I know.)

This information is very inaccurate and misleading.

>Also, the DEC compiler for alpha had a "32bit" mode that limited
>the sizes of things in the same way. It needed operating system
>support to keep the application address space within a 32bit
>pointer.

This isn't entirely accurate either.

The big problem with Windows, is that it was never designed to be 
portable in the first place, so it has a lot of 32bit assumptions 
everywhere which wont go away likely ever.  Most Win32 developers 
also write non-portably and their apps are doomed to remain 32bit 
without major effort to port to be 64bit clean.

On the Win64 ABI on AMD64 architecture, Microsoft decided to nail
long at 4 bytes instead of the usual 8 bytes.  It is this type of
trickery which will allow developers to recompile 32bit apps on
Win64 without a lot of problems related to invalid type size
assumptions.

Windows on Alpha has it's own quirks in a similar vein, but not 
really something I care to delve into.

The Alpha is a 64bit CPU, which runs 64bit operating systems.  
Not all 64bit operating systems or ABI's were created equal, and 
Windows on Alpha shows that.


-- 
Mike A. Harris        ftp://people.redhat.com/mharris
OS Systems Engineer   -   X11 Developer   -   Red Hat




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

end of thread, other threads:[~2004-07-08  2:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-07  2:41 32-bit gcc help js290
2004-07-07  5:22 ` mharris
2004-07-07 16:22   ` steve
2004-07-07 17:13     ` michal
2004-07-08  0:29     ` france
2004-07-08  2:11     ` mharris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox