On Wed 03/02/2021 11:22, Gonzalo L. Rodriguez wrote: > Hello, > > I notified Haesbaert about it, but for now we can do the easy way. > > OK? Comments?
Instead of using CFLAGS+=-fcommon take fix from FreeBSD: diff --git Makefile Makefile index d8a148f08a6..8988c32fe0f 100644 --- Makefile +++ Makefile @@ -4,7 +4,7 @@ COMMENT = MDNS/DNS-SD daemon DISTNAME = openmdns-0.7 CATEGORIES = net -REVISION = 1 +REVISION = 2 MAINTAINER = Gonzalo L. R. <[email protected]> diff --git patches/patch-mdnsd_control_c patches/patch-mdnsd_control_c new file mode 100644 index 00000000000..a43c36f26eb --- /dev/null +++ patches/patch-mdnsd_control_c @@ -0,0 +1,17 @@ +$OpenBSD$ + +Fix -fno-common build error. Taken from +https://svnweb.freebsd.org/ports?view=revision&revision=549579 + +Index: mdnsd/control.c +--- mdnsd/control.c.orig ++++ mdnsd/control.c +@@ -53,6 +53,8 @@ void control_group_add_service(struct ctl_conn *, st + + extern struct mdnsd_conf *conf; + ++struct control_state control_state; ++ + void + control_lookup(struct ctl_conn *c, struct imsg *imsg) + { diff --git patches/patch-mdnsd_control_h patches/patch-mdnsd_control_h new file mode 100644 index 00000000000..cf40e16d158 --- /dev/null +++ patches/patch-mdnsd_control_h @@ -0,0 +1,23 @@ +$OpenBSD$ + +Fix -fno-common build error. Taken from +https://svnweb.freebsd.org/ports?view=revision&revision=549579 + +Index: mdnsd/control.h +--- mdnsd/control.h.orig ++++ mdnsd/control.h +@@ -26,10 +26,12 @@ + + #include "mdnsd.h" + +-struct { ++struct control_state { + struct event ev; + int fd; +-} control_state; ++}; ++ ++extern struct control_state control_state; + + enum blockmodes { + BM_NORMAL, diff --git patches/patch-mdnsd_mdns_c patches/patch-mdnsd_mdns_c new file mode 100644 index 00000000000..3d721004478 --- /dev/null +++ patches/patch-mdnsd_mdns_c @@ -0,0 +1,18 @@ +$OpenBSD$ + +Fix -fno-common build error. Taken from +https://svnweb.freebsd.org/ports?view=revision&revision=549579 + +Index: mdnsd/mdns.c +--- mdnsd/mdns.c.orig ++++ mdnsd/mdns.c +@@ -45,6 +45,9 @@ extern struct mdnsd_conf *conf; + struct question_tree question_tree; + struct cache_tree cache_tree; + ++pg_q pg_queue; ++pge_q pge_queue; ++ + /* + * RR cache + */ diff --git patches/patch-mdnsd_mdnsd_c patches/patch-mdnsd_mdnsd_c new file mode 100644 index 00000000000..95e7a716905 --- /dev/null +++ patches/patch-mdnsd_mdnsd_c @@ -0,0 +1,17 @@ +$OpenBSD$ + +Fix -fno-common build error. Taken from +https://svnweb.freebsd.org/ports?view=revision&revision=549579 + +Index: mdnsd/mdnsd.c +--- mdnsd/mdnsd.c.orig ++++ mdnsd/mdnsd.c +@@ -45,6 +45,8 @@ int mdns_sock(void); + void fetchmyname(char [MAXHOSTNAMELEN]); + void fetchhinfo(struct hinfo *); + ++ctl_conns_t ctl_conns; ++ + struct mdnsd_conf *conf = NULL; + extern char *malloc_options; + diff --git patches/patch-mdnsd_mdnsd_h patches/patch-mdnsd_mdnsd_h new file mode 100644 index 00000000000..8eed0becf0b --- /dev/null +++ patches/patch-mdnsd_mdnsd_h @@ -0,0 +1,32 @@ +$OpenBSD$ + +Fix -fno-common build error. Taken from +https://svnweb.freebsd.org/ports?view=revision&revision=549579 + +Index: mdnsd/mdnsd.h +--- mdnsd/mdnsd.h.orig ++++ mdnsd/mdnsd.h +@@ -223,9 +223,11 @@ struct pge { + }; + + /* Publish Group Queue, should hold all publishing groups */ +-TAILQ_HEAD(, pg) pg_queue; ++typedef TAILQ_HEAD(, pg) pg_q; ++extern pg_q pg_queue; + /* Publish Group Entry Queue, should hold all publishing group entries */ +-TAILQ_HEAD(, pge) pge_queue; ++typedef TAILQ_HEAD(, pge) pge_q; ++extern pge_q pge_queue; + + struct kif { + char ifname[IF_NAMESIZE]; +@@ -397,7 +399,8 @@ int rr_send_an(struct rr *); + void conflict_resolve_by_rr(struct rr *); + + /* control.c */ +-TAILQ_HEAD(ctl_conns, ctl_conn) ctl_conns; ++typedef TAILQ_HEAD(ctl_conns, ctl_conn) ctl_conns_t; ++extern ctl_conns_t ctl_conns; + int control_send_rr(struct ctl_conn *, struct rr *, int); + int control_send_ms(struct ctl_conn *, struct mdns_service *, int); + int control_try_answer_ms(struct ctl_conn *, char[MAXHOSTNAMELEN]); diff --git pkg/PLIST pkg/PLIST index 078e28e8f81..662f4af4855 100644 --- pkg/PLIST +++ pkg/PLIST @@ -1,9 +1,9 @@ @comment $OpenBSD: PLIST,v 1.5 2018/09/04 12:46:18 espie Exp $ @newgroup _mdnsd:664 @newuser _mdnsd:664:_mdnsd:daemon:MDNS Daemon:/var/empty:/sbin/nologin +@rcscript ${RCDIR}/mdnsd @bin bin/mdnsctl @bin bin/mdnsd @man man/man8/mdnsctl.8 @man man/man8/mdnsd.8 share/doc/pkg-readmes/${PKGSTEM} -@rcscript ${RCDIR}/mdnsd
