Bug 219160

Summary: [ports-mgmt/pkg] Make at least OpenSSL linkable from ports
Product: Ports & Packages Reporter: Michael Osipov <michael.osipov>
Component: Individual Port(s)Assignee: freebsd-pkg (Nobody) <pkg>
Status: Closed Overcome By Events    
Severity: Affects Many People Flags: bugzilla: maintainer-feedback? (pkg)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Michael Osipov 2017-05-09 08:14:55 UTC
Several ports rely on libpkg, like netsnmp, but the former links against OpenSSL from base only. Basically if someone links against libpkg or against netsntmp like Zabbix or the PHP module, the applications crash due to a mix of dependencies for OpenSSL between base and ports. These ports are unusable.

This is related to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206304
Comment 1 Michael Osipov 2017-05-10 07:31:36 UTC
Naively setting

export CPPFLAGS="-I/usr/local/include"
export LDFLAGS="-L/usr/local/lib"

Gives me:
l,-rpath -Wl,/usr/local/lib
--- pkg-static ---
/usr/local/lib/libarchive.a(archive_read_support_filter_lz4.o): In function `lz4_filter_read_default_stream':
(.text+0x794): undefined reference to `LZ4_decompress_safe'
/usr/local/lib/libarchive.a(archive_read_support_filter_lz4.o): In function `lz4_filter_read_default_stream':
(.text+0x9f7): undefined reference to `LZ4_decompress_safe_usingDict'
/usr/local/lib/libarchive.a(archive_read_support_filter_lz4.o): In function `lz4_filter_read_legacy_stream':
(.text+0xb41): undefined reference to `LZ4_decompress_safe'
/usr/local/lib/libarchive.a(archive_read_support_filter_lzop.o): In function `lzop_filter_read':
(.text+0x7e6): undefined reference to `lzo1x_decompress_safe'
/usr/lib/liblzma.a(stream_encoder_mt.o): In function `stream_encoder_mt_init':
/usr/src/contrib/xz/src/liblzma/common/stream_encoder_mt.c:(.text+0x406): undefined reference to `pthread_condattr_init'
/usr/src/contrib/xz/src/liblzma/common/stream_encoder_mt.c:(.text+0x41a): undefined reference to `pthread_condattr_setclock'
/usr/src/contrib/xz/src/liblzma/common/stream_encoder_mt.c:(.text+0x426): undefined reference to `pthread_condattr_destroy'
/usr/src/contrib/xz/src/liblzma/common/stream_encoder_mt.c:(.text+0x444): undefined reference to `pthread_condattr_destroy'
/usr/lib/liblzma.a(stream_encoder_mt.o): In function `stream_encode_mt':
/usr/src/contrib/xz/src/liblzma/common/stream_encoder_mt.c:(.text+0xaad): undefined reference to `pthread_condattr_init'
/usr/src/contrib/xz/src/liblzma/common/stream_encoder_mt.c:(.text+0xac7): undefined reference to `pthread_condattr_setclock'
/usr/src/contrib/xz/src/liblzma/common/stream_encoder_mt.c:(.text+0xae7): undefined reference to `pthread_condattr_destroy'
/usr/src/contrib/xz/src/liblzma/common/stream_encoder_mt.c:(.text+0xb0b): undefined reference to `pthread_condattr_destroy'
/usr/src/contrib/xz/src/liblzma/common/stream_encoder_mt.c:(.text+0xc24): undefined reference to `pthread_create'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [pkg-static] Error code 1

make[4]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.10.1/src
1 error

make[4]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.10.1/src
*** [all-recursive] Error code 1

make[3]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.10.1
1 error

make[3]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.10.1
*** [all] Error code 2

make[2]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.10.1
1 error

make[2]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.10.1
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/ports-mgmt/pkg
*** Error code 1

Stop.
make: stopped in /usr/ports/ports-mgmt/pkg
Comment 2 Michael Osipov 2020-03-03 10:12:24 UTC
This has been overcome because we have now OpenSSL 1.1.1 in base. This may be an issue as soon as OpenSSL 3.0.0 comes out.