[PATCH] Fix binutils build on hppa64-hpux with gcc-16
John David Anglin
dave.anglin@bell.net
Sun Nov 30 17:27:21 GMT 2025
Okay?
Dave
---
Fix binutils build on hppa64-hpux with gcc-16
With gcc-16, implicit function declarations are errors. We
need to ensure that ffs() and strtoull() are declared.
2025-11-30 John David Anglin <danglin@gcc.gnu.org>
bfd/ChangeLog:
* bfdio.c: Include libiberty.h.
* configure.ac: Check for presence of long long type. Check
for strtoull declaration.
* configure: Regenerate.
* config.in: Regenerate.
* strings.h: Include strings.h.
bfd/ChangeLog:
* configure.ac: Check for presence of long long type. Check
for strtoull declaration.
* configure: Regenerate.
* config.in: Regenerate.
diff --git a/bfd/bfdio.c b/bfd/bfdio.c
index 6bd7a2422de..bfd895b142e 100644
--- a/bfd/bfdio.c
+++ b/bfd/bfdio.c
@@ -25,6 +25,7 @@
#include <limits.h>
#include "bfd.h"
#include "libbfd.h"
+#include "libiberty.h"
#include "aout/ar.h"
#if defined (_WIN32)
#include <windows.h>
diff --git a/bfd/configure.ac b/bfd/configure.ac
index 4fb3bf41f34..bf0ae5ff9e2 100644
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -205,6 +205,11 @@ ZW_GNU_GETTEXT_SISTER_DIR
AC_SUBST(HDEFINES)
AC_PROG_INSTALL
+# Check for presense of long long
+AC_CHECK_TYPE([long long],
+ [AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have the `long long' type.])],
+ [])
+
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long)
@@ -222,7 +227,7 @@ AC_CHECK_HEADERS(fcntl.h sys/file.h sys/resource.h sys/stat.h sys/types.h \
AC_CHECK_FUNCS(fcntl fdopen fileno fls getgid getpagesize getrlimit getuid \
sysconf)
-AC_CHECK_DECLS([basename, ffs, stpcpy, asprintf, vasprintf, strnlen])
+AC_CHECK_DECLS([basename, ffs, stpcpy, asprintf, vasprintf, strnlen, strtoull])
AC_CHECK_DECLS([___lc_codepage_func], [], [], [[#include <locale.h>]])
BFD_BINARY_FOPEN
diff --git a/bfd/sysdep.h b/bfd/sysdep.h
index 1f54a9d897d..4714c22d0c3 100644
--- a/bfd/sysdep.h
+++ b/bfd/sysdep.h
@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
+#include <strings.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/ld/configure.ac b/ld/configure.ac
index 3e44e3361ef..dbf06f60ec4 100644
--- a/ld/configure.ac
+++ b/ld/configure.ac
@@ -451,7 +451,11 @@ AC_CHECK_FUNCS(close getrusage glob lseek mkstemp open realpath waitpid)
BFD_BINARY_FOPEN
-AC_CHECK_DECLS([environ, stpcpy])
+AC_CHECK_TYPE([long long],
+ [AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have the `long long' type.])],
+ [])
+
+AC_CHECK_DECLS([environ, stpcpy, strtoull])
GCC_AC_FUNC_MMAP
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20251130/0a744fa9/attachment.sig>
More information about the Binutils
mailing list