aboutsummaryrefslogtreecommitdiffstats
path: root/devel/elfutils
diff options
context:
space:
mode:
authorcem <cem@FreeBSD.org>2016-08-06 01:35:30 +0800
committercem <cem@FreeBSD.org>2016-08-06 01:35:30 +0800
commit5468ba1416db17980107f228cdc6f9257f9a66ef (patch)
treeb5b02b0767d89a8a2b4552bcbb2b128119284cd3 /devel/elfutils
parente803668324e33687d2b1118782f90ba77c1da746 (diff)
downloadfreebsd-ports-gnome-5468ba1416db17980107f228cdc6f9257f9a66ef.tar.gz
freebsd-ports-gnome-5468ba1416db17980107f228cdc6f9257f9a66ef.tar.zst
freebsd-ports-gnome-5468ba1416db17980107f228cdc6f9257f9a66ef.zip
elfutils: Fix port build after recent basename() API break
The previous basename() API was shadowing bugs anyway. This Linux-originated library assumes GNU basename(3) behavior. GNU basename(3) is non-destructive and non-allocating; it always returns a pointer into the original string. This library uses that behavior to do things like compare pointer results directly (the source path was already a basename) or subtract pointer values directly (compute the substring that constitutes dirname). Resolve the issue by aliasing all internal elfutils basename() invocations through an implementation of GNU basename(3) named "eu_basename." Build log highlighting the problem: http://beefy4.nyi.freebsd.org/data/head-amd64-default/p419462_s303652/logs/elfutils-0.163_6.log Approved by: bdrewery Differential Revision: https://reviews.freebsd.org/D7404
Diffstat (limited to 'devel/elfutils')
-rw-r--r--devel/elfutils/Makefile2
-rw-r--r--devel/elfutils/files/patch-lib_eu-config.h22
2 files changed, 22 insertions, 2 deletions
diff --git a/devel/elfutils/Makefile b/devel/elfutils/Makefile
index 9cc691c0796a..c6d71ff4fef6 100644
--- a/devel/elfutils/Makefile
+++ b/devel/elfutils/Makefile
@@ -3,7 +3,7 @@
PORTNAME= elfutils
PORTVERSION= 0.163
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= devel
MASTER_SITES= https://fedorahosted.org/releases/e/l/elfutils/${PORTVERSION}/
diff --git a/devel/elfutils/files/patch-lib_eu-config.h b/devel/elfutils/files/patch-lib_eu-config.h
index 74377ed88304..e5943f68b3e9 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 2015-06-11 11:38:55 UTC
+++ lib/eu-config.h
-@@ -187,4 +187,147 @@ asm (".section predict_data, \"aw\"; .pr
+@@ -187,4 +187,167 @@ asm (".section predict_data, \"aw\"; .pr
#endif
@@ -57,6 +57,26 @@
+ return (realpath(path, NULL));
+}
+
++/*
++ * A GNU-like basename().
++ *
++ * Unlike POSIX basename(3), this version never modifies its argument. If the
++ * argument ends in a slash, it returns the empty string.
++ */
++static inline char *
++eu_basename(const char *path)
++{
++ const char *slash;
++
++ slash = strrchr(path, '/');
++ if (slash != NULL)
++ slash++;
++ else
++ slash = path;
++ return (__DECONST(char *, slash));
++}
++#define basename eu_basename
++
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expr) ({ \
+ long value; \