This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: ld for VMS?

Douglas, thank you, that seems to help.

Without set file attr:

WALLIS> link
%LINK-W-RECTYP, file USER$DISK:[JAYKRELL.CM3-BOOT-ALPHA32_VMS-1]WR.MO;1 record 1 is illegal (90.)
%LINK-W-RECTYP, file USER$DISK:[JAYKRELL.CM3-BOOT-ALPHA32_VMS-1]WR.MO;1 record 2 is illegal (2048.)

With set file attr:

WALLIS> link
%LINK-W-NUDFSYMS, 3 undefined symbols:
%LINK-I-UDFSYM, ??? Char_I3 
%LINK-I-UDFSYM, ??? RTHooks_I3 
%LINK-I-UDFSYM, ??? Word_I3 
%LINK-W-USEUNDEF, undefined symbol Char_I3 referenced
??? in psect $DATA$ offset %X00000090

That isn't supposed to have succeeded, it's just one .obj among a bunch.
But at least the errors make more sense.

I know VMS file system is "different", but I don't know enough to know what to do about it. :)
VMS users (you and the sysadmin) are very quick to suggest things that sounds very
easy to them but I have no idea where the supply of these suggestions is. :)

Something is still off doing a cross link.
Also I noticed some, makefile.vms strewn around, but they seem to be partly out of date.
I also see Tristan rewrote some of the stuff recently, so not all out of date.

?- Jay

> Date: Sun, 25 Apr 2010 11:28:24 -0700
> From:
> To:
> CC:;
> Subject: Re: ld for VMS?
> Objects on AVMS are a variable length file type, no such file type
> exists on Unix, it's just a byte stream. You may be running into this
> problem. Do this before you try to link on VMS:
> $ set file/attr=(rfm=var,rat=none) .obj
> Jay K wrote:
>> Tristan,
>> I'm seeing the following:
>> Any alpha-dec-vms-ld invocation with reasonable inputs fails an assertion:
>> alpha-dec-vms-ld: BFD (GNU Binutils) assertion fail /src/binutils/src/bfd/vms-lib.c:351
>> BFD_ASSERT (sbm_sz>= sizeof (struct vms_dcxsbm) + l + 3 * sbm_len);
>> in _bfd_vms_lib_archive_p. I'm not sure it is complaining about gas output or the libraries from VMS.
>> Maybe I'll poke around.
>> When I run it under a debugger:
>> $ gdb --args alpha-dec-vms-ld cm3-boot-ALPHA32_VMS-1/
>> (gdb) r
>> Starting program: /usr/local/bin/alpha-dec-vms-ld cm3-boot-ALPHA32_VMS-1/
>> Reading symbols for shared libraries +++. done
>> /usr/local/bin/alpha-dec-vms-ld: BFD (GNU Binutils) assertion fail /src/binutils/src/bfd/vms-lib.c:351
>> Program received signal EXC_BAD_ACCESS, Could not access memory.
>> Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
>> 0x000562bf in vms_lib_dcx (vec=0x845a08, buf=0x0, nbytes=65536) at /src/binutils/src/bfd/vms-lib.c:616
>> 616 if (!(sbm->flags[offset>> 3] & (1 << (offset & 7))))
>> up
>> up
>> (gdb) p *abfd
>> $1 = {
>> id = 6,
>> filename = 0x80ed54 "ACLEDTSHR",
>> Any alpha-dec-vms-as output passed to link on VMS is rejected with lots of errors, invalid record types, invalid lengths, etc.
>> alpha-dec-vms-gcc -malpha-as output is not accepted by VMS "macro", lots of errors.
>> alpha-dec-vms-nm does accept alpha-dec-vms-as output.
>> Any ideas?
>> You see, I can generate assembly on a cross host. That seems to work.
>> And then I can either assemble it on the cross host, copy to VMS, link on VMS,
>> or I could copy the assembly to VMS, run macro and link on VMS.
>> Or I could link on the cross host and just copy the executables to VMS.
>> None of the three options seems to be working.
>> I'll have to poke around more..
>> - Jay
>> ----------------------------------------
>>> From:
>>> To:
>>> CC:
>>> Subject: RE: ld for VMS?
>>> Date: Thu, 22 Apr 2010 16:24:09 +0000
>>> Darn ok. Maybe your changes will be contributed upstream? I guess not.
>>> I'll try to cross build it then. I'm seeing new errors, building unwind stuff in libgcc.
>>> I'll try some different configurations, could be gcc configure saw the GNU as/ld and
>>> decided to provide more functionality.
>>> Yes I can see binutils trunk builds VMS ld, thanks. I had only tried the latest release.
>>> Maybe I should go past 4.5 for gcc too?
>>> I also had to hack the headers a bit, like ln -s . vms and
>>> #ifdef __GNUC__
>>> #ifndef __int64
>>> #define __int64 long long
>>> #endif
>>> Thanks,
>>> - Jay
>>> ----------------------------------------
>>>> Subject: Re: ld for VMS?
>>>> From:
>>>> Date: Thu, 22 Apr 2010 17:35:15 +0200
>>>> CC:
>>>> To:
>>>> On Apr 22, 2010, at 5:27 PM, Jay K wrote:
>>>>> Awesome!
>>>>> "Partly" as in?
>>>> So, partially. This is still work in progress. But I am able to link and run large programs (such as gcc).
>>>>> I can do without shared objects, for one thing, at least for now.
>>>>> I can try trunk.
>>>> Use of shared objects work. But ld can't currently generate shared images.
>>>>> gcc 4.5 seems to largely work for Alpha/vms "out of the box".
>>>>> At least to output assembly, I think for GNU as. (which I had already built/installed, so configure found it).
>>>> Right.
>>>>> My larger goal is to cross build: gcc, bash, sed, awk, make, etc. enough so that I can build gcc natively, at least cc1.
>>>> Well, you'd better to forget that. If you want a native gcc, you'd better to build it via a cross compiler.
>>>> We did native builds of gcc, but it requires a lot of adjustments in the scripts. Tedious work.
>>>> Tristan.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]