aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-03-14 11:21:00 +0000
committerNick Clifton <nickc@redhat.com>2014-03-14 11:21:00 +0000
commit5a026fc9a26fa613b67cffe87f8cf3b91bb186b4 (patch)
tree173f7306a8307c5e08f156093288954b0db0c192 /bfd
parentdc6ae99692892c869dc068c0cfd842168078305c (diff)
downloadgdb-5a026fc9a26fa613b67cffe87f8cf3b91bb186b4.zip
gdb-5a026fc9a26fa613b67cffe87f8cf3b91bb186b4.tar.gz
gdb-5a026fc9a26fa613b67cffe87f8cf3b91bb186b4.tar.bz2
Fix build time problem with MingGW hosts, which do not have a strnlen() function.
2014-03-13 Meador Inge <meadori@codesourcery.com> * configure.in: Add strnlen to AC_CHECK_DECLS. * config.in: Regenerate. * configure: Regenerate. * sysdep.h (strnlen): Add prototype. * dwarf.c (strnlen): Move prototype ... * sysdep.h (strnlen): ... to here.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/config.in4
-rwxr-xr-xbfd/configure11
-rw-r--r--bfd/configure.in1
-rw-r--r--bfd/sysdep.h4
5 files changed, 27 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index bde7262..6416fb5 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2014-03-14 Meador Inge <meadori@codesourcery.com>
+
+ * configure.in: Add strnlen to AC_CHECK_DECLS.
+ * config.in: Regenerate.
+ * configure: Regenerate.
+ * sysdep.h (strnlen): Add prototype.
+
2014-03-14 Alan Modra <amodra@gmail.com>
* elf32-ppc.c (ppc_elf_relocate_section): Correct overflow
diff --git a/bfd/config.in b/bfd/config.in
index 3106c28..05829e2 100644
--- a/bfd/config.in
+++ b/bfd/config.in
@@ -64,6 +64,10 @@
*/
#undef HAVE_DECL_STPCPY
+/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRNLEN
+
/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
*/
#undef HAVE_DECL_STRSTR
diff --git a/bfd/configure b/bfd/configure
index fbf5f44..c5cb2a1 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -13766,6 +13766,17 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_VSNPRINTF $ac_have_decl
_ACEOF
+ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strnlen" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNLEN $ac_have_decl
+_ACEOF
+
# Link in zlib if we can. This allows us to read compressed debug sections.
# This is used only by compress.c.
diff --git a/bfd/configure.in b/bfd/configure.in
index f1ec965..af98f62 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -239,6 +239,7 @@ AC_CHECK_DECLS(stpcpy)
AC_CHECK_DECLS(strstr)
AC_CHECK_DECLS(snprintf)
AC_CHECK_DECLS(vsnprintf)
+AC_CHECK_DECLS(strnlen)
# Link in zlib if we can. This allows us to read compressed debug sections.
# This is used only by compress.c.
diff --git a/bfd/sysdep.h b/bfd/sysdep.h
index a30da90..7e441eb 100644
--- a/bfd/sysdep.h
+++ b/bfd/sysdep.h
@@ -170,6 +170,10 @@ extern int fseeko64 (FILE *stream, off64_t offset, int whence);
#endif
#endif
+#if !HAVE_DECL_STRNLEN
+size_t strnlen (const char *, size_t);
+#endif
+
/* Define offsetof for those systems which lack it */
#ifndef offsetof