Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Aug 2016 17:35:31 +0000 (UTC)
From:      "Conrad E. Meyer" <cem@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r419697 - in head/devel/elfutils: . files
Message-ID:  <201608051735.u75HZVlY068321@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem (src committer)
Date: Fri Aug  5 17:35:30 2016
New Revision: 419697
URL: https://svnweb.freebsd.org/changeset/ports/419697

Log:
  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

Modified:
  head/devel/elfutils/Makefile
  head/devel/elfutils/files/patch-lib_eu-config.h

Modified: head/devel/elfutils/Makefile
==============================================================================
--- head/devel/elfutils/Makefile	Fri Aug  5 17:15:57 2016	(r419696)
+++ head/devel/elfutils/Makefile	Fri Aug  5 17:35:30 2016	(r419697)
@@ -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}/
 

Modified: head/devel/elfutils/files/patch-lib_eu-config.h
==============================================================================
--- head/devel/elfutils/files/patch-lib_eu-config.h	Fri Aug  5 17:15:57 2016	(r419696)
+++ head/devel/elfutils/files/patch-lib_eu-config.h	Fri Aug  5 17:35:30 2016	(r419697)
@@ -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;					\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608051735.u75HZVlY068321>