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]> Fri, 10 Apr 2026 15:01:33 -0400
Newsgroups gmane.comp.gcc.help
Organization GENUNIX
Message-ID <[email protected]>
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 :

configure:3664: checking for C compiler default output file name
configure:3686: 
/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/./gcc/xgcc 
-B/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/./gcc/ 
-B/opt/bw/imed/gcc4/alpha-unknown-openbsd7.8/bin/ 
-B/opt/bw/imed/gcc4/alpha-unknown-openbsd7.8/lib/ -isystem 
/opt/bw/imed/gcc4/alpha-unknown-openbsd7.8/include -isystem 
/opt/bw/imed/gcc4/alpha-unknown-openbsd7.8/sys-include    -g -O2 -mieee 
  conftest.c  >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: error: ld returned 1 exit status
configure:3690: $? = 1
configure:3727: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU OpenMP Runtime Library"
| #define PACKAGE_TARNAME "libgomp"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU OpenMP Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgomp/"
| #define PACKAGE "libgomp"
| #define VERSION "1.0"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3733: error: in 
`/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/alpha-unknown-openbsd7.8/libgomp':
configure:3736: error: C compiler cannot create executables

However the compiler seems to be fine and it is the GNU linker that is 
confused in some way. The compiler in question is the result of stuff
happening in stage1 :

centauri$ ls -la gcc/xgcc
-rwxr-xr-x  1 dclarke  devl  1781989 Apr 10 13:57 gcc/xgcc

If I put that directory into my PATH and then try to use xgcc we see :

$ 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;
}

$

$
$ 
PATH=/opt/bw/build/gcc-4.7.4_OpenBSD_alpha_21164.002/gcc:/usr/bin:/bin:/usr/sbin:/sbin
$ export PATH
$
$ xgcc -v -std=iso9899:1999 -pedantic -O0 -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' '-pedantic' '-O0' '-S' '-o' 
'hello.s' '-mcpu=21164'
  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 -auxbase-strip hello.s -O0 
-pedantic -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' '-pedantic' '-O0' '-S' '-o' 
'hello.s' '-mcpu=21164'
$

Of course there is a pile of stuff missing in terms of those include 
directories however we do get a valid asm file hello.s and can even
produce an object file :

$ xgcc -std=iso9899:1999 -pedantic -O0 -c -o hello.o hello.c
$ echo $?
0

The OpenBSD 7.8 system provided linker is where I see the problem :

$
$ which ld
/usr/bin/ld
$ ld --version
GNU ld version 2.17
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
$
$ xgcc -std=iso9899:1999 -pedantic -O0 -o hello hello.c
/usr/bin/ld: crt1.o: No such file: No such file or directory
$

Why crt1.o and not crt0.o ? Those files do exist :

$ ls -l /usr/lib/crt*.o
-r--r--r--  1 root  bin  2568 Oct  9  2025 /usr/lib/crt0.o
-r--r--r--  1 root  bin  4403 Oct  9  2025 /usr/lib/crtbegin.o
-r--r--r--  1 root  bin  4717 Oct  9  2025 /usr/lib/crtbeginS.o
-r--r--r--  1 root  bin  1361 Oct  9  2025 /usr/lib/crtend.o
-r--r--r--  1 root  bin  1257 Oct  9  2025 /usr/lib/crtendS.o
$

As root I can just make a copy :

centauri# cp -p /usr/lib/crt0.o /usr/lib/crt1.o

Then we hit the next file needed "crti.o".

Those files do not exist anywhere in the build directory. Is there a way
forwards from this ?


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