• Binutils

    From antispam@antispam@fricas.org (Waldek Hebisch) to comp.os.vms on Fri Aug 29 14:14:42 2025
    From Newsgroup: comp.os.vms

    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.
    --
    Waldek Hebisch
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Fri Aug 29 10:47:20 2025
    From Newsgroup: comp.os.vms

    On 8/29/2025 10:14 AM, Waldek Hebisch wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    I suspect very few try to build VMS executables on Linux.

    GNV got both ar and ld, but that does not help you.

    But are you sure you want to do it this way?

    My understanding is that you want to do:

    source-(compiler on Linux)->.obj->(ld on Linux)->VMS .exe

    I would go for:

    source-(compiler on Linux)->.obj->(LINK on VMS)->VMS .exe

    Or if possible even better:

    source-(compiler on Linux)->.s-(GCC AS on VMS)->.obj-(LINK on VMS)->VMS .exe

    GCC AS (version 2.8) is working on VMS Alpha.

    Arne




    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From cross@cross@spitfire.i.gajendra.net (Dan Cross) to comp.os.vms on Fri Aug 29 15:16:52 2025
    From Newsgroup: comp.os.vms

    In article <108sckg$19hcn$1@paganini.bofh.team>,
    Waldek Hebisch <antispam@fricas.org> wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    There is a BFD backend for VMS on Alpha in the main binutils
    branch in git, but it is not clear to me how well-tested or
    generally maintained it is, nor how compatibile with the
    standard VMS utilities it ever was; I suspect it existed
    primarily to port GNU software to VMS.

    What, exactly, are you trying to do?

    - Dan C.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From antispam@antispam@fricas.org (Waldek Hebisch) to comp.os.vms on Fri Aug 29 17:32:32 2025
    From Newsgroup: comp.os.vms

    Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 8/29/2025 10:14 AM, Waldek Hebisch wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    I suspect very few try to build VMS executables on Linux.

    GNV got both ar and ld, but that does not help you.

    Where are the sources? Working sources certainly would help.

    But are you sure you want to do it this way?

    My understanding is that you want to do:

    source-(compiler on Linux)->.obj->(ld on Linux)->VMS .exe

    I would go for:

    source-(compiler on Linux)->.obj->(LINK on VMS)->VMS .exe

    That is plan B. Working binutils would be simpler because
    I could use existing automated process.

    Actually, ATM I getting errors during gcc build. I can use
    crude workaround to go further, but I am affraid that to get
    working compiler I need either working binutils or to examine
    all build steps involving binutils and do equvalent work in
    different way.

    Or if possible even better:

    source-(compiler on Linux)->.s-(GCC AS on VMS)->.obj-(LINK on VMS)->VMS .exe

    GCC AS (version 2.8) is working on VMS Alpha.

    Actually, it is possible that I will have to use

    source-(compiler on Linux)->.s-(VMS assembler)>.obj...

    because one of next goals is to get running compiler wich generate(d)
    assembly for VMS assembler and may be incompatible with GNU as. But
    this means more changes to build process (= work work => not better).
    --
    Waldek Hebisch
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Simon Clubley@clubley@remove_me.eisner.decus.org-Earth.UFP to comp.os.vms on Fri Aug 29 17:39:56 2025
    From Newsgroup: comp.os.vms

    On 2025-08-29, Dan Cross <cross@spitfire.i.gajendra.net> wrote:
    In article <108sckg$19hcn$1@paganini.bofh.team>,
    Waldek Hebisch <antispam@fricas.org> wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    There is a BFD backend for VMS on Alpha in the main binutils
    branch in git, but it is not clear to me how well-tested or
    generally maintained it is, nor how compatibile with the
    standard VMS utilities it ever was; I suspect it existed
    primarily to port GNU software to VMS.


    AdaCore was primarily responsible for working on this as part of
    GNAT. After they dropped VMS as a supported target, this code may
    have gone stale.

    What, exactly, are you trying to do?


    I strongly suspect the OP is trying to either run more modern variants
    of languages that already exist on VMS or languages that simply do
    not yet exist on VMS.

    Simon.
    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Fri Aug 29 13:41:28 2025
    From Newsgroup: comp.os.vms

    On 8/29/2025 1:32 PM, Waldek Hebisch wrote:
    Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 8/29/2025 10:14 AM, Waldek Hebisch wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    I suspect very few try to build VMS executables on Linux.

    GNV got both ar and ld, but that does not help you.

    Where are the sources? Working sources certainly would help.

    There are the SourceForge version of GNV and there is the
    VSI version of GNV.

    The SF version is here:

    https://sourceforge.net/p/gnv/ld_tools/ci/default/tree/reference/ld_tools/

    Looks like SF GNV ld was last maintained 10 years ago.

    But heck that is way later than VMS Alpha!!

    Arne

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From antispam@antispam@fricas.org (Waldek Hebisch) to comp.os.vms on Fri Aug 29 17:50:57 2025
    From Newsgroup: comp.os.vms

    Dan Cross <cross@spitfire.i.gajendra.net> wrote:
    In article <108sckg$19hcn$1@paganini.bofh.team>,
    Waldek Hebisch <antispam@fricas.org> wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    There is a BFD backend for VMS on Alpha in the main binutils
    branch in git, but it is not clear to me how well-tested or
    generally maintained it is, nor how compatibile with the
    standard VMS utilities it ever was; I suspect it existed
    primarily to port GNU software to VMS.

    What, exactly, are you trying to do?

    Well, this is part of bigger rather poorly defined project. ATM
    I trying to compile gcc-15.1. I first build binutils, then I do

    ../gcc-15.1.0/configure --enable-languages=c,c++ --target=alpha-dec-vms --prefix=/sklad/usr
    make -j 7 > mlogg 2>&1

    There were earlier problems that I resolved. I have now trouble
    during linking of libgcc. Some problems went away after switch
    from binutils 2.43 to binutils 2.21. But now I get the following
    error:

    /sklad/usr/alpha-dec-vms/bin/ld: -shared not supported

    That is 'ld' from binutils 2.21 says that it does not support
    '-shared'. Note that Makefile wants to create 'libgcc_s.exe',
    so it knows about VMS file extentions. In other words somebody
    at least tried to make it work.

    If you want more details I can provide them, but the message
    about '-shared' appears also when I attempt to build a
    different shared image:

    /sklad/usr/alpha-dec-vms/bin/ld -shared -o pop_poll.exe pop_poll.obj

    so the problem can be reproduced outside of gcc build.
    --
    Waldek Hebisch
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Fri Aug 29 13:52:05 2025
    From Newsgroup: comp.os.vms

    On 8/29/2025 1:32 PM, Waldek Hebisch wrote:
    Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 8/29/2025 10:14 AM, Waldek Hebisch wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    But are you sure you want to do it this way?

    My understanding is that you want to do:

    source-(compiler on Linux)->.obj->(ld on Linux)->VMS .exe

    I would go for:

    source-(compiler on Linux)->.obj->(LINK on VMS)->VMS .exe

    That is plan B. Working binutils would be simpler because
    I could use existing automated process.

    But couldn't you have your existing automated process do the
    link on VMS via some fancy scripting?

    I have little faith in ld producing good VMS .exe.

    All the GCC ports to VMS I have seen (GCC 1.4x on VAX,
    GCC 2.8.x on Alpha and GNAT 2.8.x on Alpha) have used
    VMS linker. I suspect they have their reasons.

    Actually, ATM I getting errors during gcc build. I can use
    crude workaround to go further, but I am affraid that to get
    working compiler I need either working binutils or to examine
    all build steps involving binutils and do equvalent work in
    different way.

    Are you trying to get a recent GCC working on VMS?

    In that case there may be some ideas from the GNAT
    Itanium port done by the french:

    https://github.com/AdaLabs/gnat-vms

    Or if possible even better:

    source-(compiler on Linux)->.s-(GCC AS on VMS)->.obj-(LINK on VMS)->VMS .exe >>
    GCC AS (version 2.8) is working on VMS Alpha.

    Actually, it is possible that I will have to use

    source-(compiler on Linux)->.s-(VMS assembler)>.obj...

    because one of next goals is to get running compiler wich generate(d) assembly for VMS assembler and may be incompatible with GNU as. But
    this means more changes to build process (= work work => not better).

    If you can generate VMS assembler, then you are all good.

    Arne

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Fri Aug 29 13:55:11 2025
    From Newsgroup: comp.os.vms

    On 8/29/2025 1:39 PM, Simon Clubley wrote:
    On 2025-08-29, Dan Cross <cross@spitfire.i.gajendra.net> wrote:
    In article <108sckg$19hcn$1@paganini.bofh.team>,
    Waldek Hebisch <antispam@fricas.org> wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    There is a BFD backend for VMS on Alpha in the main binutils
    branch in git, but it is not clear to me how well-tested or
    generally maintained it is, nor how compatibile with the
    standard VMS utilities it ever was; I suspect it existed
    primarily to port GNU software to VMS.

    AdaCore was primarily responsible for working on this as part of
    GNAT. After they dropped VMS as a supported target, this code may
    have gone stale.
    Not just AdaCore GNAT (Ada).

    ProGIS also tried to make a business of GCC (C and C++) in the
    same time frame (25 years ago).

    Arne

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Simon Clubley@clubley@remove_me.eisner.decus.org-Earth.UFP to comp.os.vms on Fri Aug 29 17:57:19 2025
    From Newsgroup: comp.os.vms

    On 2025-08-29, Arne Vajhoj <arne@vajhoej.dk> wrote:
    On 8/29/2025 10:14 AM, Waldek Hebisch wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    I suspect very few try to build VMS executables on Linux.


    A decade ago, I got as far as getting a simple C program for VMS Alpha
    to compile and link on Linux. Anything else more complicated than that
    (ie: other languages) failed and I suspect that either bits were missing
    from the public kits or the additional steps required were not obvious.

    I discussed this at length in comp.os.vms at the time. Anyone interested
    will have to rely on the notes I posted at the time as I have completely forgotten the details of any of this (and have no motivation to get back
    up to speed on them because my hobbies these days are very different and because there's no longer a proper hobbyist licence for VMS Alpha).

    GNV got both ar and ld, but that does not help you.

    But are you sure you want to do it this way?

    My understanding is that you want to do:

    source-(compiler on Linux)->.obj->(ld on Linux)->VMS .exe

    I would go for:

    source-(compiler on Linux)->.obj->(LINK on VMS)->VMS .exe


    I strongly suspect that will not work as the VMS linker may not
    have the features needed to link those .o files.

    Or if possible even better:

    source-(compiler on Linux)->.s-(GCC AS on VMS)->.obj-(LINK on VMS)->VMS .exe


    Er, why ? If you can get the BFD library working for VMS Alpha
    once again, that's the major problem sorted.

    GCC AS (version 2.8) is working on VMS Alpha.


    Also, what makes you think that the GNU gas of that era will still
    be suitable for today's compilers ?

    Simon.
    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Simon Clubley@clubley@remove_me.eisner.decus.org-Earth.UFP to comp.os.vms on Fri Aug 29 18:05:50 2025
    From Newsgroup: comp.os.vms

    On 2025-08-29, Waldek Hebisch <antispam@fricas.org> wrote:
    Arne Vajhoj <arne@vajhoej.dk> wrote:
    On 8/29/2025 10:14 AM, Waldek Hebisch wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    I suspect very few try to build VMS executables on Linux.

    GNV got both ar and ld, but that does not help you.

    Where are the sources? Working sources certainly would help.


    Aren't they simply wrappers around the native VMS utilities ?

    But are you sure you want to do it this way?

    My understanding is that you want to do:

    source-(compiler on Linux)->.obj->(ld on Linux)->VMS .exe

    I would go for:

    source-(compiler on Linux)->.obj->(LINK on VMS)->VMS .exe

    That is plan B. Working binutils would be simpler because
    I could use existing automated process.


    Binutils worked at one time because I was able to do the whole
    sequence, including generating the final C VMS executable, on Linux.

    Actually, ATM I getting errors during gcc build. I can use
    crude workaround to go further, but I am affraid that to get
    working compiler I need either working binutils or to examine
    all build steps involving binutils and do equvalent work in
    different way.


    That's where I gave up. I either didn't understand the required
    VMS-specific build steps or there were bits missing from the public
    source kits.

    Note that I have a lot of experience building cross compilers on Linux
    for various embedded targets (including fixing various problems
    I encountered along the way), and I have never had a fraction of the
    problems I had when trying to get VMS support working.

    Simon.
    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Simon Clubley@clubley@remove_me.eisner.decus.org-Earth.UFP to comp.os.vms on Fri Aug 29 18:11:03 2025
    From Newsgroup: comp.os.vms

    On 2025-08-29, Arne Vajhoj <arne@vajhoej.dk> wrote:

    I have little faith in ld producing good VMS .exe.


    That bit worked just fine, but I don't remember if I had to fix up
    anything in the BFD librayr first. The problem seems to be that the
    current version of the BFD library has stagnated for VMS Alpha and
    appears to need bringing up to date.

    All the GCC ports to VMS I have seen (GCC 1.4x on VAX,
    GCC 2.8.x on Alpha and GNAT 2.8.x on Alpha) have used
    VMS linker. I suspect they have their reasons.


    AdaCore started with a cross compiler on Linux.

    Simon.
    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Fri Aug 29 14:13:10 2025
    From Newsgroup: comp.os.vms

    On 8/29/2025 1:57 PM, Simon Clubley wrote:
    On 2025-08-29, Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 8/29/2025 10:14 AM, Waldek Hebisch wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    But are you sure you want to do it this way?

    My understanding is that you want to do:

    source-(compiler on Linux)->.obj->(ld on Linux)->VMS .exe

    I would go for:

    source-(compiler on Linux)->.obj->(LINK on VMS)->VMS .exe

    I strongly suspect that will not work as the VMS linker may not
    have the features needed to link those .o files.

    If the .o files are not valid VMS .obj files, then it will
    not work.

    But the VMS Alpha target of gcc-as did generate valid
    VMS .obj files back in time.

    I don't see why anyone should have changed that since.

    Or if possible even better:

    source-(compiler on Linux)->.s-(GCC AS on VMS)->.obj-(LINK on VMS)->VMS .exe

    Er, why ? If you can get the BFD library working for VMS Alpha
    once again, that's the major problem sorted.

    Getting it working 100% may be a huge effort.

    Generating a text file and using the native tools on VMS
    seems much less risk and effort to me.

    GCC AS (version 2.8) is working on VMS Alpha.

    Also, what makes you think that the GNU gas of that era will still
    be suitable for today's compilers ?

    I would expect Alpha assembler to still be Alpha assembler.

    The instructions are obviously the same.

    And I find it unlikely that anyone has spend time the last 25
    years adding advanced macros and pseudo instructions to the
    Alpha assembler and the compiler.

    Given the status of Alpha.

    Arne

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Fri Aug 29 14:17:20 2025
    From Newsgroup: comp.os.vms

    On 8/29/2025 2:11 PM, Simon Clubley wrote:
    On 2025-08-29, Arne Vajh|+j <arne@vajhoej.dk> wrote:
    All the GCC ports to VMS I have seen (GCC 1.4x on VAX,
    GCC 2.8.x on Alpha and GNAT 2.8.x on Alpha) have used
    VMS linker. I suspect they have their reasons.

    AdaCore started with a cross compiler on Linux.

    But did they use ld on Linux or LINK on VMS?

    Arne




    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Simon Clubley@clubley@remove_me.eisner.decus.org-Earth.UFP to comp.os.vms on Fri Aug 29 18:28:21 2025
    From Newsgroup: comp.os.vms

    On 2025-08-29, Arne Vajhoj <arne@vajhoej.dk> wrote:
    On 8/29/2025 1:57 PM, Simon Clubley wrote:

    Also, what makes you think that the GNU gas of that era will still
    be suitable for today's compilers ?

    I would expect Alpha assembler to still be Alpha assembler.


    And are you sure that VMS gas 2.8 will support all of the following:

    https://sourceware.org/binutils/docs/as/Pseudo-Ops.html

    (Those are just the current target-neutral directives).

    The instructions are obviously the same.

    And I find it unlikely that anyone has spend time the last 25
    years adding advanced macros and pseudo instructions to the
    Alpha assembler and the compiler.


    That's not where the problem is. You need to think at a higher level
    than that. Notice that I said today's compilers which may rely on
    underlying features not present in that old VMS Alpha version of gas.

    Alpha is but one BFD target. Compilers do not talk to the VMS Alpha
    gas directly. The following may help you understand the overall flow:

    https://en.wikipedia.org/wiki/Binary_File_Descriptor_library

    Simon.
    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Fri Aug 29 14:44:06 2025
    From Newsgroup: comp.os.vms

    On 8/29/2025 2:28 PM, Simon Clubley wrote:
    On 2025-08-29, Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 8/29/2025 1:57 PM, Simon Clubley wrote:

    Also, what makes you think that the GNU gas of that era will still
    be suitable for today's compilers ?

    I would expect Alpha assembler to still be Alpha assembler.


    And are you sure that VMS gas 2.8 will support all of the following:

    https://sourceware.org/binutils/docs/as/Pseudo-Ops.html

    (Those are just the current target-neutral directives).

    The instructions are obviously the same.

    And I find it unlikely that anyone has spend time the last 25
    years adding advanced macros and pseudo instructions to the
    Alpha assembler and the compiler.

    That's not where the problem is. You need to think at a higher level
    than that. Notice that I said today's compilers which may rely on
    underlying features not present in that old VMS Alpha version of gas.

    If some of those directives was not supported in GCC 2.8 as
    and those directives are actually generated by the compiler
    for the VMS Alpha target (because they are generated on all
    target or was added to Alpha target later for the benefit
    of other OS), then GCC 2.8 as will obviously not work.

    It may still be easier to hack the compiler to not use
    those than to reverse engineer LINK though.
    Arne

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Simon Clubley@clubley@remove_me.eisner.decus.org-Earth.UFP to comp.os.vms on Fri Aug 29 18:44:38 2025
    From Newsgroup: comp.os.vms

    On 2025-08-29, Arne Vajhoj <arne@vajhoej.dk> wrote:
    On 8/29/2025 2:11 PM, Simon Clubley wrote:
    On 2025-08-29, Arne Vajhoj <arne@vajhoej.dk> wrote:
    All the GCC ports to VMS I have seen (GCC 1.4x on VAX,
    GCC 2.8.x on Alpha and GNAT 2.8.x on Alpha) have used
    VMS linker. I suspect they have their reasons.

    AdaCore started with a cross compiler on Linux.

    But did they use ld on Linux or LINK on VMS?


    From what I remember, everything was pure GNU, including the use
    of binutils, or at least it was by the time I started becoming
    interested in this.

    It's possible however that earlier efforts did involve native VMS
    tools, but by the time I became interested in building binutils/gcc
    from source the standard approach appears to have been via binutils.

    Just had a quick look and there are patch emails online
    showing AdaCore working on binutils to add and extend VMS support.

    What I can't remember is if prior to this, AdaCore had their own
    private gcc/binutils branch and if they only started pushing into
    the public branches later on. I have some vague memories in this
    area, but it's been so long ago, I could simply be wrong.

    If anyone still has it installed, does the really old GNAT 3.11/3.12p
    use ld or the VMS linker ? I know they used gas, but what about the
    final link ?

    Simon.
    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From cross@cross@spitfire.i.gajendra.net (Dan Cross) to comp.os.vms on Fri Aug 29 18:59:54 2025
    From Newsgroup: comp.os.vms

    In article <108splv$24jsc$2@dont-email.me>,
    Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote:
    On 2025-08-29, Arne Vajhoj <arne@vajhoej.dk> wrote:
    On 8/29/2025 10:14 AM, Waldek Hebisch wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    I suspect very few try to build VMS executables on Linux.


    A decade ago, I got as far as getting a simple C program for VMS Alpha
    to compile and link on Linux. Anything else more complicated than that
    (ie: other languages) failed and I suspect that either bits were missing
    from the public kits or the additional steps required were not obvious.

    I discussed this at length in comp.os.vms at the time. Anyone interested
    will have to rely on the notes I posted at the time as I have completely >forgotten the details of any of this (and have no motivation to get back
    up to speed on them because my hobbies these days are very different and >because there's no longer a proper hobbyist licence for VMS Alpha).

    GNV got both ar and ld, but that does not help you.

    But are you sure you want to do it this way?

    My understanding is that you want to do:

    source-(compiler on Linux)->.obj->(ld on Linux)->VMS .exe

    I would go for:

    source-(compiler on Linux)->.obj->(LINK on VMS)->VMS .exe

    I strongly suspect that will not work as the VMS linker may not
    have the features needed to link those .o files.

    What features? Presumably the `.o` files generated are actually
    VMS `.OBJ` files. I suppose the compiler could generate generic
    ELF or COFF or a.out objects for Alpha, and then rely on GNU LD
    to do the right thing and convert them to a properly linked VMS
    executable, but that seems a rather roundabout way to go.

    Or if possible even better:

    source-(compiler on Linux)->.s-(GCC AS on VMS)->.obj-(LINK on VMS)->VMS .exe

    Er, why ? If you can get the BFD library working for VMS Alpha
    once again, that's the major problem sorted.

    GCC AS (version 2.8) is working on VMS Alpha.

    Also, what makes you think that the GNU gas of that era will still
    be suitable for today's compilers ?

    I'd be rather surprised if much had changed in that department.

    - Dan C.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Fri Aug 29 15:02:21 2025
    From Newsgroup: comp.os.vms

    On 8/29/2025 2:44 PM, Simon Clubley wrote:
    If anyone still has it installed, does the really old GNAT 3.11/3.12p
    use ld or the VMS linker ? I know they used gas, but what about the
    final link ?

    I have Gnat 3.12p / GCC 2.8.1 installed.

    I think it uses LINK.

    <quote>
    $ gnat make
    List of available qualifiers and options

    GNAT MAKE file /qualifiers (includes COMPILE /qualifiers)
    gnatmake
    ...
    /LINKER_QUALIFIERS (switches for LINK) -largs switches
    ...
    </quote>

    It mentions LINK.

    <quote>
    $ gnat make hello /verbose

    GNATMAKE 3.12p (19990629) Copyright 1995-1999 Free Software Foundation,
    Inc.
    "hello.ali" being checked ...
    -> "hello.ali" missing.
    gcc -c hello.adb
    gnatbind -x hello.ali
    gnatlink hello.ali
    GNU:[LIB]CRT0.OBJ
    DISK2:[ARNE]B$HELLO.OBJ
    DISK2:[]HELLO.OBJ
    GNU:[LIB.OPENVMS7_1.2_8_1.DECLIB]LIBDECGNAT.OLB/library GNU:[LIB.OPENVMS7_1.2_8_1.ADALIB]LIBGNAT.EXE/shareable GNU:[LIB]LIBGCC.OLB/library
    sys$library:vaxcrtltx.olb/library
    GNU:[LIB]LIBGCC.OLB/library
    </quote>

    That looks very much like VMS LINK option format.

    Arne


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Simon Clubley@clubley@remove_me.eisner.decus.org-Earth.UFP to comp.os.vms on Fri Aug 29 19:10:05 2025
    From Newsgroup: comp.os.vms

    On 2025-08-29, Arne Vajhoj <arne@vajhoej.dk> wrote:
    On 8/29/2025 2:44 PM, Simon Clubley wrote:
    If anyone still has it installed, does the really old GNAT 3.11/3.12p
    use ld or the VMS linker ? I know they used gas, but what about the
    final link ?

    I have Gnat 3.12p / GCC 2.8.1 installed.

    I think it uses LINK.

    <quote>
    $ gnat make
    List of available qualifiers and options

    GNAT MAKE file /qualifiers (includes COMPILE /qualifiers)
    gnatmake
    ...
    /LINKER_QUALIFIERS (switches for LINK) -largs switches
    ...
    </quote>

    It mentions LINK.


    Interesting thanks. Does the "ld" binary exist in whatever the binutils executables directory is ?

    If it does, and you run it as a foreign command with "--help", what
    output do you get ?

    Simon.
    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Fri Aug 29 15:14:25 2025
    From Newsgroup: comp.os.vms

    On 8/29/2025 3:10 PM, Simon Clubley wrote:
    On 2025-08-29, Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 8/29/2025 2:44 PM, Simon Clubley wrote:
    If anyone still has it installed, does the really old GNAT 3.11/3.12p
    use ld or the VMS linker ? I know they used gas, but what about the
    final link ?

    I have Gnat 3.12p / GCC 2.8.1 installed.

    I think it uses LINK.

    <quote>
    $ gnat make
    List of available qualifiers and options

    GNAT MAKE file /qualifiers (includes COMPILE /qualifiers)
    gnatmake
    ...
    /LINKER_QUALIFIERS (switches for LINK) -largs switches
    ...
    </quote>

    It mentions LINK.


    Interesting thanks. Does the "ld" binary exist in whatever the binutils executables directory is ?

    If it does, and you run it as a foreign command with "--help", what
    output do you get ?

    Nothing with ld.

    $ dir gnu:[bin]

    Directory GNU:[BIN]

    AS.EXE;10 ASISTANT.EXE;1 GCC.EXE;1 GNAT.EXE;1 GNATBIND.EXE;1 GNATBL.EXE;1 GNATCHOP.EXE;2 GNATELIM.EXE;1 GNATFIND.EXE;1 GNATKR.EXE;1 GNATLBR.EXE;1 GNATLINK.EXE;1 GNATLS.EXE;1 GNATMAKE.EXE;1 GNATMEM.EXE;1 GNATPREP.EXE;1 GNATPSTA.EXE;1 GNATPSYS.EXE;1 GNATSTUB.EXE;1 GNATXREF.EXE;1 MAKE.EXE;260 OPENVMS7_1-GCC.EXE;1 SET_EXE.COM;11

    $ dir gnu:[bin]*ld*.*
    %DIRECT-W-NOFILES, no files found

    Arne


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Fri Aug 29 15:18:44 2025
    From Newsgroup: comp.os.vms

    On 8/29/2025 3:14 PM, Arne Vajh|+j wrote:
    On 8/29/2025 3:10 PM, Simon Clubley wrote:
    On 2025-08-29, Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 8/29/2025 2:44 PM, Simon Clubley wrote:
    If anyone still has it installed, does the really old GNAT 3.11/3.12p
    use ld or the VMS linker ? I know they used gas, but what about the
    final link ?

    I have Gnat 3.12p / GCC 2.8.1 installed.

    I think it uses LINK.

    <quote>
    $ gnat make
    List of available qualifiers and options

    GNAT MAKE file /qualifiers (includes COMPILE /qualifiers)
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a gnatmake
    -a-a-a-a ...
    -a-a-a-a /LINKER_QUALIFIERS (switches for LINK)-a-a-a-a-a-a-a-a-a-a -largs switches
    -a-a-a-a ...
    </quote>

    It mentions LINK.


    Interesting thanks. Does the "ld" binary exist in whatever the binutils
    executables directory is ?

    If it does, and you run it as a foreign command with "--help", what
    output do you get ?

    Nothing with ld.

    $ dir gnu:[bin]

    Directory GNU:[BIN]

    AS.EXE;10-a-a-a-a-a-a-a-a-a-a ASISTANT.EXE;1-a-a-a-a-a GCC.EXE;1-a-a-a-a-a-a-a-a-a-a GNAT.EXE;1
    GNATBIND.EXE;1-a-a-a-a-a GNATBL.EXE;1-a-a-a-a-a-a-a GNATCHOP.EXE;2-a-a-a-a-a GNATELIM.EXE;1
    GNATFIND.EXE;1-a-a-a-a-a GNATKR.EXE;1-a-a-a-a-a-a-a GNATLBR.EXE;1-a-a-a-a-a-a GNATLINK.EXE;1
    GNATLS.EXE;1-a-a-a-a-a-a-a GNATMAKE.EXE;1-a-a-a-a-a GNATMEM.EXE;1-a-a-a-a-a-a GNATPREP.EXE;1
    GNATPSTA.EXE;1-a-a-a-a-a GNATPSYS.EXE;1-a-a-a-a-a GNATSTUB.EXE;1-a-a-a-a-a GNATXREF.EXE;1
    MAKE.EXE;260-a-a-a-a-a-a-a OPENVMS7_1-GCC.EXE;1-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a SET_EXE.COM;11

    $ dir gnu:[bin]*ld*.*
    %DIRECT-W-NOFILES, no files found

    $ link=="XXXX"
    $ link
    %DCL-W-IVVERB, unrecognized command verb - check validity and spelling
    \XXXX\
    $ gnat make hello
    gcc -c hello.adb
    gnatbind -x hello.ali
    gnatlink hello.ali
    %DCL-W-IVVERB, unrecognized command verb - check validity and spelling
    \XXXX\
    gnatmake: *** link failed.

    Arne

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From cross@cross@spitfire.i.gajendra.net (Dan Cross) to comp.os.vms on Fri Aug 29 19:28:38 2025
    From Newsgroup: comp.os.vms

    In article <108sp9v$1a4ae$2@paganini.bofh.team>,
    Waldek Hebisch <antispam@fricas.org> wrote:
    Dan Cross <cross@spitfire.i.gajendra.net> wrote:
    In article <108sckg$19hcn$1@paganini.bofh.team>,
    Waldek Hebisch <antispam@fricas.org> wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    There is a BFD backend for VMS on Alpha in the main binutils
    branch in git, but it is not clear to me how well-tested or
    generally maintained it is, nor how compatibile with the
    standard VMS utilities it ever was; I suspect it existed
    primarily to port GNU software to VMS.

    What, exactly, are you trying to do?

    Well, this is part of bigger rather poorly defined project. ATM
    I trying to compile gcc-15.1.

    That's a pretty big project in itself. I expect, as others have
    noted and I mentioned earlier, that the port to VMS has fallen
    into disrepair. Getting it back up to snuff will likely be
    hard.

    I first build binutils, then I do

    ../gcc-15.1.0/configure --enable-languages=c,c++ --target=alpha-dec-vms --prefix=/sklad/usr
    make -j 7 > mlogg 2>&1

    There were earlier problems that I resolved. I have now trouble
    during linking of libgcc. Some problems went away after switch
    from binutils 2.43 to binutils 2.21. But now I get the following
    error:

    /sklad/usr/alpha-dec-vms/bin/ld: -shared not supported

    That is 'ld' from binutils 2.21 says that it does not support
    '-shared'. Note that Makefile wants to create 'libgcc_s.exe',
    so it knows about VMS file extentions. In other words somebody
    at least tried to make it work.

    It definitely ran on VMS in the past. I don't think anyone has
    actively tried to remove VMS support. So it's very likely you
    are getting the vestigal remnants on that prior porting effort,
    along with a lot of what one might refer to as "soft" bugs; that
    is, things that are not outright _wrong_ in the code, but which
    exhibit incorrect behavior on VMS because no one has been
    actively maintaining the GCC VMS port.

    If you want more details I can provide them, but the message
    about '-shared' appears also when I attempt to build a
    different shared image:

    /sklad/usr/alpha-dec-vms/bin/ld -shared -o pop_poll.exe pop_poll.obj

    so the problem can be reproduced outside of gcc build.

    I mean, in a way the meaning of the message is obvious: that
    flag is not supported on the version of binutils you built for
    VMS. Merely getting confirmation of that is unlikely to yield
    much in the way of insightful new information, as it says it
    right on the tin.

    The more pressing question is *why* is the flag unsupported?
    Figure that out and you'll likely unlock the entire thing.

    - Dan C.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Sat Aug 30 16:55:23 2025
    From Newsgroup: comp.os.vms

    On 8/29/2025 1:50 PM, Waldek Hebisch wrote:
    There were earlier problems that I resolved. I have now trouble
    during linking of libgcc. Some problems went away after switch
    from binutils 2.43 to binutils 2.21. But now I get the following
    error:

    /sklad/usr/alpha-dec-vms/bin/ld: -shared not supported

    That is 'ld' from binutils 2.21 says that it does not support
    '-shared'. Note that Makefile wants to create 'libgcc_s.exe',
    so it knows about VMS file extentions. In other words somebody
    at least tried to make it work.

    If you want more details I can provide them, but the message
    about '-shared' appears also when I attempt to build a
    different shared image:

    /sklad/usr/alpha-dec-vms/bin/ld -shared -o pop_poll.exe pop_poll.obj

    so the problem can be reproduced outside of gcc build.

    https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/vms-alpha.c;h=c4b248494ee624f7b1d6acbf45065469cda7c682;hb=HEAD

    says:

    <quote>
    /* vms.c -- BFD back-end for EVAX (openVMS/Alpha) files.
    Copyright (C) 1996-2025 Free Software Foundation, Inc.

    Initial version written by Klaus Kaempf (kkaempf@rmi.de)
    Major rewrite by Adacore.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
    MA 02110-1301, USA. */

    /* TODO:
    o overlayed sections
    o PIC
    o Generation of shared image
    o Relocation optimizations
    o EISD for the stack
    o Vectors isect
    o 64 bits sections
    o Entry point
    o LIB$INITIALIZE
    o protected sections (for messages)
    ...
    */
    </quote>

    It is on the TODO list.

    Which of course does not help you much.

    Arne

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@arne@vajhoej.dk to comp.os.vms on Sat Aug 30 17:09:21 2025
    From Newsgroup: comp.os.vms

    On 8/29/2025 1:57 PM, Simon Clubley wrote:
    On 2025-08-29, Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 8/29/2025 10:14 AM, Waldek Hebisch wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    I suspect very few try to build VMS executables on Linux.


    A decade ago, I got as far as getting a simple C program for VMS Alpha
    to compile and link on Linux. Anything else more complicated than that
    (ie: other languages) failed and I suspect that either bits were missing
    from the public kits or the additional steps required were not obvious.

    I discussed this at length in comp.os.vms at the time. Anyone interested
    will have to rely on the notes I posted at the time as I have completely forgotten the details of any of this (and have no motivation to get back
    up to speed on them because my hobbies these days are very different and because there's no longer a proper hobbyist licence for VMS Alpha).

    I did the search:

    https://groups.google.com/g/comp.os.vms/c/KN9yqM7_8PU/m/T4xwyTz5A3oJ

    https://groups.google.com/g/comp.os.vms/c/S7-VwQmmOZU/m/LXQ2TrbCBAAJ

    https://groups.google.com/g/comp.os.vms/c/oSNzXLKeu4o/m/8Tq5dIFaDAAJ

    Arne

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From antispam@antispam@fricas.org (Waldek Hebisch) to comp.os.vms on Sun Aug 31 02:05:24 2025
    From Newsgroup: comp.os.vms

    Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 8/29/2025 1:32 PM, Waldek Hebisch wrote:
    Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 8/29/2025 10:14 AM, Waldek Hebisch wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    I suspect very few try to build VMS executables on Linux.

    GNV got both ar and ld, but that does not help you.

    Where are the sources? Working sources certainly would help.

    There are the SourceForge version of GNV and there is the
    VSI version of GNV.

    The SF version is here:

    https://sourceforge.net/p/gnv/ld_tools/ci/default/tree/reference/ld_tools/

    Thanks. AFAICS main work is done by VMS binaries, so it does not
    help in my immediate problem, but it contains interesting information.
    --
    Waldek Hebisch
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From antispam@antispam@fricas.org (Waldek Hebisch) to comp.os.vms on Sun Aug 31 02:35:52 2025
    From Newsgroup: comp.os.vms

    Simon Clubley <clubley@remove_me.eisner.decus.org-earth.ufp> wrote:
    On 2025-08-29, Waldek Hebisch <antispam@fricas.org> wrote:
    Arne Vajh|+j <arne@vajhoej.dk> wrote:
    On 8/29/2025 10:14 AM, Waldek Hebisch wrote:
    I wonder if anybody is using GNU binutils targeting VMS. I am
    trying to set up toolchain for cross-compilation (from Linux) to
    Alpha VMS. Trying reasonably recent (2.43 and 2.39) binutils I
    get errors suggesting serious brokennes, for example when I use
    'ar' to create a library and later extract a member I get changed
    file and 'objdump' says that extracted file is malformed.

    I am now trying binutils 2.21 and apparently they do not have the
    problem above. But I see some weirdness and apparently '-shared'
    option (to create shared image) is not supported.

    I suspect very few try to build VMS executables on Linux.

    GNV got both ar and ld, but that does not help you.

    Where are the sources? Working sources certainly would help.


    Aren't they simply wrappers around the native VMS utilities ?

    Unfortunately yes.

    But are you sure you want to do it this way?

    My understanding is that you want to do:

    source-(compiler on Linux)->.obj->(ld on Linux)->VMS .exe

    I would go for:

    source-(compiler on Linux)->.obj->(LINK on VMS)->VMS .exe

    That is plan B. Working binutils would be simpler because
    I could use existing automated process.


    Binutils worked at one time because I was able to do the whole
    sequence, including generating the final C VMS executable, on Linux.

    Thanks, good to know this.

    Actually, ATM I getting errors during gcc build. I can use
    crude workaround to go further, but I am affraid that to get
    working compiler I need either working binutils or to examine
    all build steps involving binutils and do equvalent work in
    different way.


    That's where I gave up. I either didn't understand the required
    VMS-specific build steps or there were bits missing from the public
    source kits.

    There are missing pieces, build needs VMS header files and libraries.
    If those pieces are incomplete, then configuration may go wrong
    and lead to trobles later.

    Currently I have fairly incomplete set of header files, so I expect
    trouble due to this. OTOH libgcc seem to compile fine, so C
    compiler probably will work. I worked around trouble with
    shared images by configuring gcc with '--disable-shared',
    suboptimal but must do for now.
    --
    Waldek Hebisch
    --- Synchronet 3.21a-Linux NewsLink 1.2