[Info-vax] GCC for VMS, was: Re: fortran compiler roadmap?
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Sun Apr 28 20:15:38 EDT 2013
On 2013-04-28, Craig A. Berry <craigberry at mac.com.invalid> wrote:
>
> 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:
>
It's stuff like this which is a bl**dy pain in the neck. :-(
One theory I came up with is that it may be a 32-bit versus 64-bit issue;
ie: DEC C data types may be a maximum of 32 bits internally unless 64 bit
mode is invoked, but this gcc build may be producing 64 bit based variables
sometimes instead of 32-bit based variables.
I don't have evidence to support that, but I've been building using a
triplet of alpha64-dec-vms so I built a compiler using a triplet of
alpha-dec-vms, but images built using that compiler are access violating
within crtend.o:
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=0000000000000007, PC=0000000000030514, PS=0000001B
%TRACE-F-TRACEBACK, symbolic stack dump follows
image module routine line rel PC abs PC
STATT 0 0000000000030514 0000000000030514
STATT 0 0000000000030764 0000000000030764
0 FFFFFFFF80385CE4 FFFFFFFF80385CE4
%TRACE-I-END, end of TRACE stack dump
>From the cross compiler linker map:
$CODE$ 0x0000000000030230 0x2a4 /tmp/ccupx3Uw.obj
*fill* 0x00000000000304d4 0xc
$CODE$ 0x00000000000304e0 0x50 /apps/exe-vms-axp-cc-tools/lib/gcc/alpha-dec-vms/4_7_3/crtend.o
_LIB$CODE_NOSHR
0x0000000000030530 0x17c /apps/exe-vms-axp-cc-tools/lib/gcc/alpha-dec-vms/4_7_3/../../../../alpha-dec-vms/lib/starlet.olb(LIB$INITIALIZE.obj)
_AMAC$CODE 0x00000000000306ac 0x3f8 /apps/exe-vms-axp-cc-tools/lib/gcc/alpha-dec-vms/4_7_3/../../../../alpha-dec-vms/lib/starlet.olb(AMAC$EMUL_CALL.obj)
(I must admit; I have not yet got used to seeing VMS references within
a binutils ld linker map. :-))
I am mentioning this here in case anyone tries duplicating this in the future;
I wanted to give you a heads-up about the alpha-dec-vms triplet.
I've seen references in messages which may imply ACT are focusing on
the alpha64-dec-*vms target only and also they may be using headers
they wrote when using that target. This makes me wonder if the older
alpha-dec-vms target is now stale and not generating valid code.
> $ 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
It's interesting simon_stat changes in size; that implies one of the
base datatypes I am using in the simon_stat struct is getting redefined.
I will go and have another look.
> sizeof(struct stat) = 256
> 'hello.exe': No such file
> fsize = 4294967295
Simon.
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
More information about the Info-vax
mailing list