Bug 209523 - [www/squid]: building crashes on undefined reference to `SSL_set_alpn_protos'
Summary: [www/squid]: building crashes on undefined reference to `SSL_set_alpn_protos'
Status: Closed DUPLICATE of bug 208584
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-15 16:29 UTC by emz
Modified: 2016-05-21 12:20 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (timp87)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description emz 2016-05-15 16:29:36 UTC
Cannot build the port, building crashes:

[...]
libtool: link: rm -f .libs/squid.nm .libs/squid.nmS .libs/squid.nmT
libtool: link: rm -f ".libs/squid.nmI"
libtool: link: (cd .libs && cc -I/usr/include -O2 -pipe -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -fstack-protector -DLDAP_DEPRECATED -fno-strict-aliasing -I/usr/local/include -c -fno-builtin "squidS.c")
libtool: link: rm -f ".libs/squidS.c" ".libs/squid.nm" ".libs/squid.nmS" ".libs/squid.nmT" ".libs/squid.nmI"
libtool: link: c++ -D_REENTRANT -I/usr/include -I/usr/local/include -O2 -pipe -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -fstack-protector -DLDAP_DEPRECATED -fno-strict-aliasing -I/usr/local/include .libs/squidS.o -pthread -Wl,-rpath -Wl,/usr/local/lib -fstack-protector -Wl,-R/usr/local/lib -o squid AclRegs.o AuthReg.o AccessLogEntry.o AsyncEngine.o YesNoNone.o cache_cf.o CacheDigest.o cache_manager.o carp.o cbdata.o ChunkedCodingParser.o client_db.o client_side.o client_side_reply.o client_side_request.o BodyPipe.o clientStream.o CollapsedForwarding.o CompletionDispatcher.o ConfigOption.o ConfigParser.o CpuAffinity.o CpuAffinityMap.o CpuAffinitySet.o debug.o delay_pools.o DelayId.o DelayBucket.o DelayConfig.o DelayPool.o DelaySpec.o DelayTagged.o DelayUser.o DelayVector.o NullDelayId.o ClientDelayConfig.o disk.o DiskIO/DiskIOModule.o DiskIO/ReadRequest.o DiskIO/WriteRequest.o dlink.o dns_internal.o DnsLookupDetails.o errorpage.o ETag.o event.o EventLoop.o external_acl.o ExternalACLEntry.o FadingCounter.o fatal.o fd.o fde.o filemap.o fqdncache.o FwdState.o gopher.o helper.o htcp.o http.o HttpHdrCc.o HttpHdrRange.o HttpHdrSc.o HttpHdrScTarget.o HttpHdrContRange.o HttpHeader.o HttpHeaderTools.o HttpBody.o HttpMsg.o HttpParser.o HttpReply.o RequestFlags.o HttpRequest.o HttpRequestMethod.o icp_v2.o icp_v3.o int.o internal.o ipc.o ipcache.o SquidList.o main.o MasterXaction.o mem.o mem_node.o MemBuf.o MemObject.o mime.o mime_header.o multicast.o neighbors.o Notes.o Packer.o Parsing.o pconn.o peer_digest.o peer_proxy_negotiate_auth.o peer_select.o peer_sourcehash.o peer_userhash.o PeerPoolMgr.o redirect.o refresh.o RemovalPolicy.o send-announce.o MemBlob.o SBuf.o SBufExceptions.o SBufDetailedStats.o SBufStatsAction.o snmp_core.o snmp_agent.o SquidMath.o SquidNew.o stat.o StatCounters.o StatHist.o String.o StrList.o stmem.o store.o StoreFileSystem.o store_io.o StoreIOState.o store_client.o store_digest.o store_dir.o store_key_md5.o store_log.o store_rebuild.o store_swapin.o store_swapmeta.o store_swapout.o StoreMetaUnpacker.o StoreMeta.o StoreMetaMD5.o StoreMetaSTD.o StoreMetaSTDLFS.o StoreMetaURL.o StoreMetaVary.o StoreStats.o StoreSwapLogData.o SwapDir.o Transients.o MemStore.o time.o tools.o tunnel.o unlinkd.o url.o urn.o wccp.o wccp2.o whois.o wordlist.o LoadableModule.o LoadableModules.o DiskIO/DiskIOModules_gen.o err_type.o err_detail_type.o globals.o hier_code.o icp_opcode.o LogTags.o lookup_t.o repl_modules.o swap_log_op.o DiskIO/AIO/AIODiskIOModule.o DiskIO/Blocking/BlockingDiskIOModule.o DiskIO/IpcIo/IpcIoDiskIOModule.o DiskIO/Mmapped/MmappedDiskIOModule.o DiskIO/DiskThreads/DiskThreadsDiskIOModule.o DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o -pthread -pthread -Wl,--export-dynamic  -L/usr/lib -L/usr/local/lib auth/.libs/libacls.a ident/.libs/libident.a acl/.libs/libacls.a acl/.libs/libstate.a auth/.libs/libauth.a libAIO.a libBlocking.a libIpcIo.a libMmapped.a libDiskThreads.a libDiskDaemon.a acl/.libs/libapi.a base/.libs/libbase.a ./.libs/libsquid.a ip/.libs/libip.a fs/.libs/libfs.a ssl/.libs/libsslsquid.a ssl/.libs/libsslutil.a ipc/.libs/libipc.a mgr/.libs/libmgr.a anyp/.libs/libanyp.a comm/.libs/libcomm.a eui/.libs/libeui.a helper/.libs/libhelper.a http/.libs/libsquid-http.a icmp/.libs/libicmp.a icmp/.libs/libicmp-core.a log/.libs/liblog.a format/.libs/libformat.a clients/.libs/libclients.a servers/.libs/libservers.a ftp/.libs/libftp.a repl/liblru.a repl/libheap.a -lrt adaptation/.libs/libadaptation.a snmp/.libs/libsnmp.a ../lib/snmplib/.libs/libsnmplib.a parser/.libs/libsquid-parser.a ../lib/.libs/libmisccontainers.a ../lib/.libs/libmiscencoding.a ../lib/.libs/libmiscutil.a -lssl -lheimntlm -lhx509 -lcom_err -lcrypto -lasn1 -lwind -lheimbase -lroken -lcrypt ../compat/.libs/libcompat-squid.a -lunwind -lm -lkrb5 -lgssapi -lgssapi_krb5 -L.. /usr/local/lib/libltdl.so -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib
ssl/.libs/libsslsquid.a(bio.o): In function `Ssl::Bio::sslFeatures::applyToSSL(ssl_st*, Ssl::BumpMode) const':
/usr/ports/www/squid/work/squid-3.5.19/src/ssl/bio.cc:1222: undefined reference to `SSL_set_alpn_protos'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
libtool: link: rm -f ".libs/squidS.o"
*** [squid] Error code 1

make[5]: stopped in /usr/ports/www/squid/work/squid-3.5.19/src
1 error

make[5]: stopped in /usr/ports/www/squid/work/squid-3.5.19/src
*** [all-recursive] Error code 1

make[4]: stopped in /usr/ports/www/squid/work/squid-3.5.19/src
1 error

make[4]: stopped in /usr/ports/www/squid/work/squid-3.5.19/src
*** [all] Error code 2

make[3]: stopped in /usr/ports/www/squid/work/squid-3.5.19/src
1 error

make[3]: stopped in /usr/ports/www/squid/work/squid-3.5.19/src
*** [all-recursive] Error code 1

make[2]: stopped in /usr/ports/www/squid/work/squid-3.5.19
1 error

make[2]: stopped in /usr/ports/www/squid/work/squid-3.5.19
===> 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/www/squid
*** Error code 1

Stop.
make: stopped in /usr/ports/www/squid

Latset ports. I have the security/openssl installed, SSL_set_alpn_protos is referenced in it's libssl.so.8:

[root@crystal-alpha:www/squid]# nm /usr/local/lib/libssl.so.8 | grep SSL_set_alpn_protos
000000000004a620 T SSL_set_alpn_protos

Seems like squid is nowadays is messing when both base and port openssl are installed.

Multiple references of this bug can be found inside the mailing list and web, but no PR exists. Workaround mentions installing squid prior to the security/openssl, but since I'm upgrading my installation this is pretty difficult, since lots of installed ports depend on the openssl.
Comment 1 emz 2016-05-16 06:50:05 UTC
Lol, if I'm building www/squid with WITH_OPENSSL_BASE, it shows a warning about the need to build with base openssl and stops ! At least it's behavior should be inverted, this warning should be displayed when building WITH_OPENSSL_PORT, since it's about the port. And when building WITH_OPENSSL_PORT=yes it shows nothing.

[root@crystal-alpha:~]# portmaster -DBim "WITH_OPENSSL_BASE=yes" www/squid

===>>> Port directory: /usr/ports/www/squid

===>>> Launching 'make checksum' for www/squid in background
===>>> Gathering dependency list for www/squid from ports

===>>> The dependency for net/samba42
       seems to be handled by samba43-4.3.9

===>>> Initial dependency check complete for www/squid


===>>> Starting build for www/squid <<<===

===>>> All dependencies are up to date

===>  Cleaning for squid-3.5.19
Dependency error: This port wants the OpenSSL library from the FreeBSD
base system. You can't build against it, while a newer
version is installed by a port.
Please deinstall the port or undefine WITH_OPENSSL_BASE.
*** Error code 1
Comment 2 emz 2016-05-16 07:23:09 UTC
The workaround is to edit the $workingdir/src/Makefile and move -L/usr/local/lib before -L/usr/lib in LDFLAGS definition. After that squid builds just fine.
Comment 3 Pavel Timofeev 2016-05-16 16:39:11 UTC
(In reply to emz from comment #2)
I think we should report it directly to squid.
Comment 4 emz 2016-05-16 17:00:37 UTC
Doesn't look so. Squid is behaving just fine when there's only one instance of openssl, and one instance of openssl is, actually, a supposed environment. What should be the behaviour of the linker when there are more than one instances - this is entirely the linker and the userland problem. So this is FreeBSD issue, and ports in particular. May be not the issue of the certain port, but definitely not the issue of squid.

By the way, today I've also discovered that net/asterisk11 and net/asterisk13 just dump core when there's openssl 1.0.2 from ports installed along with base openssl 1.0.1t. So this is may be the problem of the openssl port too.
Comment 5 Bernard Spil freebsd_committer freebsd_triage 2016-05-21 12:20:24 UTC

*** This bug has been marked as a duplicate of bug 208584 ***