Created attachment 219640 [details]
Full build log
botan2 has problem with library path order which places system library path before local ones, which leads to picking up library from botan2 installed in the system, which breaks the build or may produce broken package.
There doesn't seem to be problems with includes:
c++ -fstack-protector -pthread -std=c++11 -D_REENTRANT -O2 -pipe -march=skylake -fstack-protector-strong -fno-strict-aliasing -DBOTAN_IS_BEING_BUILT -Wall -Wextra -Wpedantic -Wshadow -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -msse2 -Ibuild/include -Ibuild/include/external -I/usr/local/include -c src/tests/test_simd.cpp -o build/obj/test/test_simd.o
(/usr/local/include comes AFTER local includes)
However there definitely is a problem with library paths:
c++ -L/usr/local/lib -fstack-protector -pthread build/obj/cli/argon2.o build/obj/cli/asn1.o build/obj/cli/bcrypt.o build/obj/cli/cc_enc.o build/obj/cli/cli.o build/obj/cli/cli_rng.o build/obj/cli/codec.o build/obj/cli/compress.o build/obj/cli/encryption.o build/obj/cli/entropy.o build/obj/cli/hash.o build/obj/cli/hmac.o build/obj/cli/main.o build/obj/cli/math.o build/obj/cli/pbkdf.o build/obj/cli/pk_crypt.o build/obj/cli/psk.o build/obj/cli/pubkey.o build/obj/cli/roughtime.o build/obj/cli/sandbox.o build/obj/cli/speed.o build/obj/cli/timing_tests.o build/obj/cli/tls_client.o build/obj/cli/tls_http_server.o build/obj/cli/tls_proxy.o build/obj/cli/tls_server.o build/obj/cli/tls_utils.o build/obj/cli/tss.o build/obj/cli/utils.o build/obj/cli/x509.o -pthread -fstack-protector-strong -L. -lbotan-2 -lboost_system -lbz2 -lcrypto -llzma -lz -o botan
ld: error: undefined symbol: Botan::Stateful_RNG::add_entropy(unsigned char const*, unsigned long)
(/usr/local/lib comes BEFORE local library paths)
This breaks the update of botan2 from 2.15 to 2.17.1.
Upstream issue: https://github.com/randombit/botan/issues/2496
Created attachment 219643 [details]
Patch with workaround
Suggesting a workaround to fix the update for port users.
Created attachment 219660 [details]
Patch from upstream
Upstream has fixed it, I suggest to apply their fix as-is.
(In reply to Dmitry Marakasov from comment #3)
Confirmed. Applied patch, rebuilt. Everything OK.
I will regenerate the patch to make portlint happy. Once that's been done it's fine to commit.
I have the same problem
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:73: botan] Error 1
gmake: *** Waiting for unfinished jobs....
INFO: Starting sphinx-build -q -c ./src/configs/sphinx -j 4 -b html ./doc build/docs/handbook
INFO: Starting rst2man build/botan.rst build/botan.1
gmake: Leaving directory '/usr/ports/security/botan2/work/Botan-2.17.1'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
*** Error code 1
make: stopped in /usr/ports/security/botan2
*** Error code 1
FreeBSD 12.2-RELEASE r366954 GENERIC amd64
Created attachment 219690 [details]
Update Botan to 2.17.2 and add patch from upstream to fix linking issue
testport: OK (12.2; amd64)
portlint: OK (looks fine.)
Regenerated patch to make portlint happy.
While here also update to 2.17.2
A commit references this bug:
Date: Sun Nov 15 14:07:15 UTC 2020
New revision: 555220
- Update to 2.17.2
- Fix building in presence of older version of botan2 installed in the system by importing upstream patch
Submitted by: firstname.lastname@example.org (maintainer)
Reported by: amdmi3, email@example.com, firstname.lastname@example.org