Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Need help investigating a port to a DEC AXP system running OSF/1
@ 1994-11-01 19:45 James Zarbock
  1994-11-02  0:33 ` Dan Pop
  1994-11-02 14:52 ` Alan Herrlich
  0 siblings, 2 replies; 4+ messages in thread
From: James Zarbock @ 1994-11-01 19:45 UTC (permalink / raw)


I am investigating porting C code to a DEC AXP 2000-300 that we
have in-house.  

The "uname -a" report is "OSF1 alien.irvine.com V1.3 113.75 alpha".

The C code was basically written with the implicit assumption that the
types "int", "long" and "*" (pointer) were the same size.  Of course,
well written code would not have made such an assumption.

It appears that in C on an Alpha which is a true 64 bit machine the
size of the type "int" is 4 bytes and the size of the type "*"
(pointer) is 8 bytes. Period.

Is there some sort of "32 bit compatibility mode" for the C compiler
that will make the C compiler make longs and pointers 4 bytes?

Does anyone have any pointers to any porting notes for an AXP and OSF/1.

Any comments or help whatsoever will be greatly appreciated.

-- jzarbock@irvine.com

-- 
James Zarbock


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

* Re: Need help investigating a port to a DEC AXP system running OSF/1
  1994-11-01 19:45 Need help investigating a port to a DEC AXP system running OSF/1 James Zarbock
@ 1994-11-02  0:33 ` Dan Pop
  1994-11-02 13:18   ` Dave Golden
  1994-11-02 14:52 ` Alan Herrlich
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Pop @ 1994-11-02  0:33 UTC (permalink / raw)


In <CyLtJE.734@irvine.com> jim@irvine.com (James Zarbock) writes:

>It appears that in C on an Alpha which is a true 64 bit machine the
>size of the type "int" is 4 bytes and the size of the type "*"
>(pointer) is 8 bytes. Period.
>
>Is there some sort of "32 bit compatibility mode" for the C compiler
>that will make the C compiler make longs and pointers 4 bytes?

RTFM. From the cc man page:

  -taso
      Tell the linker that the executable file should be loaded in the lower
      31-bit addressable virtual address range. The -T and -D flags to the ld
      command can also be used to ensure that the text and data segments
      addresses, respectively, are loaded into low memory. The -taso flag,
      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 text and data segment addresses with -T
      and -D, those addresses override the -taso default addresses. The -taso
      flag is useful for porting 32-bit programs to DEC OSF/1.

Of course, there is no compiler option (that I know of) to make long's
32 bit, but you can solve this problem with:

#define long int

But fixing your code to remove the silly assumptions about the sizes of
the different data types is, by far, the best solution.

Dan
--
Dan Pop 
CERN, CN Division
Email: danpop@cernapo.cern.ch
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland


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

* Re: Need help investigating a port to a DEC AXP system running OSF/1
  1994-11-02  0:33 ` Dan Pop
@ 1994-11-02 13:18   ` Dave Golden
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Golden @ 1994-11-02 13:18 UTC (permalink / raw)



Check out "cc -migrate".  You will have to load some optional parts of the
OSF/1 install kit, though.

Dave Golden


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

* Re: Need help investigating a port to a DEC AXP system running OSF/1
  1994-11-01 19:45 Need help investigating a port to a DEC AXP system running OSF/1 James Zarbock
  1994-11-02  0:33 ` Dan Pop
@ 1994-11-02 14:52 ` Alan Herrlich
  1 sibling, 0 replies; 4+ messages in thread
From: Alan Herrlich @ 1994-11-02 14:52 UTC (permalink / raw)


In article <CyLtJE.734@irvine.com> jim@irvine.com (James Zarbock) writes:

>   Is there some sort of "32 bit compatibility mode" for the C compiler
>   that will make the C compiler make longs and pointers 4 bytes?

There is the -taso switch which causes the C compiler to tell the
linker to make all addresses only use 32 bits (31 bits actually). The
sizeof an int is still 4 and the sizeof a pointer and a long are still
8, but this should let most uses of int = * = long work.

In fact, programs may run quite reliably without -taso. I know one
case where a program didn't fail until the linking in of a particular
sharable object library caused malloc to start returning >32 bit
addresses.

In the long run, of course, liberal use of -std1 (ANSI C) and lint to
catch these and other assumptions is the way to go.
--
Alan Herrlich					herrlich@microw.enet.dec.com

Opinions herein are my own and do not necessarily reflect those of Digital.
For a summary of Digital's Internet services, send mail to info@digital.com


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

end of thread, other threads:[~1994-11-02 14:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-11-01 19:45 Need help investigating a port to a DEC AXP system running OSF/1 James Zarbock
1994-11-02  0:33 ` Dan Pop
1994-11-02 13:18   ` Dave Golden
1994-11-02 14:52 ` Alan Herrlich

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