From 48f7c5e69e7c16f408b45c0b4279025064af08fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20E=C3=9Fer?= Date: Tue, 22 Sep 2020 19:29:30 +0000 Subject: [PATCH] Fix build with -fno-common Remove -fcommon option from Makefile --- net/aget/Makefile | 3 +-- net/aget/files/patch-Download.c | 11 +++++++++++ net/aget/files/patch-Head.c | 10 ++++++++++ net/aget/files/patch-Misc.h | 11 +++++++++++ net/aget/files/patch-Signal.h | 11 +++++++++++ net/aget/files/patch-main.c | 12 ++++++++++++ 6 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 net/aget/files/patch-Download.c create mode 100644 net/aget/files/patch-Head.c create mode 100644 net/aget/files/patch-Misc.h create mode 100644 net/aget/files/patch-Signal.h create mode 100644 net/aget/files/patch-main.c diff --git a/net/aget/Makefile b/net/aget/Makefile index f40ed9cd8917..f7c7f868506d 100644 --- a/net/aget/Makefile +++ b/net/aget/Makefile @@ -3,6 +3,7 @@ PORTNAME= aget PORTVERSION= 0.4.1 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= http://www.enderunix.org/aget/ @@ -14,8 +15,6 @@ LICENSE_FILE= ${WRKSRC}/COPYING MAKE_ARGS= CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" LDFLAGS+= -pthread -# Fix build with clang11 -CFLAGS+= -fcommon PLIST_FILES= bin/aget man/man1/aget.1.gz diff --git a/net/aget/files/patch-Download.c b/net/aget/files/patch-Download.c new file mode 100644 index 000000000000..a26e5dd7c898 --- /dev/null +++ b/net/aget/files/patch-Download.c @@ -0,0 +1,11 @@ +--- Download.c.orig 2009-05-12 05:30:23 UTC ++++ Download.c +@@ -107,7 +107,7 @@ void * http_get(void *arg) { + pthread_mutex_unlock(&bwritten_mutex); + + while (td->offset < foffset) { +- memset(rbuf, GETRECVSIZ, 0); ++ memset(rbuf, 0, GETRECVSIZ); + dr = recv(sd, rbuf, GETRECVSIZ, 0); + if ((td->offset + dr) > foffset) + dw = pwrite(td->fd, rbuf, foffset - td->offset, td->offset); diff --git a/net/aget/files/patch-Head.c b/net/aget/files/patch-Head.c new file mode 100644 index 000000000000..390de91bb759 --- /dev/null +++ b/net/aget/files/patch-Head.c @@ -0,0 +1,10 @@ +--- Head.c.orig 2009-05-12 05:22:42 UTC ++++ Head.c +@@ -2,7 +2,6 @@ + #define _XOPEN_SOURCE 500 + #endif + +- + #include + #include + #include diff --git a/net/aget/files/patch-Misc.h b/net/aget/files/patch-Misc.h new file mode 100644 index 000000000000..71eccbe9fac4 --- /dev/null +++ b/net/aget/files/patch-Misc.h @@ -0,0 +1,11 @@ +--- Misc.h.orig 2009-05-12 05:24:18 UTC ++++ Misc.h +@@ -24,7 +24,7 @@ void Log(char *, ...); /* Log */ + void updateProgressBar(float, float); + void handleHttpRetcode(char *); + +-time_t t_start, t_finish; ++extern time_t t_start, t_finish; + + #endif + diff --git a/net/aget/files/patch-Signal.h b/net/aget/files/patch-Signal.h new file mode 100644 index 000000000000..efcd57360dae --- /dev/null +++ b/net/aget/files/patch-Signal.h @@ -0,0 +1,11 @@ +--- Signal.h.orig 2020-09-22 19:16:50 UTC ++++ Signal.h +@@ -4,7 +4,7 @@ + #include + #include + +-sigset_t signal_set; ++extern sigset_t signal_set; + + void * signal_waiter(void *arg); + void sigint_handler(void); diff --git a/net/aget/files/patch-main.c b/net/aget/files/patch-main.c new file mode 100644 index 000000000000..fadd8062e8a1 --- /dev/null +++ b/net/aget/files/patch-main.c @@ -0,0 +1,12 @@ +--- main.c.orig 2009-05-12 05:41:23 UTC ++++ main.c +@@ -15,6 +15,9 @@ + #include "main.h" + #include + ++sigset_t signal_set; ++time_t t_start, t_finish; ++ + int main(int argc, char **argv) + { + extern char *optarg;