Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Porting 32-bit programs, using gcc
@ 1994-04-06 14:42 Mike M. Tuyo
  1994-04-10 17:43 ` Dave Cherkus
  0 siblings, 1 reply; 4+ messages in thread
From: Mike M. Tuyo @ 1994-04-06 14:42 UTC (permalink / raw)


I'm trying to port a *huge* program written for a 32-bit machine
to the alpha, and my resident compiler is gcc (2.5.7).  It seems
to have quite a bit of problems with the longs being 8-bytes wide.

Can someone tell my what options to give gcc so it makes longs 4-bytes
wide instead of 8?

Thank you
-mike tuyo.



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

* Re: Porting 32-bit programs, using gcc
  1994-04-06 14:42 Porting 32-bit programs, using gcc Mike M. Tuyo
@ 1994-04-10 17:43 ` Dave Cherkus
  1994-04-13 15:20   ` Ken Steube
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Cherkus @ 1994-04-10 17:43 UTC (permalink / raw)


In article <2nuhns$qb2@senator-bedfellow.MIT.EDU>, tuyo@mumford (Mike M. Tuyo) writes:
|> I'm trying to port a *huge* program written for a 32-bit machine
|> to the alpha, and my resident compiler is gcc (2.5.7).  It seems
|> to have quite a bit of problems with the longs being 8-bytes wide.
|> 
|> Can someone tell my what options to give gcc so it makes longs 4-bytes
|> wide instead of 8?
|> 
|> Thank you
|> -mike tuyo.

Even if gcc had such a flag, its use would be problematic because any
code you would link to would be build assuming that longs are eight
bytes wide.  Even if you could recompile all user mode code, the system
call interface is coded that way as well so you would have to fix up
all parameters to the system calls that were longs.  I think you can
see that there is a lot more to this than a compiler flag.  Some people
claim success with typedefs or global substitutions to avoid the
problem, but again you need to make sure that all code that interfaces
with libraries provides the properly sized arguments to those
libraries.  Others report that 'lint -Q' helps find portability
problems.

BTW Mike your news software doesn't include your proper email
address (i.e. tuyo@mumford is insufficient).
--  
Dave Cherkus          UniMaster, Inc.         cherkus@unimaster.com 


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

* Re: Porting 32-bit programs, using gcc
  1994-04-10 17:43 ` Dave Cherkus
@ 1994-04-13 15:20   ` Ken Steube
  1994-04-14  6:56     ` Burkhard Neidecker-Lutz
  0 siblings, 1 reply; 4+ messages in thread
From: Ken Steube @ 1994-04-13 15:20 UTC (permalink / raw)


>In article <2nuhns$qb2@senator-bedfellow.MIT.EDU>, tuyo@mumford (Mike M. Tuyo) writes:
>|> I'm trying to port a *huge* program written for a 32-bit machine
>|> to the alpha, and my resident compiler is gcc (2.5.7).  It seems
>|> to have quite a bit of problems with the longs being 8-bytes wide.
>|> 
>|> Can someone tell my what options to give gcc so it makes longs 4-bytes
>|> wide instead of 8?
>|> 
>|> Thank you
>|> -mike tuyo.

If you can use the native compiler, try the -taso option to cc and ld.
It stands for Truncated Address Support Option, and it makes the code
run using 32 bit addresses. I believe longs are still 8 bytes, but addresses
only use the first 4 bytes.

You have to have chosen to install it on your system since it's not
installed automatically.  I haven't tried it on my system since we
didn't install it, but I hear it works OK.

Ken


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

* Re: Porting 32-bit programs, using gcc
  1994-04-13 15:20   ` Ken Steube
@ 1994-04-14  6:56     ` Burkhard Neidecker-Lutz
  0 siblings, 0 replies; 4+ messages in thread
From: Burkhard Neidecker-Lutz @ 1994-04-14  6:56 UTC (permalink / raw)


In article <2oh2ke$g1l@pravda.sdsc.edu> steube@elroy.sdsc.edu (Ken Steube) writes:
>If you can use the native compiler, try the -taso option to cc and ld.
>It stands for Truncated Address Support Option, and it makes the code
>run using 32 bit addresses. I believe longs are still 8 bytes, but addresses
>only use the first 4 bytes.

Not quite. It arranges for code and data to be laid out in memory so
that the *value* of the addresses fits into 32 bits, i.e. they survive
the following:

	int i;
        char *p;

	p = "foo";
	i = (int) p;
        p = (char *) i;

There is no way of getting either 32 bit addresses or 32 bit longs. Fix
the program (which isn't too hard with the help of lint -q). At least
we did it here for the ISODE and multimedia mail system, which has several
hundred thousand lines of code.

		Burkhard Neidecker-Lutz

Distributed Multimedia Group, CEC Karlsruhe  
BERKOM II Project
Digital Equipment Corporation
neideck@nestvx.enet.dec.com


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

end of thread, other threads:[~1994-04-14  6:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-04-06 14:42 Porting 32-bit programs, using gcc Mike M. Tuyo
1994-04-10 17:43 ` Dave Cherkus
1994-04-13 15:20   ` Ken Steube
1994-04-14  6:56     ` Burkhard Neidecker-Lutz

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