aboutsummaryrefslogtreecommitdiff
path: root/devel/elfutils
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2016-08-05 17:35:30 +0000
committerConrad Meyer <cem@FreeBSD.org>2016-08-05 17:35:30 +0000
commita4bd7c8f5d21a7434cb2dcd97873eb0a80c7e1bf (patch)
treeb5b02b0767d89a8a2b4552bcbb2b128119284cd3 /devel/elfutils
parentfbf8ca06281ce2ab8a10e0626e988cff23220fd5 (diff)
downloadports-a4bd7c8f5d21a7434cb2dcd97873eb0a80c7e1bf.tar.gz
ports-a4bd7c8f5d21a7434cb2dcd97873eb0a80c7e1bf.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
Notes
Notes: svn path=/head/; revision=419697
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; \