Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jun 2016 15:35:42 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r416247 - in head/devel: gdb/files gdb66/files
Message-ID:  <201606011535.u51FZgxs011013@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed (src committer)
Date: Wed Jun  1 15:35:42 2016
New Revision: 416247
URL: https://svnweb.freebsd.org/changeset/ports/416247

Log:
  Make GDB build when basename() is POSIX compliant.
  
  GDB's libiberty.h has a prototype of the basename() function it which
  does not match the one that is part of POSIX, declared in libgen.h. This
  is normally never visible, as GDB never includes libgen.h. On FreeBSD,
  it unfortunately is, as our locally added copy of kgdb includes both.
  
  Fix up libiberty.h to just include libgen.h. I'm currently discussing
  with upstream how a clean fix should be done, but I guess that
  requires more refactoring to the existing code. We'd better not bother
  importing that and stick to this compact workaround.
  
  Reviewed by:	bapt@, mi@, Luca Pizzamiglio
  Differential Revision:	https://reviews.freebsd.org/D6630

Added:
  head/devel/gdb/files/patch-libiberty-basename   (contents, props changed)
  head/devel/gdb66/files/patch-libiberty-basename   (contents, props changed)

Added: head/devel/gdb/files/patch-libiberty-basename
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/gdb/files/patch-libiberty-basename	Wed Jun  1 15:35:42 2016	(r416247)
@@ -0,0 +1,11 @@
+--- include/libiberty.h
++++ include/libiberty.h
+@@ -109,7 +109,7 @@
+  || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) \
+  || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) \
+  || defined (__DragonFly__) || defined (HAVE_DECL_BASENAME) 
+-extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
++#include <libgen.h>
+ #else
+ /* Do not allow basename to be used if there is no prototype seen.  We
+    either need to use the above prototype or have one from

Added: head/devel/gdb66/files/patch-libiberty-basename
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/gdb66/files/patch-libiberty-basename	Wed Jun  1 15:35:42 2016	(r416247)
@@ -0,0 +1,11 @@
+--- include/libiberty.h
++++ include/libiberty.h
+@@ -98,7 +98,7 @@
+    is 1, we found it so don't provide any declaration at all.  */
+ #if !HAVE_DECL_BASENAME
+ #if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME)
+-extern char *basename (const char *);
++#include <libgen.h>
+ #else
+ /* Do not allow basename to be used if there is no prototype seen.  We
+    either need to use the above prototype or have one from



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