openssl icon indicating copy to clipboard operation
openssl copied to clipboard

build failed on OpenBSD7

Open leleliu008 opened this issue 3 years ago • 4 comments

reproduce steps:

sudo pkg_add -u curl xz gmake gcc
curl -LO https://www.openssl.org/source/openssl-3.0.5.tar.gz
tar vxf openssl-3.0.5.tar.gz
cd openssl-3.0.5
./config no-engine no-tests --prefix=$PWD/out --libdir=$PWD/out/lib
gmake

report error messages:

perl ./util/mkdef.pl --type dso --ordinals util/providers.num  --name providers/legacy --OS bsd-gcc > providers/legacy.ld
cc -fPIC -pthread -Wa,--noexecstack -Qunused-arguments -Wall -O3 -L. -Wl,-z,defs -shared -Wl,-Bsymbolic   \
	-o providers/legacy.so -Wl,--version-script=providers/legacy.ld \
	providers/legacy-dso-legacyprov.o \
	providers/liblegacy.a providers/libcommon.a -lcrypto -pthread 
ld: error: undefined symbol: memcpy
>>> referenced by cipher_blowfish.c
>>>               liblegacy-lib-cipher_blowfish.o:(blowfish_dupctx) in archive providers/liblegacy.a
>>> referenced by cipher_cast5.c
>>>               liblegacy-lib-cipher_cast5.o:(cast5_dupctx) in archive providers/liblegacy.a
>>> referenced by cipher_des.c
>>>               liblegacy-lib-cipher_des.o:(des_init) in archive providers/liblegacy.a
>>> referenced 21 more times

ld: error: undefined symbol: getenv
>>> referenced by cpuid.c
>>>               liblegacy-lib-cpuid.o:(OPENSSL_cpuid_setup) in archive providers/liblegacy.a

ld: error: undefined symbol: memset
>>> referenced by md5_dgst.c
>>>               liblegacy-lib-md5_dgst.o:(MD5_Final) in archive providers/liblegacy.a
>>> referenced by md5_dgst.c
>>>               liblegacy-lib-md5_dgst.o:(MD5_Final) in archive providers/liblegacy.a
>>> referenced by ciphercommon.c
>>>               libcommon-lib-ciphercommon.o:(ossl_cipher_generic_block_update) in archive providers/libcommon.a
>>> referenced 2 more times
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [Makefile:20363: providers/legacy.so] Error 1
gmake[1]: Leaving directory '/home/vagrant/openssl-3.0.5'
gmake: *** [Makefile:2769: build_sw] Error 2

leleliu008 avatar Sep 18 '22 02:09 leleliu008

sed -i 's|-Wl,-z,defs||' Configurations/shared-info.pl

resolved after running above command.

leleliu008 avatar Sep 18 '22 03:09 leleliu008

This is curious... aren't those symbols part of libc, which I hope those shared objects are linked against?

levitte avatar Sep 19 '22 06:09 levitte

https://bugs.freedesktop.org/show_bug.cgi?id=76856

leleliu008 avatar Sep 19 '22 06:09 leleliu008

How... annoying!

levitte avatar Sep 19 '22 06:09 levitte