openssl
openssl copied to clipboard
build failed on OpenBSD7
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
sed -i 's|-Wl,-z,defs||' Configurations/shared-info.pl
resolved after running above command.
This is curious... aren't those symbols part of libc, which I hope those shared objects are linked against?
https://bugs.freedesktop.org/show_bug.cgi?id=76856
How... annoying!