Re: configure: error: in `/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/alpha-unknown-openbsd7.8/libgomp'

Dennis Clarke via Gcc-help <[email protected]> Sun, 12 Apr 2026 09:06:09 -0400
Newsgroups gmane.comp.gcc.help
Organization GENUNIX
Message-ID <[email protected]>
On 4/12/26 06:19, Basile Starynkevitch wrote:
 > On Fri, 2026-04-10 at 15:01 -0400, Dennis Clarke via Gcc-help wrote:
 >>
 >> Well this is now past the point of annoying in that I really do not
 >> know
 >> why GNU ld can not locate crt1.o for GNU OpenMP Runtime Library. Seen
 >> in
 >> stage1 bootstrap for libgomp :
 >>
<snip>
 >
 > Did you try some LD_LIBRARY_PATH setting, some tuning of
 > /etc/ld.so.conf before running configure?

Never. No way.

 >
 > What exactly are your options to configure?
centauri$ date -u
Fri Apr 10 08:13:30 UTC 2026
centauri$
centauri$ ../gcc-4.7.4/configure --prefix=/opt/bw/imed/gcc4 \
 > --build=alpha-unknown-openbsd7.8 \
 > --host=alpha-unknown-openbsd7.8 \
 > --target=alpha-unknown-openbsd7.8 \
 > --disable-nls --disable-multilib \
 > --with-gnu-as --with-as=/usr/bin/as \
 > --with-gnu-ld --with-ld=/usr/bin/ld \
 > --enable-threads=posix --enable-shared \
 > --with-cpu=21164 \
 > --enable-languages=c,c++,fortran \
 > --enable-stage1-languages=c

However that will not help you. The linker will never find the files
needed for C runtime init/end. Not unless some patches are applied into
the GCC sources *and* that *may* not work either. Maybe.

 >
 > Or add some verbose flag for the linker?
 >
 > Regards
 >
 >

The problem is GCC does not have the correct patches upstream to
allow GCC to bootstrap and work on OpenBSD 7.8  :

1) 
https://cvsweb.openbsd.org/checkout/ports/lang/bootgcc/patches/patch-gcc_config_alpha_openbsd_h

2) 
https://cvsweb.openbsd.org/checkout/ports/lang/bootgcc/patches/patch-gcc_config_alpha_alpha_c

3) 
https://cvsweb.openbsd.org/checkout/ports/lang/bootgcc/patches/patch-gcc_config_alpha_alpha_md

4) 
https://cvsweb.openbsd.org/checkout/ports/lang/bootgcc/patches/patch-gcc_config_alpha_alpha_opt

Certainly not for an Alpha based chunk of hardware.

A custom linker script may be needed also. The binutils as assembler
works like a charm :

centauri$ /opt/bw/imed/bin/as --version
GNU assembler (GENUNIX Fri Apr 10 19:27:17 UTC 2026) 2.46.0.20260210
Copyright (C) 2026 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `alpha-unknown-openbsd7.8'.

The linker, without some custom link script will always fail. This has
been looked at over and over and over ad nauseum by myself and others
for the past week. One may perform *trivial* tests to confirm :

   ------------------  PROOF ------------------

1.0) the machine is running fine and nice and stable

alpha$ uptime
12:05PM  up 21 days, 22:40, 5 users, load averages: 0.00, 0.00, 0.00

1.1) the machine is running OpenBSD 7.8

alpha$ uname -a
OpenBSD centauri.bw.genunix.com 7.8 GENERIC#628 alpha

1.2) plenty of memory for the task at hand

alpha$ sysctl hw.physmem
hw.physmem=1071464448

alpha$ sysctl hw.model
hw.model=Digital AlphaStation 600 5/266

alpha$ vmstat -s
        8192 bytes per page
      127463 pages managed
       85093 pages free
        4077 pages active
        7285 pages inactive
           0 pages being paged out
           2 pages wired
       10594 pages zeroed
           4 pages reserved for pagedaemon
           8 pages reserved for kernel
           0 pages in per-cpu caches
           0 per-cpu cache hits
           0 per-cpu cache misses
      262143 swap pages
        3522 swap pages in use
   751168742 page faults
   935800308 traps
  1956724894 interrupts
   116082262 cpu context switches
    22017491 fpu context switches
   244825957 software interrupts
   529466676 syscalls
        1901 pagein operations
     2794747 forks
       11352 forks where vmspace is shared
          10 kernel map entries
   276756190 zeroed page hits
    33091170 zeroed page misses
        4288 number of times the pagedaemon woke up
        4283 number of times the pagedaemon scanned for free pages
       31405 pages freed by pagedaemon
       58476 pages scanned by pagedaemon
           0 pages reactivated by pagedaemon
           0 busy pages found by pagedaemon
   208324099 total name lookups
             cache hits (83% pos + 8% neg) system 0% per-directory
             deletions 0%, falsehits 0%, toolong 3%
alpha$


-------------- does the GCC 4.7.4 compiler work at all ?

2.0) the GCC stage 1 bootstrap of 4.7.4 does seems to sort of work
      with a resultant binary in the $BUILD_DIR/gcc PATH :

alpha$ BUILD_DIR=/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002
alpha$ export BUILD_DIR

alpha$ $BUILD_DIR/gcc/xgcc --version
xgcc (GENUNIX Fri Apr 10 08:18:30 UTC 2026) 4.7.4
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

alpha$

------------------- trivial code test

3.0)

alpha$ cat hello.c

#include <stdio.h>
#include <stdlib.h>

int
main ( int argc, char **argv )
{
     int j = 314159265;

     fprintf(stderr,"hello and this is not pi = %i\n", j);

     return EXIT_SUCCESS;
}

3.1) try to translate from C to assembly with the 4.7.4 compiler

alpha$ PATH=$BUILD_DIR/gcc:$PATH xgcc -v -std=iso9899:1999 \
 > -O0 -mcpu=21164 -mexplicit-relocs \
 > -S -o hello.s hello.c
Using built-in specs.
COLLECT_GCC=xgcc
Target: alpha-unknown-openbsd7.8
Configured with: ../gcc-4.7.4/configure --prefix=/opt/bw/imed/gcc4 
--build=alpha-unknown-openbsd7.8 --host=alpha-unknown-openbsd7.8 
--target=alpha-unknown-openbsd7.8 --disable-nls --disable-multilib 
--with-gnu-as --with-as=/usr/bin/as --with-gnu-ld --with-ld=/usr/bin/ld 
--enable-threads=posix --enable-shared --with-cpu=21164 
--enable-languages=c,c++,fortran --enable-stage1-languages=c 
--with-pkgversion='GENUNIX Fri Apr 10 08:18:30 UTC 2026'
Thread model: posix
gcc version 4.7.4 (GENUNIX Fri Apr 10 08:18:30 UTC 2026)
COLLECT_GCC_OPTIONS='-v' '-std=c99' '-O0' '-mcpu=21164' 
'-mexplicit-relocs' '-S' '-o' 'hello.s'
  cc1 -quiet -v -iprefix 
/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/gcc/../lib/gcc/alpha-unknown-openbsd7.8/4.7.4/ 
hello.c -quiet -dumpbase hello.c -mcpu=21164 -mexplicit-relocs 
-auxbase-strip hello.s -O0 -std=c99 -version -o hello.s
GNU C (GENUNIX Fri Apr 10 08:18:30 UTC 2026) version 4.7.4 
(alpha-unknown-openbsd7.8)
         compiled by GNU C version 4.2.1 20070719 , GMP version 4.3.2, 
MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory 
"/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/gcc/../lib/gcc/alpha-unknown-openbsd7.8/4.7.4/include"
ignoring nonexistent directory 
"/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/gcc/../lib/gcc/alpha-unknown-openbsd7.8/4.7.4/include-fixed"
ignoring nonexistent directory 
"/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/gcc/../lib/gcc/alpha-unknown-openbsd7.8/4.7.4/../../../../alpha-unknown-openbsd7.8/include"
ignoring nonexistent directory 
"/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/gcc/../lib/gcc/../../lib/gcc/alpha-unknown-openbsd7.8/4.7.4/include"
ignoring nonexistent directory 
"/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/gcc/../lib/gcc/../../include"
ignoring nonexistent directory 
"/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/gcc/../lib/gcc/../../lib/gcc/alpha-unknown-openbsd7.8/4.7.4/include-fixed"
ignoring nonexistent directory 
"/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/gcc/../lib/gcc/../../lib/gcc/alpha-unknown-openbsd7.8/4.7.4/../../../../alpha-unknown-openbsd7.8/include"
#include "..." search starts here:
#include <...> search starts here:
  /usr/local/include
  /usr/include
End of search list.
GNU C (GENUNIX Fri Apr 10 08:18:30 UTC 2026) version 4.7.4 
(alpha-unknown-openbsd7.8)
         compiled by GNU C version 4.2.1 20070719 , GMP version 4.3.2, 
MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 55fe7a1840987eba49d8b369575dc856
COMPILER_PATH=
LIBRARY_PATH=/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-std=c99' '-O0' '-mcpu=21164' 
'-mexplicit-relocs' '-S' '-o' 'hello.s'
alpha$

3.2) look at the output asm

alpha$ nl -ba -nrz hello.s
000001          .set noreorder
000002          .set volatile
000003          .set noat
000004          .set nomacro
000005          .arch ev5
000006          .section        .rodata
000007  $LC0:
000008          .ascii "hello and this is not pi = %i\12\0"
000009          .text
000010          .align 2
000011          .globl  main
000012          .ent main
000013  main:
000014          .frame $15,48,$26,0
000015          .mask 0x4008000,-48
000016          ldah $29,0($27)         !gpdisp!1
000017          lda $29,0($29)          !gpdisp!1
000018  $main..ng:
000019          lda $30,-48($30)
000020          stq $26,0($30)
000021          stq $15,8($30)
000022          bis $31,$30,$15
000023          .prologue 1
000024          mov $16,$1
000025          stq $17,40($15)
000026          stl $1,32($15)
000027          ldah $1,4794($31)
000028          lda $1,-20319($1)
000029          stl $1,16($15)
000030          ldl $1,16($15)
000031          ldq $16,__stderr($29)           !literal
000032          ldah $2,$LC0($29)               !gprelhigh
000033          lda $17,$LC0($2)                !gprellow
000034          mov $1,$18
000035          ldq $27,fprintf($29)            !literal!2
000036          jsr $26,($27),0         !lituse_jsr!2
000037          ldah $29,0($26)         !gpdisp!3
000038          lda $29,0($29)          !gpdisp!3
000039          mov $31,$1
000040          mov $1,$0
000041          mov $15,$30
000042          ldq $26,0($30)
000043          ldq $15,8($30)
000044          lda $30,48($30)
000045          ret $31,($26),1
000046          .end main
000047          .ident  "GCC: (GENUNIX Fri Apr 10 08:18:30 UTC 2026) 4.7.4"
alpha$

Please note the arch EV5 above. This machine will *never* run Linux.

4.0) use the binutils 2.46 assembler

alpha$ /opt/bw/imed/bin/as --version
GNU assembler (GENUNIX Fri Apr 10 19:27:17 UTC 2026) 2.46.0.20260210
Copyright (C) 2026 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `alpha-unknown-openbsd7.8'.
alpha$

alpha$ /opt/bw/imed/bin/as -v -no-mdebug -o hello.o hello.s
GNU assembler version 2.46.0 (alpha-unknown-openbsd7.8) using BFD 
version (GENUNIX Fri Apr 10 19:27:17 UTC 2026) 2.46.0.20260210
alpha$ echo $?
0

alpha$ ls -l hello.o
-rw-r--r--  1 dclarke  devl  1624 Apr 12 12:35 hello.o

    ----------------- watch GNU Binutils 2.46 fail as-is

5.0) try to use the GNU binutils 2.46 linker

alpha$ /opt/bw/imed/bin/ld --version
GNU ld (GENUNIX Fri Apr 10 19:27:17 UTC 2026) 2.46.0.20260210
Copyright (C) 2026 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later 
version.
This program has absolutely no warranty.


alpha$ /opt/bw/imed/bin/ld hello.o /usr/lib/crt0.o /usr/lib/crtbegin.o \
 > /usr/lib/crtend.o /usr/lib/libc.so.102.0 \
 > $BUILD_DIR/gcc/libgcc.a
/opt/bw/imed/bin/ld: warning: cannot find entry symbol _start; 
defaulting to 0000000120000450
alpha$

Clearly we have a C runtime init problem here. Among others.

So this a show stopper and yes the GCC bootstrap process makes the same
mistakes unless there are patches applied to the GCC sourcetree
  AND maybe even a custom linker script for the GNU binutils.

No amount of gymnastics will allow that new binutils linker to work
and neither will the system provided linker within the GCC bootstrap
process.

5.1) new binutils 2.46 linker will fail EVEN with the correct libgcc.a

alpha$ /opt/bw/imed/bin/ld hello.o /usr/lib/crt0.o /usr/lib/crtbegin.o \
 > /usr/lib/crtend.o /usr/lib/libc.so.102.0 \
 > /usr/lib/gcc-lib/alpha-unknown-openbsd7.8/4.2.1/libgcc.a --verbose
GNU ld (GENUNIX Fri Apr 10 19:27:17 UTC 2026) 2.46.0.20260210
   Supported emulations:
    elf64alpha
using internal linker script:
==================================================
/* Script for -z combreloc */
/* Copyright (C) 2014-2026 Free Software Foundation, Inc.
    Copying and distribution of this script, with or without modification,
    are permitted in any medium without royalty provided the copyright
    notice and this notice are preserved.  */
OUTPUT_FORMAT("elf64-alpha", "elf64-alpha", "elf64-alpha")
OUTPUT_ARCH(alpha)
ENTRY(_start)
SEARCH_DIR("/opt/bw/imed/alpha-unknown-openbsd7.8/lib"); 
SEARCH_DIR("/opt/bw/imed/lib"); SEARCH_DIR("/usr/local/lib"); 
SEARCH_DIR("/usr/ccs/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
SECTIONS
{
   /* Read-only sections, merged into text segment: */
   PROVIDE (__executable_start = SEGMENT_START("text-segment", 
0x120000000));
   . = SEGMENT_START("text-segment", 0x120000000) + SIZEOF_HEADERS;
   /* Place the build-id as close to the ELF headers as possible.  This
      maximises the chance the build-id will be present in core files,
      which GDB can then use to locate the associated debuginfo file.  */
   .note.gnu.build-id  : { *(.note.gnu.build-id) }
   .interp         : { *(.interp) }
   .hash           : { *(.hash) }
   .gnu.hash       : { *(.gnu.hash) }
   .dynsym         : { *(.dynsym) }
   .dynstr         : { *(.dynstr) }
   .gnu.version    : { *(.gnu.version) }
   .gnu.version_d  : { *(.gnu.version_d) }
   .gnu.version_r  : { *(.gnu.version_r) }
   .rela.dyn       :
     {
       *(.rela.init)
       *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
       *(.rela.fini)
       *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
       *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
       *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
       *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
       *(.rela.ctors)
       *(.rela.dtors)
       *(.rela.got)
       *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
       *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
       *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
       *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
       *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
       PROVIDE_HIDDEN (__rela_iplt_start = .);
       *(.rela.iplt)
       PROVIDE_HIDDEN (__rela_iplt_end = .);
     }
   .rela.plt       :
     {
       *(.rela.plt)
     }
   /* Start of the executable code region.  */
   .init           :
   {
     KEEP (*(SORT_NONE(.init)))
   } =0x0000fe2f1f04ff47
   .plt            : SPECIAL { *(.plt) }
   .text           :
   {
     *(.text.unlikely .text.*_unlikely .text.unlikely.*)
     *(.text.exit .text.exit.*)
     *(.text.startup .text.startup.*)
     *(.text.hot .text.hot.*)
     *(SORT(.text.sorted.*))
     *(.text .stub .text.* .gnu.linkonce.t.*)
     /* .gnu.warning sections are handled specially by elf.em.  */
     *(.gnu.warning)
   } =0x0000fe2f1f04ff47
   .fini           :
   {
     KEEP (*(SORT_NONE(.fini)))
   } =0x0000fe2f1f04ff47
   PROVIDE (__etext = .);
   PROVIDE (_etext = .);
   PROVIDE (etext = .);
   /* Start of the Read Only Data region.  */
   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
   .rodata1        : { *(.rodata1) }
   .sdata2         :
   {
     *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
   }
   .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
   .reginfo        : { *(.reginfo) }
   .eh_frame_hdr   : { *(.eh_frame_hdr) *(.eh_frame_entry 
.eh_frame_entry.*) }
   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
   .sframe         : ONLY_IF_RO { KEEP (*(.sframe)) *(.sframe.*) }
   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table 
.gcc_except_table.*) }
   .gnu_extab   : ONLY_IF_RO { *(.gnu_extab*) }
   /* These sections are generated by the Sun/Oracle C++ compiler.  */
   .exception_ranges   : ONLY_IF_RO { *(.exception_ranges*) }
   /* Various note sections.  Placed here so that they are always included
      in the read-only segment and not treated as orphan sections.  The
      current orphan handling algorithm does place note sections after R/O
      data, but this is not guaranteed to always be the case.  */
   .note.build-id :      { *(.note.build-id) }
   .note.GNU-stack :     { *(.note.GNU-stack) }
   .note.gnu.property :  { *(.note.gnu.property) }
   .note.ABI-tag :       { *(.note.ABI-tag) }
   .note.package :       { *(.note.package) }
   .note.dlopen :        { *(.note.dlopen) }
   .note.netbsd.ident :  { *(.note.netbsd.ident) }
   .note.openbsd.ident : { *(.note.openbsd.ident) }
   /* Start of the Read Write Data region.  */
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
   . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT 
(COMMONPAGESIZE));
   /* Exception handling.  */
   .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
   .sframe         : ONLY_IF_RW { KEEP (*(.sframe)) *(.sframe.*) }
   .gnu_extab      : ONLY_IF_RW { *(.gnu_extab) }
   .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table 
.gcc_except_table.*) }
   .exception_ranges   : ONLY_IF_RW { *(.exception_ranges*) }
   /* Thread Local Storage sections.  */
   .tdata          :
    {
      PROVIDE_HIDDEN (__tdata_start = .);
      *(.tdata .tdata.* .gnu.linkonce.td.*)
    }
   .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
   .preinit_array    :
   {
     PROVIDE_HIDDEN (__preinit_array_start = .);
     KEEP (*(.preinit_array))
     PROVIDE_HIDDEN (__preinit_array_end = .);
   }
   .init_array    :
   {
     PROVIDE_HIDDEN (__init_array_start = .);
     KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) 
SORT_BY_INIT_PRIORITY(.ctors.*)))
     KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o 
*crtend.o *crtend?.o ) .ctors))
     PROVIDE_HIDDEN (__init_array_end = .);
   }
   .fini_array    :
   {
     PROVIDE_HIDDEN (__fini_array_start = .);
     KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) 
SORT_BY_INIT_PRIORITY(.dtors.*)))
     KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o 
*crtend.o *crtend?.o ) .dtors))
     PROVIDE_HIDDEN (__fini_array_end = .);
   }
   .ctors          :
   {
     /* gcc uses crtbegin.o to find the start of
        the constructors, so we make sure it is
        first.  Because this is a wildcard, it
        doesn't matter if the user does not
        actually link against crtbegin.o; the
        linker won't look for a file to match a
        wildcard.  The wildcard also means that it
        doesn't matter which directory crtbegin.o
        is in.  */
     KEEP (*crtbegin.o(.ctors))
     KEEP (*crtbegin?.o(.ctors))
     /* We don't want to include the .ctor section from
        the crtend.o file until after the sorted ctors.
        The .ctor section from the crtend file contains the
        end of ctors marker and it must be last */
     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
     KEEP (*(SORT(.ctors.*)))
     KEEP (*(.ctors))
   }
   .dtors          :
   {
     KEEP (*crtbegin.o(.dtors))
     KEEP (*crtbegin?.o(.dtors))
     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
     KEEP (*(SORT(.dtors.*)))
     KEEP (*(.dtors))
   }
   .jcr            : { KEEP (*(.jcr)) }
   .data.rel.ro : { *(.data.rel.ro.local* 
.gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* 
.gnu.linkonce.d.rel.ro.*) }
   .dynamic        : { *(.dynamic) }
   . = DATA_SEGMENT_RELRO_END (0, .);
   .plt            : SPECIAL { *(.plt) }
   .data           :
   {
     *(.data .data.* .gnu.linkonce.d.*)
     SORT(CONSTRUCTORS)
   }
   .data1          : { *(.data1) }
   .got            : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
   /* We want the small data sections together, so single-instruction 
offsets
      can access them all, and initialized data all before uninitialized, so
      we can shorten the on-disk segment size.  */
   .sdata          :
   {
     *(.sdata .sdata.* .gnu.linkonce.s.*)
   }
   _edata = .;
   PROVIDE (edata = .);
   . = ALIGN(ALIGNOF(NEXT_SECTION));
   __bss_start = .;
   .sbss           :
   {
     *(.dynsbss)
     *(.sbss .sbss.* .gnu.linkonce.sb.*)
     *(.scommon)
   }
   .bss            :
   {
     *(.dynbss)
     *(.bss .bss.* .gnu.linkonce.b.*)
     *(COMMON)
     /* Align here to ensure that in the common case of there only being one
        type of .bss section, the section occupies space up to _end.
        Align after .bss to ensure correct alignment even if the
        .bss section disappears because there are no input sections.
        FIXME: Why do we need it? When there is no .bss section, we do not
        pad the .data section.  */
       . = ALIGN(. != 0 ? 64 / 8 : 1);
   }
     . = ALIGN(64 / 8);
   /* Start of the Large Data region.  */
   . = SEGMENT_START("ldata-segment", .);
   . = ALIGN(64 / 8);
   _end = .;
   PROVIDE (end = .);
   . = DATA_SEGMENT_END (.);
   /* Start of the Tiny Data region.  */
   /* Stabs debugging sections.  */
   .stab          0 : { *(.stab) }
   .stabstr       0 : { *(.stabstr) }
   .stab.excl     0 : { *(.stab.excl) }
   .stab.exclstr  0 : { *(.stab.exclstr) }
   .stab.index    0 : { *(.stab.index) }
   .stab.indexstr 0 : { *(.stab.indexstr) }
   .comment 0 (INFO) : { *(.comment); LINKER_VERSION; }
   .gnu.build.attributes : { *(.gnu.build.attributes 
.gnu.build.attributes.*) }
   /* DWARF debug sections.
      Symbols in the DWARF debugging sections are relative to the beginning
      of the section so we begin them at 0.  */
   /* DWARF 1.  */
   .debug          0 : { *(.debug) }
   .line           0 : { *(.line) }
   /* GNU DWARF 1 extensions.  */
   .debug_srcinfo  0 : { *(.debug_srcinfo) }
   .debug_sfnames  0 : { *(.debug_sfnames) }
   /* DWARF 1.1 and DWARF 2.  */
   .debug_aranges  0 : { *(.debug_aranges) }
   .debug_pubnames 0 : { *(.debug_pubnames) }
   /* DWARF 2.  */
   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end) }
   .debug_frame    0 : { *(.debug_frame) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
   /* SGI/MIPS DWARF 2 extensions.  */
   .debug_weaknames 0 : { *(.debug_weaknames) }
   .debug_funcnames 0 : { *(.debug_funcnames) }
   .debug_typenames 0 : { *(.debug_typenames) }
   .debug_varnames  0 : { *(.debug_varnames) }
   /* DWARF 3.  */
   .debug_pubtypes 0 : { *(.debug_pubtypes) }
   .debug_ranges   0 : { *(.debug_ranges) }
   /* DWARF 5.  */
   .debug_addr     0 : { *(.debug_addr) }
   .debug_line_str 0 : { *(.debug_line_str) }
   .debug_loclists 0 : { *(.debug_loclists) }
   .debug_macro    0 : { *(.debug_macro) }
   .debug_names    0 : { *(.debug_names) }
   .debug_rnglists 0 : { *(.debug_rnglists) }
   .debug_str_offsets 0 : { *(.debug_str_offsets) }
   .debug_sup      0 : { *(.debug_sup) }
   .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
   /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) 
*(.gnu_object_only) }
}


==================================================
/opt/bw/imed/bin/ld: mode elf64alpha
attempt to open hello.o succeeded
hello.o
attempt to open /usr/lib/crt0.o succeeded
/usr/lib/crt0.o
attempt to open /usr/lib/crtbegin.o succeeded
/usr/lib/crtbegin.o
attempt to open /usr/lib/crtend.o succeeded
/usr/lib/crtend.o
attempt to open /usr/lib/libc.so.102.0 succeeded
/usr/lib/libc.so.102.0
attempt to open /usr/lib/gcc-lib/alpha-unknown-openbsd7.8/4.2.1/libgcc.a 
succeeded
/usr/lib/gcc-lib/alpha-unknown-openbsd7.8/4.2.1/libgcc.a
/opt/bw/imed/bin/ld: warning: cannot find entry symbol _start; 
defaulting to 0000000120000450
alpha$


5.2) The OpenBSD 7.8 folks do provide a linker that works :

alpha$ /usr/bin/ld hello.o /usr/lib/crt0.o /usr/lib/crtbegin.o \
 > /usr/lib/crtend.o /usr/lib/libc.so.102.0 \
 > /usr/lib/gcc-lib/alpha-unknown-openbsd7.8/4.2.1/libgcc.a --verbose
GNU ld version 2.17
   Supported emulations:
    elf64alpha_obsd
using internal linker script:
==================================================
/* Script for -pie -z combreloc -z relro: position independent 
executable, combine & sort relocs */
OUTPUT_FORMAT("elf64-alpha", "elf64-alpha",
               "elf64-alpha")
OUTPUT_ARCH(alpha)
ENTRY(__start)
SEARCH_DIR("/usr/lib");
SECTIONS
{
   /* Read-only sections, merged into text segment: */
   . = 0 + SIZEOF_HEADERS;
   .init           :
   {
     KEEP (*(.init))
   } =0x0000fe2f
   .plt            : SPECIAL { *(.plt) }
   .text           :
   {
     *(.text .stub .text.* .gnu.linkonce.t.*)
     KEEP (*(.text.*personality*))
     /* .gnu.warning sections are handled specially by elf32.em.  */
     *(.gnu.warning)
   } =0x00000000
   .fini           :
   {
     KEEP (*(.fini))
   } =0x0000fe2f
   PROVIDE (__etext = .);
   PROVIDE (_etext = .);
   PROVIDE (etext = .);
   . = ALIGN(0x10000) + (. & (0x10000 - 1)) + 0 ;
   .interp         : { *(.interp) }
   .hash           : { *(.hash) }
   .gnu.hash       : { *(.gnu.hash) }
   .dynsym         : { *(.dynsym) }
   .dynstr         : { *(.dynstr) }
   .gnu.version    : { *(.gnu.version) }
   .gnu.version_d  : { *(.gnu.version_d) }
   .gnu.version_r  : { *(.gnu.version_r) }
   .rel.dyn        :
     {
       *(.rel.init)
       *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
       *(.rel.fini)
       *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
       *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
       *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
       *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
       *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
       *(.rel.ctors)
       *(.rel.dtors)
       *(.rel.got)
       *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
       *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
       *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
       *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
       *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
     }
   .rela.dyn       :
     {
       *(.rela.init)
       *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
       *(.rela.fini)
       *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
       *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
       *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
       *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
       *(.rela.ctors)
       *(.rela.dtors)
       *(.rela.got)
       *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
       *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
       *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
       *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
       *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
     }
   .rel.plt        : { *(.rel.plt) }
   .rela.plt       : { *(.rela.plt) }
   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
   .rodata1        : { *(.rodata1) }
   .sdata2         :
   {
     *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
   }
   .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
   .reginfo        : { *(.reginfo) }
   .eh_frame_hdr : { *(.eh_frame_hdr) }
   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table 
.gcc_except_table.*) }
   . = ALIGN(0x10000) + (. & (0x10000 - 1));
   .plt            : SPECIAL { *(.plt) }
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
   . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = 
DATA_SEGMENT_ALIGN (0x10000, 0x2000);
   PROVIDE_HIDDEN(__got_start = .);
   /* Exception handling  */
   .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
   .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table 
.gcc_except_table.*) }
   /* Thread Local Storage sections  */
   .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
   .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
   .preinit_array     :
   {
     PROVIDE_HIDDEN (__preinit_array_start = .);
     KEEP (*(.preinit_array))
     PROVIDE_HIDDEN (__preinit_array_end = .);
   }
   .init_array     :
   {
      PROVIDE_HIDDEN (__init_array_start = .);
      KEEP (*(SORT(.init_array.*)))
      KEEP (*(.init_array))
      PROVIDE_HIDDEN (__init_array_end = .);
   }
   .fini_array     :
   {
     PROVIDE_HIDDEN (__fini_array_start = .);
     KEEP (*(.fini_array))
     KEEP (*(SORT(.fini_array.*)))
     PROVIDE_HIDDEN (__fini_array_end = .);
   }
   .openbsd.randomdata     :
   {
     *(.openbsd.randomdata .openbsd.randomdata.*)
   }
   .jcr            : { KEEP (*(.jcr)) }
   .data.rel.ro : { *(.data.rel.ro.local* 
.gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
   .dynamic        : { *(.dynamic) }
   /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR
      are relocated here to receive the same mprotect protection as .got */
   .ctors          :
   {
     /* gcc uses crtbegin.o to find the start of
        the constructors, so we make sure it is
        first.  Because this is a wildcard, it
        doesn't matter if the user does not
        actually link against crtbegin.o; the
        linker won't look for a file to match a
        wildcard.  The wildcard also means that it
        doesn't matter which directory crtbegin.o
        is in.  */
     KEEP (*crtbegin*.o(.ctors))
     /* We don't want to include the .ctor section from
        the crtend.o file until after the sorted ctors.
        The .ctor section from the crtend file contains the
        end of ctors marker and it must be last */
     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
     KEEP (*(SORT(.ctors.*)))
     KEEP (*(.ctors))
   }
   .dtors          :
   {
     KEEP (*crtbegin*.o(.dtors))
     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
     KEEP (*(SORT(.dtors.*)))
     KEEP (*(.dtors))
   }
   .got            : { *(.got.plt) *(.got) }
   PROVIDE_HIDDEN(__got_end = .);
   . = DATA_SEGMENT_RELRO_END (0, .);
   /* We want the small data sections together, so single-instruction 
offsets
      can access them all, and initialized data all before uninitialized, so
      we can shorten the on-disk segment size.  */
   .sdata          :
   {
     *(.sdata .sdata.* .gnu.linkonce.s.*)
   }
   .data           :
   {
     __data_start = . ;
     *(.data .data.* .gnu.linkonce.d.*)
     KEEP (*(.gnu.linkonce.d.*personality*))
     SORT(CONSTRUCTORS)
   }
   .data1          : { *(.data1) }
   _edata = .; PROVIDE (edata = .);
   __bss_start = .;
   .sbss           :
   {
     *(.dynsbss)
     *(.sbss .sbss.* .gnu.linkonce.sb.*)
     *(.scommon)
   }
   .bss            :
   {
    *(.dynbss)
    *(.bss .bss.* .gnu.linkonce.b.*)
    *(COMMON)
    /* Align here to ensure that the .bss section occupies space up to
       _end.  Align after .bss to ensure correct alignment even if the
       .bss section disappears because there are no input sections.
       FIXME: Why do we need it? When there is no .bss section, we don't
       pad the .data section.  */
    . = ALIGN(. != 0 ? 64 / 8 : 1);
   }
   . = ALIGN(64 / 8);
   . = ALIGN(64 / 8);
   _end = .; PROVIDE (end = .);
   . = DATA_SEGMENT_END (.);
   /* Stabs debugging sections.  */
   .stab          0 : { *(.stab) }
   .stabstr       0 : { *(.stabstr) }
   .stab.excl     0 : { *(.stab.excl) }
   .stab.exclstr  0 : { *(.stab.exclstr) }
   .stab.index    0 : { *(.stab.index) }
   .stab.indexstr 0 : { *(.stab.indexstr) }
   .comment       0 : { *(.comment) }
   /* DWARF debug sections.
      Symbols in the DWARF debugging sections are relative to the beginning
      of the section so we begin them at 0.  */
   /* DWARF 1 */
   .debug          0 : { *(.debug) }
   .line           0 : { *(.line) }
   /* GNU DWARF 1 extensions */
   .debug_srcinfo  0 : { *(.debug_srcinfo) }
   .debug_sfnames  0 : { *(.debug_sfnames) }
   /* DWARF 1.1 and DWARF 2 */
   .debug_aranges  0 : { *(.debug_aranges) }
   .debug_pubnames 0 : { *(.debug_pubnames) }
   /* DWARF 2 */
   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
   .debug_frame    0 : { *(.debug_frame) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
   /* SGI/MIPS DWARF 2 extensions */
   .debug_weaknames 0 : { *(.debug_weaknames) }
   .debug_funcnames 0 : { *(.debug_funcnames) }
   .debug_typenames 0 : { *(.debug_typenames) }
   .debug_varnames  0 : { *(.debug_varnames) }
   /DISCARD/ : { *(.note.GNU-stack) }
}


==================================================
attempt to open hello.o succeeded
hello.o
attempt to open /usr/lib/crt0.o succeeded
/usr/lib/crt0.o
attempt to open /usr/lib/crtbegin.o succeeded
/usr/lib/crtbegin.o
attempt to open /usr/lib/crtend.o succeeded
/usr/lib/crtend.o
attempt to open /usr/lib/libc.so.102.0 succeeded
/usr/lib/libc.so.102.0
attempt to open /usr/lib/gcc-lib/alpha-unknown-openbsd7.8/4.2.1/libgcc.a 
succeeded
alpha$ echo $?
0
alpha$ ./hello
hello and this is not pi = 314159265
alpha$

So the upshot of all this is that the GCC bootstrap process will fail
regardless if I use the system provided linker or a new binutils ld.

Q.E.D.



-- 
--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken