[Info-vax] GCC for VMS, was: Re: fortran compiler roadmap?
Craig A. Berry
craigberry at mac.com.invalid
Sun Apr 28 19:14:59 EDT 2013
Simon Clubley wrote:
>
> The following is from a terminal session on Eisner.
>
> The first statt.exe was cross compiled under Linux using the C headers
> from Eisner and transferred to Eisner using sftp. The second statt.exe,
> as you can see, was compiled and run on Eisner.
>
> $ r statt
> sizeof(struct simon_stat) = 20
> sizeof(struct stat) = 69
> Warning: 'hello.exe' is not an ordinary file
> fsize = 4294967295
> $ cc statt
> $ link statt
> $ r statt
> sizeof(struct simon_stat) = 16
> sizeof(struct stat) = 49
> fsize = 10566
> $
>
> Look at the differences in the sizes of the structs. I see 3 possibilities:
>
> (a) I've made a mistake while altering the VMS C headers to be usable
> with the Linux gcc cross compiler, but a review of my changes did not
> see anything obvious in this area,
>
> (b) There is some data type size difference between the compilers,
>
> (c) gcc is not aligning the structure as requested (gcc has had support
> for some DEC C pragmas added)
Or one or more of the many macros referenced in stat.h is different
between the gcc cross compiler and the native compiler. There is no
hello.exe locally, but I can certainly reproduce getting different
structure sizes with different options:
$ cc/vers
HP C V7.3-010 on OpenVMS Alpha V8.3
$ cc statt
$ link statt
$ r statt
sizeof(struct simon_stat) = 16
sizeof(struct stat) = 51
'hello.exe': No such file
fsize = 4294967295
$ cc/define=_USE_STD_STAT=1 statt
$ link statt
$ r statt
sizeof(struct simon_stat) = 20
sizeof(struct stat) = 256
'hello.exe': No such file
fsize = 4294967295
More information about the Info-vax
mailing list