Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2013 17:30:02 -0600
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/175746: [PATCH] irc/eggdrop: Fix build with clang
Message-ID:  <201301312330.r0VNU6lO042790@freefall.freebsd.org>
Resent-Message-ID: <201301312340.r0VNe0td044306@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         175746
>Category:       ports
>Synopsis:       [PATCH] irc/eggdrop: Fix build with clang
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 31 23:40:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Bryan Drewery
>Release:        FreeBSD 8.3-RELEASE-p5 i386
>Organization:
>Environment:

	
>Description:
	irc/eggdrop does not build with clang.

	Linking eggdrop (standard build).

	clang -o ../eggdrop bg.o botcmd.o botmsg.o botnet.o chanprog.o cmds.o dcc.o  dccutil.o dns.o flags.o language.o match.o main.o mem.o misc.o misc_file.o  modules.o net.o rfc1459.o tcl.o tcldcc.o tclhash.o tclmisc.o tcluser.o  userent.o userrec.o users.o  -L/usr/local/lib -ltcl85 -lm -lpthread md5/md5c.o compat/*.o `cat mod/mod.xlibs`
	match.o: In function `cron_match':
	/wrkdirs/tmp/match.tmp.91amd64-job-08.77401.i:(.text+0xb9f): undefined reference to `cron_matchfld'
	/wrkdirs/tmp/match.tmp.91amd64-job-08.77401.i:(.text+0xbc5): undefined reference to `cron_matchfld'
	main.o: In function `mainloop':
	/wrkdirs/tmp/main.tmp.91amd64-job-08.82472.i:(.text+0x3f8): undefined reference to `garbage_collect_tclhash'
	modules.o:(.data+0x380): undefined reference to `open_listen'
	tcldcc.o: In function `tcl_listen':
	/wrkdirs/tmp/tcldcc.tmp.91amd64-job-08.28665.i:(.text+0x263e): undefined reference to `open_listen'
	clang: error: linker command failed with exit code 1 (use -v to see invocation)
	*** [../eggdrop] Error code 1

	Stop in /wrkdirs/usr/ports/irc/eggdrop/work/eggdrop1.6.21/src.
	*** [modegg] Error code 1

	Stop in /wrkdirs/usr/ports/irc/eggdrop/work/eggdrop1.6.21.
	*** [do-build] Error code 1

	Stop in /usr/ports/irc/eggdrop.
	===>  Cleaning for eggdrop-1.6.21
	build of /usr/ports/irc/eggdrop ended at Fri Jan 25 19:53:48 UTC 2013

>How-To-Repeat:
	Add to /etc/make.conf and build:

	CC=clang
	CXX=clang++
	CPP=clang-cpp

>Fix:

	Apply attached patch (mirrored at http://people.freebsd.org/~bdrewery/patch-eggdrop-clang.txt)
	Patches obtained from NetBSD: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/chat/eggdrop/patches/

--- patch-eggdrop-clang.txt begins here ---
# svn status
M       Makefile
A       files/patch-src_match.c
A       files/patch-src_net.c
A       files/patch-src_proto.h
A       files/patch-src_tclhash.c
A       files/patch-src_tclhash.h

Index: Makefile
===================================================================
--- Makefile	(revision 311339)
+++ Makefile	(working copy)
@@ -1,12 +1,9 @@
-# New ports collection makefile for:	eggdrop
-# Date created:				18.01.2003
-# Whom:						Ulrich Spoerlein <q@uni.de>
-#
+# Created by: Ulrich Spoerlein <q@uni.de>
 # $FreeBSD$
-#
 
 PORTNAME=	eggdrop
 PORTVERSION=	1.6.21
+PORTREVISION=	1
 CATEGORIES=	irc
 MASTER_SITES=	ftp://ftp.eggheads.org/pub/eggdrop/source/1.6/
 DISTNAME=	${PORTNAME}${PORTVERSION}
Index: files/patch-src_match.c
===================================================================
--- files/patch-src_match.c	(revision 0)
+++ files/patch-src_match.c	(working copy)
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_match.c,v 1.1 2012/11/16 00:35:28 joerg Exp $
+
+--- src/match.c.orig	2012-11-15 10:29:42.000000000 +0000
++++ src/match.c
+@@ -367,7 +367,7 @@ int cidr_match(char *m, char *n, int cou
+ /* Inline for cron_match (obviously).
+  * Matches a single field of a crontab expression.
+  */
+-inline int cron_matchfld(char *mask, int match)
++static inline int cron_matchfld(char *mask, int match)
+ {
+   int skip = 0, f, t;
+   char *p, *q;

Property changes on: files/patch-src_match.c
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: files/patch-src_net.c
===================================================================
--- files/patch-src_net.c	(revision 0)
+++ files/patch-src_net.c	(working copy)
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_net.c,v 1.1 2012/11/16 00:35:28 joerg Exp $
+
+--- src/net.c.orig	2012-11-15 10:30:07.000000000 +0000
++++ src/net.c
+@@ -564,7 +564,7 @@ int open_address_listen(IP addr, int *po
+ /* Returns a socket number for a listening socket that will accept any
+  * connection -- port # is returned in port
+  */
+-inline int open_listen(int *port)
++int open_listen(int *port)
+ {
+   return open_address_listen(myip[0] ? getmyip() : INADDR_ANY, port);
+ }

Property changes on: files/patch-src_net.c
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: files/patch-src_proto.h
===================================================================
--- files/patch-src_proto.h	(revision 0)
+++ files/patch-src_proto.h	(working copy)
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_proto.h,v 1.1 2012/11/16 00:35:28 joerg Exp $
+
+--- src/proto.h.orig	2012-11-15 10:30:20.000000000 +0000
++++ src/proto.h
+@@ -271,7 +271,7 @@ int getsock(int);
+ void killsock(int);
+ void killtclsock(int);
+ int answer(int, char *, unsigned long *, unsigned short *, int);
+-inline int open_listen(int *);
++int open_listen(int *);
+ int open_address_listen(IP addr, int *);
+ int open_telnet(char *, int);
+ int open_telnet_dcc(int, char *, char *);

Property changes on: files/patch-src_proto.h
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: files/patch-src_tclhash.c
===================================================================
--- files/patch-src_tclhash.c	(revision 0)
+++ files/patch-src_tclhash.c	(working copy)
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_tclhash.c,v 1.1 2012/11/16 00:35:28 joerg Exp $
+
+--- src/tclhash.c.orig	2012-11-15 10:32:40.000000000 +0000
++++ src/tclhash.c
+@@ -109,7 +109,7 @@ static inline void tcl_bind_list_delete(
+   nfree(tl);
+ }
+ 
+-inline void garbage_collect_tclhash(void)
++void garbage_collect_tclhash(void)
+ {
+   tcl_bind_list_t *tl, *tl_next, *tl_prev;
+   tcl_bind_mask_t *tm, *tm_next, *tm_prev;

Property changes on: files/patch-src_tclhash.c
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: files/patch-src_tclhash.h
===================================================================
--- files/patch-src_tclhash.h	(revision 0)
+++ files/patch-src_tclhash.h	(working copy)
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_tclhash.h,v 1.1 2012/11/16 00:35:28 joerg Exp $
+
+--- src/tclhash.h.orig	2012-11-15 10:32:27.000000000 +0000
++++ src/tclhash.h
+@@ -75,7 +75,7 @@ typedef struct tcl_bind_list_b {
+ 
+ #ifndef MAKING_MODS
+ 
+-inline void garbage_collect_tclhash(void);
++void garbage_collect_tclhash(void);
+ 
+ void init_bind(void);
+ void kill_bind(void);

Property changes on: files/patch-src_tclhash.h
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- patch-eggdrop-clang.txt ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301312330.r0VNU6lO042790>