Bug 276938 - net/dante: fix build
Summary: net/dante: fix build
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexey Dokuchaev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-10 09:13 UTC by Hiroo Ono
Modified: 2024-03-16 03:42 UTC (History)
0 users

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


Attachments
fix dante build. (789 bytes, patch)
2024-02-10 09:13 UTC, Hiroo Ono
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hiroo Ono 2024-02-10 09:13:33 UTC
Created attachment 248300 [details]
fix dante build.

net/dante version 1.4.3 fails to build with the following log.
It is because there is no _getsockopt symbol in the source files, but include/symbols_freebsd.txt has it. Remove it before build so that build works well.

--- excerpt of the log from here ---
libtool: link: cc -shared  -fPIC -DPIC  .libs/libdsocks_la-interposition.o .libs/libdsocks_la-int_osf1.o .libs/libdsocks_la-int_osf2.o .libs/libdsocks_la-int_osf3.o .libs/libdsocks_la-Raccept.o .libs/libdsocks_la-Rbind.o .libs/libdsocks_la-Rbindresvport.o .libs/libdsocks_la-Rcompat.o .libs/libdsocks_la-Rconnect.o .libs/libdsocks_la-Rgethostbyname.o .libs/libdsocks_la-Rgetpeername.o .libs/libdsocks_la-Rgetsockname.o .libs/libdsocks_la-Rgetsockopt.o .libs/libdsocks_la-Rlisten.o .libs/libdsocks_la-Rrresvport.o .libs/libdsocks_la-address.o .libs/libdsocks_la-addressmatch.o .libs/libdsocks_la-authneg.o .libs/libdsocks_la-broken.o .libs/libdsocks_la-client.o .libs/libdsocks_la-clientconfig.o .libs/libdsocks_la-clientprotocol.o .libs/libdsocks_la-config.o .libs/libdsocks_la-config_parse.o .libs/libdsocks_la-config_scan.o .libs/libdsocks_la-connectchild.o .libs/libdsocks_la-debug.o .libs/libdsocks_la-fmt.o .libs/libdsocks_la-fmt_customer.o .libs/libdsocks_la-fmt_protocol.o .libs/libdsocks_la-gssapi.o .libs/libdsocks_la-hostcache.o .libs/libdsocks_la-hostid.o .libs/libdsocks_la-httpproxy.o .libs/libdsocks_la-hw.o .libs/libdsocks_la-iface.o .libs/libdsocks_la-io.o .libs/libdsocks_la-iobuf.o .libs/libdsocks_la-ipv6.o .libs/libdsocks_la-log.o .libs/libdsocks_la-method.o .libs/libdsocks_la-parse_util.o .libs/libdsocks_la-protocol.o .libs/libdsocks_la-serr.o .libs/libdsocks_la-showconfig.o .libs/libdsocks_la-sockaddr.o .libs/libdsocks_la-socket.o .libs/libdsocks_la-socketopt.o .libs/libdsocks_la-sockopt.o .libs/libdsocks_la-time.o .libs/libdsocks_la-tostring.o .libs/libdsocks_la-udp.o .libs/libdsocks_la-udp_util.o .libs/libdsocks_la-upnp.o .libs/libdsocks_la-userio.o .libs/libdsocks_la-util.o   -L/usr/lib -lpthread -lminiupnpc -L/usr/local/lib -lpam -lgssapi -lgssapi_krb5 -lheimntlm -lkrb5 -lhx509 -lcom_err -lcrypto -lasn1 -lwind -lheimbase -lroken -lcrypt  -O2 -fstack-protector-strong -O2 -fstack-protector-strong -pthread -pthread   -pthread -Wl,-soname -Wl,libdsocks.so -Wl,-version-script -Wl,.libs/libdsocks.so-ver -o .libs/libdsocks.so
ld: error: version script assignment of 'global' to symbol '_getsockopt' failed: symbol not defined
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1
Comment 1 Hiroo Ono 2024-02-10 10:26:32 UTC
This problem seems to come from the linker option --no-allow-shlib-undefined was introduced. Just adding
LDFLAGS+= -Wl,--undefined-version
or
LDFLAGS+= -Wl,--allow-shlib-undefined
also clear the problem.
Which approach is better? The previous patch or this LDFLAGS addition?
I do not know why --no-allow-shlib-undefined was introduced, so I cannot judge which is better.
Comment 2 Alexey Dokuchaev freebsd_committer freebsd_triage 2024-02-13 06:46:36 UTC
(In reply to Hiroo Ono from comment #1)
> Which approach is better? The previous patch or this LDFLAGS addition?
LDFLAGS would simply mask the problem, not solve it.  We need to understand why `_getsockopt' had been added to that file and why it now causes problem, i.e. if it was added by mistake in the first place, or linker revealed some bug with how it's being used.
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-02-26 12:39:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c3fa9924529148735c04a0d1c8444b9942e472d3

commit c3fa9924529148735c04a0d1c8444b9942e472d3
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2024-02-26 12:38:22 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2024-02-26 12:38:22 +0000

    net/dante: add missing getsockopt() interposition to fix the build

    Discovered with --no-undefined-version being enabled by default in
    newish LLD.  While here, drop CONFLICTS against `net/socks5' which
    was removed from the ports tree back in 2012.

    PR:             276938
    Reported by:    pkg-fallout

 net/dante/Makefile                               |  2 --
 net/dante/files/patch-dlib_interposition.c (new) | 31 ++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)
Comment 4 Alexey Dokuchaev freebsd_committer freebsd_triage 2024-03-16 03:42:16 UTC
Please always use appropriate resolution when closing PR next time, thank you.