compat-tests failing to build in 9.1p1

Chris Rapier rapier at psc.edu
Thu Nov 3 07:57:50 AEDT 2022


Howdy,

So I found another regression test issue. Starting in V_9_1_P1 
compat-tests (in openbsd-compat/regress) is failing to build. I've been 
able to recreate this in Ubuntu 22.04 and 20.04. It looks like it wants 
to link against OpenSSL but the library isn't getting linked.

cc -g -O2 -pipe -Wno-error=format-truncation -Wall -Wpointer-arith 
-Wuninitialized -Wsign-compare -Wformat-security 
-Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result 
-Wimplicit-fallthrough -Wmisleading-indentation -fno-strict-aliasing 
-D_FORTIFY_SOURCE=2 -ftrapv -fzero-call-used-regs=all 
-fno-builtin-memset -fstack-protector-strong -fPIE   -I. -I.. -I../.. 
-I. -I./.. -I./../..  -D_XOPEN_SOURCE=600 -D_BSD_SOURCE 
-D_DEFAULT_SOURCE -DOPENSSL_API_COMPAT=0x10100000L  -DHAVE_CONFIG_H 
-Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -fstack-protector-strong -pie 
  ../libopenbsd-compat.a -o opensslvertest opensslvertest.c 
../libopenbsd-compat.a -lmd

/usr/bin/ld: ../libopenbsd-compat.a(openssl-compat.o): in function 
`ssh_libcrypto_init':
/home/rapier/openssh-portable/openbsd-compat/openssl-compat.c:75: 
undefined reference to `OPENSSL_init_crypto'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:22: opensslvertest] Error 1
make[1]: Leaving directory 
'/home/rapier/openssh-portable/openbsd-compat/regress'

Adding -lcrypto to LIBS in openbsd-compat/regress/Makefile.in fixes the 
problem but I know that's not the right way to do this.

I also tried configuring with --without-openssl and got the following:

/usr/bin/ld: /tmp/ccWem4Wo.o: in function `main':
/home/rapier/openssh-portable/openbsd-compat/regress/opensslvertest.c:67: 
undefined reference to `ssh_compatible_openssl'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:22: opensslvertest] Error 1
make[1]: Leaving directory 
'/home/rapier/openssh-portable/openbsd-compat/regress'
make: *** [Makefile:756: compat-tests] Error 2


Just wanted to let you all know.

Chris


More information about the openssh-unix-dev mailing list