From dc7880696558831fccc6ce5a7470095dd6765cf4 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 13 Sep 2021 10:15:15 +0200 Subject: [PATCH] irc/unreal: fix inline which should be static During an exp-run for llvm 13 (see bug 258209), it turned out that irc/unreal fails to build with clang 13: cc -I../include -I@TREINCDIR@ -I/wrkdirs/usr/ports/irc/unreal/work/Unreal3.2.10.7/extras/regexp/include -pipe -O2 -pipe -I/usr/local/include -fcommon -fstack-protector-strong -fno-strict-aliasing -funsigned-char -Wl,-export-dynamic -L/usr/local/lib -fstack-protector-strong -lssl -lcrypto -o ircd timesynch.o res.o s_bsd.o auth.o aln.o channel.o cloak.o crule.o dbuf.o events.o fdlist.o hash.o help.o ircd.o ircsprintf.o list.o lusers.o match.o modules.o packet.o parse.o s_auth.o s_conf.o s_debug.o s_err.o s_extra.o s_kline.o s_misc.o s_numeric.o s_serv.o s_svs.o socket.o ssl.o s_user.o charsys.o scache.o send.o support.o umodes.o version.o whowas.o zip.o cidr.o random.o extcmodes.o extbans.o md5.o api-isupport.o api-command.o -L/usr/local/lib -fstack-protector-strong -lcrypt /wrkdirs/usr/ports/irc/unreal/work/Unreal3.2.10.7/extras/regexp/lib/libtre.a -L/usr/local/lib -fstack-protector-strong -L/usr/local/lib -lcares -lssl -lcrypto ld: error: undefined symbol: parse_addlag >>> referenced by parse.c >>> parse.o:(parse) >>> referenced by parse.c >>> parse.o:(parse) cc: error: linker command failed with exit code 1 (use -v to see invocation) *** Error code 1 This is because parse_addlag() is marked as 'inline' but does not have either 'static' or 'extern' specifiers. Add a 'static' specifier to resolve the link error. PR: 258472 Approved by: maintainer timeout (2 weeks) MFH: 2021Q4 --- irc/unreal/files/patch-src_parse.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 irc/unreal/files/patch-src_parse.c diff --git a/irc/unreal/files/patch-src_parse.c b/irc/unreal/files/patch-src_parse.c new file mode 100644 index 000000000000..a71a5f67e229 --- /dev/null +++ b/irc/unreal/files/patch-src_parse.c @@ -0,0 +1,11 @@ +--- src/parse.c.orig 2016-09-03 19:34:06 UTC ++++ src/parse.c +@@ -156,7 +156,7 @@ void ban_flooder(aClient *cptr) + /* + * This routine adds fake lag if needed. + */ +-inline void parse_addlag(aClient *cptr, int cmdbytes) ++static inline void parse_addlag(aClient *cptr, int cmdbytes) + { + if (!IsServer(cptr) && !IsNoFakeLag(cptr) && + #ifdef FAKELAG_CONFIGURABLE