aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2021-11-07 23:42:46 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2021-11-08 09:06:43 +0000
commitd33e4c76bdc723c7059c841dc4ad14be6a30d8ac (patch)
tree41947f86379b8521e2c238b6e5327623619a4ad6
parentad491a1d4f4447ac5884ceb3930d215a26becd88 (diff)
downloadports-d33e4c76bdc723c7059c841dc4ad14be6a30d8ac.tar.gz
ports-d33e4c76bdc723c7059c841dc4ad14be6a30d8ac.zip
devel/elfutils: Fix build after mempcpy(3) and wmempcpy(3) were added
PR: 258092 (cherry picked from commit 06a7ac65bd3efb5eb1a1705a55f11acc812d941d)
-rw-r--r--devel/elfutils/Makefile6
-rw-r--r--devel/elfutils/files/patch-lib_eu-config.h6
2 files changed, 11 insertions, 1 deletions
diff --git a/devel/elfutils/Makefile b/devel/elfutils/Makefile
index 894ce37687dc..98b4cd366da5 100644
--- a/devel/elfutils/Makefile
+++ b/devel/elfutils/Makefile
@@ -48,6 +48,12 @@ CONFIGURE_ARGS+= --program-prefix=eu-
# Disable debuginfod until option support can be added:
CONFIGURE_ARGS+= --disable-debuginfod
+.include <bsd.port.options.mk>
+
+.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1300512 # 2021-07-17
+CFLAGS+= -DFREEBSD_HAS_MEMPCPY
+.endif
+
pre-configure:
@${CP} -a \
${LOCALBASE}/share/gnulib/lib/obstack.c \
diff --git a/devel/elfutils/files/patch-lib_eu-config.h b/devel/elfutils/files/patch-lib_eu-config.h
index f9502d4abe2a..04549063aa1c 100644
--- a/devel/elfutils/files/patch-lib_eu-config.h
+++ b/devel/elfutils/files/patch-lib_eu-config.h
@@ -1,6 +1,6 @@
--- lib/eu-config.h.orig 2020-03-30 12:17:45 UTC
+++ lib/eu-config.h
-@@ -176,6 +176,182 @@ asm (".section predict_data, \"aw\"; .previous\n"
+@@ -176,6 +176,186 @@ asm (".section predict_data, \"aw\"; .previous\n"
#define ELFUTILS_HEADER(name) <lib##name.h>
@@ -23,6 +23,9 @@
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
++#ifndef FREEBSD_HAS_MEMPCPY // fix for the build failure, see bug#258092: mempcpy and wmempcpy were added in commits:
++// on 14: ee37f64cf875255338f917a9da76c643cf59786c on 2021-07-15
++// on 13: dba677d13b26ad5422133b2ab76486b74d63ade4 on 2021-07-22
+static inline void *
+mempcpy(void * restrict dst, const void * restrict src, size_t len)
+{
@@ -36,6 +39,7 @@
+
+ return (wmemcpy(dst, src, len) + len);
+}
++#endif
+#pragma GCC diagnostic pop
+
+static inline void *