Bug 258464 - chinese/bitchx irc/bitch: fix build with clang 13
Summary: chinese/bitchx irc/bitch: fix build with clang 13
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks: 258209
  Show dependency treegraph
 
Reported: 2021-09-12 20:18 UTC by Dimitry Andric
Modified: 2021-10-02 11:20 UTC (History)
2 users (show)

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


Attachments
chinese/bitchx irc/bitchx: fix non-static inline functions (1.39 KB, patch)
2021-09-12 20:18 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2021-09-12 20:18:04 UTC
During an exp-run for llvm 13 (see bug 258209), it turned out that both chinese/bitchx and irc/bitchx fail to build with clang 13 [1]:

...
cc -fstack-protector-strong  -L/usr/lib -o BitchX alias.o alist.o  array.o art.o banlist.o bot_link.o cdcc.o cdns.o  chelp.o commands.o commands2.o compat.o cset.o ctcp.o dcc.o debug.o encrypt.o exec.o files.o flood.o fset.o functions.o funny.o glob.o hash.o hebrew.o help.o history.o hook.o if.o ignore.o input.o irc.o ircaux.o ircsig.o keys.o lastlog.o list.o log.o mail.o misc.o modules.o names.o network.o newio.o notice.o notify.o numbers.o output.o parse.o queue.o readlog.o reg.o screen.o server.o stack.o status.o struct.o tcl_public.o term.o timer.o translat.o user.o userlist.o vars.o who.o whowas.o window.o words.o   -ldl -ltinfo -lssl -lcrypto -lm -lcrypt
ld: error: undefined symbol: operator
>>> referenced by alias.c
>>>               alias.o:(zzlex)
cc: error: linker command failed with exit code 1 (use -v to see invocation)

This is because several functions in source/expr2.c are marked __inline, without either static or extern keyword. The compiler then has to assume the function is also externally available.

Fix this by marking the affected functions static.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2021-09-12 20:18:45 UTC
Created attachment 227862 [details]
chinese/bitchx irc/bitchx: fix non-static inline functions
Comment 2 Fernando Apesteguía freebsd_committer freebsd_triage 2021-09-16 05:57:49 UTC
^Triage: Reporter is committer, assign accordingly.
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-10-02 11:19:45 UTC
A commit in branch main references this bug:

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

commit 7075120b4d50ebba264775ce8a5bcbcafd1d99a2
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-09-12 20:13:36 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-10-02 11:08:57 +0000

    irc/bitchx: fix non-static inline functions

    During an exp-run for llvm 13 (see bug 258209), it turned out that both
    chinese/bitchx and irc/bitchx fail to build with clang 13 [1]:

    ...
    cc -fstack-protector-strong  -L/usr/lib -o BitchX alias.o alist.o  array.o art.o banlist.o bot_link.o cdcc.o cdns.o  chelp.o commands.o commands2.o compat.o cset.o ctcp.o dcc.o debug.o encrypt.o exec.o files.o flood.o fset.o functions.o funny.o glob.o hash.o hebrew.o help.o history.o hook.o if.o ignore.o input.o irc.o ircaux.o ircsig.o keys.o lastlog.o list.o log.o mail.o misc.o modules.o names.o network.o newio.o notice.o notify.o numbers.o output.o parse.o queue.o readlog.o reg.o screen.o server.o stack.o status.o struct.o tcl_public.o term.o timer.o translat.o user.o userlist.o vars.o who.o whowas.o window.o words.o   -ldl -ltinfo -lssl -lcrypto -lm -lcrypt
    ld: error: undefined symbol: operator
    >>> referenced by alias.c
    >>>               alias.o:(zzlex)
    cc: error: linker command failed with exit code 1 (use -v to see invocation)

    This is because several functions in source/expr2.c are marked __inline,
    without either static or extern keyword. The compiler then has to assume
    the function is also externally available.

    Fix this by marking the affected functions static.

    PR:             258464
    Approved by:    fernape (maintainer)
    MFH:            2021Q4

 irc/bitchx/files/patch-source_expr2.c (new) | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)