| Message ID | aSx-eXf3JJcs-WU9@mx3210.local |
|---|---|
| State | New |
| Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DFD2E48F66A5 for <patchwork@sourceware.org>; Sun, 30 Nov 2025 17:28:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DFD2E48F66A5 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=bell.net header.i=@bell.net header.a=rsa-sha256 header.s=selector1 header.b=0BmwjwC8 X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from cmx-mtlrgo001.bell.net (mta-mtl-006.bell.net [209.71.208.28]) by sourceware.org (Postfix) with ESMTP id 635DE48F90EA for <binutils@sourceware.org>; Sun, 30 Nov 2025 17:27:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 635DE48F90EA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=bell.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bell.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 635DE48F90EA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.71.208.28 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764523643; cv=none; b=mgNil0h2ZbzkSzTzTUHtN+TCO7ILvf06KYRTTjgWgYGkpNA7o7lqBrVlUB1u+nHB3OawTEgR8m/RMxWES1sUU5U4hmS3MpbvkmbVMagHmBjtFjqwU9NrIFbT0sTX3RNc6KkTaxV8Ar8pTrR5FtGXcyefNzPvikQl1nwDPfceERQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764523643; c=relaxed/simple; bh=4K1s12GYNkjH3kI3ELPQkXfEbFpIaiTchSD6p7T/spk=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=vbZhL5rfK7iyx5WeNibqmHnHfRw2c3cexEqUwlaa+FU9C5h6PFQRogW0+xZh6BLhZVlVihaEq+4igiqj0f+hvBF6yhXCUuLTpI4I7kyCP/pD9yXb5i0QbN23COlAPCIu7nxCwhjh/qkuTjVG+BpGmJhYZhTHMUJBKuFQfVBhTr0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 635DE48F90EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bell.net; s=selector1; t=1764523643; bh=Cu1K2cEEkIk5dt1ouAg1CObLVAoqoZB7IOzYStYqiYc=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=0BmwjwC85E3aH8PYCUQha77c/zsorg9pxyoVEu7gRGZb/jNKVLExp2tFVa0L3GLXV81/lqOv9TVxSJyFcLR17ibnCfdEgC0uR435dGpm2+jqg1sI4x1cSAz5/lupR5NKaWAKb1Mzl+bq6iiYJ7A37k+SoraFMQ4EpeLbVQ3nakos7MVD5h+aOcoQNySZXA8adHl35Xo9HCV74xcpL7A1bCbgXNxvuZN4w4o+5+iymXvYIvmmisMir1rk4YIXwyZfvZiemCDpyqEfS3uc28N1KIuKOXS2iBl7zuaOeMiHE4Qxc3XOsB0Oaliy3WUJU7aAoUupfN967M2+Ggk9OmKojQ== X-RG-SOPHOS: Clean X-RG-VADE-SC: 0 X-RG-VADE: Clean X-Originating-IP: [142.126.189.246] X-RG-Env-Sender: dave.anglin@bell.net X-RG-Rigid: 690A2362037C5D0D X-RazorGate-Vade: dmFkZTGEFmf1sivPcmFUjY1c/uVETpsQjiMCjebkvv2ERBIdpBlkQMYCdr2OVzKgPZhCF0sfuPYvuYT49hMp39EUybY4IHnG2zVnejGF6P9aTUAcRbPDoBvoyKf8ZwVHfZDyywaVReTPXWE+QZV4K0ok74tqgZbpgVtRnJ9T7ejcP0uUvHAmFiqImcOaErmXtyfQiXkWDt4cAs7ouDALEwB27aDgsro/6Ix9bBPetEHJSlB5g12aqdPQ9h/qBR7Ccdm3neyuh91FAB9vWTH+EKQqObDMltemynahHlaLGMQ0edumlqu3oxNijml3m7r0JOIIRYpb5TiLwhOP5i4XbcwJMbS5ivcUtyVUlVv7J/HQc9EyefNI01ViO9XDXOGoKaLAThNPIY5CA90ijk3dC+OcehRzN4KTSUtUuCGbwePiuBKVTQ8RAKFLGcgdyRRKN6IxR2EGsXNmu3SP5SQfCMACf8zz72cRKRZgxlXylMotFwjsRA+CzN4CkKEdlnTUgHM1xoWwcHHvNa2TrN75x1DGS5Ddt8uXzIebGnNhdma/rXgHoVkyip8rphZ3rF+WR6ON31vObhUEcflrROkVi225cE+MjeHj8S7sd4GT84KxC9o/ogpQjLqvZz6rYotMCOzc8At6bf6A6TcOlzMewwtq57D53mq2ImLtUZxtUr8hIrjwkA X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from mx3210.local (142.126.189.246) by cmx-mtlrgo001.bell.net (authenticated as dave.anglin@bell.net) id 690A2362037C5D0D; Sun, 30 Nov 2025 12:27:22 -0500 Date: Sun, 30 Nov 2025 12:27:21 -0500 From: John David Anglin <dave.anglin@bell.net> To: Binutils <binutils@sourceware.org> Subject: [PATCH] Fix binutils build on hppa64-hpux with gcc-16 Message-ID: <aSx-eXf3JJcs-WU9@mx3210.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Qyu2tf51c1iIus6p" Content-Disposition: inline X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_PASS, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
Fix binutils build on hppa64-hpux with gcc-16
|
|
Commit Message
John David Anglin
Nov. 30, 2025, 5:27 p.m. UTC
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.
Comments
On 30.11.2025 18:27, John David Anglin wrote: > --- 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.])], > + []) Why would this be needed? C99 guarantees existence of long long, doesn't it? > --- a/bfd/sysdep.h > +++ b/bfd/sysdep.h > @@ -36,6 +36,7 @@ > #include <stdlib.h> > #include <stddef.h> > #include <string.h> > +#include <strings.h> Iirc this isn't a standard header, and hence can't be included without being sure it exists. Given the patch description it's also not clear to me what the #include would be needed for. Jan
On 2025-12-01 2:56 a.m., Jan Beulich wrote: > On 30.11.2025 18:27, John David Anglin wrote: >> --- 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.])], >> + []) > > Why would this be needed? C99 guarantees existence of long long, doesn't it? It's needed because of the way libiberty.h declares strtoull(). hppa64-hpux lacks strtoull(), so it's provided by libiberty. > >> --- a/bfd/sysdep.h >> +++ b/bfd/sysdep.h >> @@ -36,6 +36,7 @@ >> #include <stdlib.h> >> #include <stddef.h> >> #include <string.h> >> +#include <strings.h> > > Iirc this isn't a standard header, and hence can't be included without being > sure it exists. Given the patch description it's also not clear to me what > the #include would be needed for. It's for ffs(). Linux has: NAME ffs, ffsl, ffsll - find first bit set in a word LIBRARY Standard C library (libc, -lc) SYNOPSIS #include <strings.h> int ffs(int i); and open group has: NAME ffs - find first set bit SYNOPSIS [XSI] #include <strings.h> int ffs(int i); glibc implemented ffs() in glibc 2.12: Feature Test Macro Requirements for glibc (see feature_test_macros(7)): ffs(): Since glibc 2.12: _XOPEN_SOURCE >= 700 || ! (_POSIX_C_SOURCE >= 200809L) || /* glibc >= 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE Before glibc 2.12: none Dave
On 01.12.2025 16:58, John David Anglin wrote: > On 2025-12-01 2:56 a.m., Jan Beulich wrote: >> On 30.11.2025 18:27, John David Anglin wrote: >>> --- 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.])], >>> + []) >> >> Why would this be needed? C99 guarantees existence of long long, doesn't it? > > It's needed because of the way libiberty.h declares strtoull(). hppa64-hpux lacks > strtoull(), so it's provided by libiberty. With us requiring C99 now, can we even reliably run on a system not offering (complete) C99 support? >>> --- a/bfd/sysdep.h >>> +++ b/bfd/sysdep.h >>> @@ -36,6 +36,7 @@ >>> #include <stdlib.h> >>> #include <stddef.h> >>> #include <string.h> >>> +#include <strings.h> >> >> Iirc this isn't a standard header, and hence can't be included without being >> sure it exists. Given the patch description it's also not clear to me what >> the #include would be needed for. > > It's for ffs(). > > Linux has: > > NAME > ffs, ffsl, ffsll - find first bit set in a word > > LIBRARY > Standard C library (libc, -lc) > > SYNOPSIS > #include <strings.h> > > int ffs(int i); > > and open group has: > > NAME > > ffs - find first set bit > > SYNOPSIS > > [XSI] #include <strings.h> > > int ffs(int i); > > glibc implemented ffs() in glibc 2.12: > > Feature Test Macro Requirements for glibc (see feature_test_macros(7)): > > ffs(): > Since glibc 2.12: > _XOPEN_SOURCE >= 700 > || ! (_POSIX_C_SOURCE >= 200809L) > || /* glibc >= 2.19: */ _DEFAULT_SOURCE > || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE > Before glibc 2.12: > none Okay, but none of this make strings.h really standard. Wouldn't it again be libiberty to cover for the differences (e.g. lack of ffs() decl) in such a case? Jan
On 2025-12-01 11:11 a.m., Jan Beulich wrote: > Okay, but none of this make strings.h really standard. Wouldn't it again be > libiberty to cover for the differences (e.g. lack of ffs() decl) in such a > case? ffs() is declared in strings.h in both hpux11 and glibc linux. So, I don't think this is a libiberty issue. I would have thought this issue would affect glibc targets. Have you tried building binutils with gcc-16 or looking for a warning regarding the implicit declaration of ffs()? Maybe problem is hidden by gcc's __builtin_ffs() on targets with hardware support for ffs. Maybe would show if -fno-builtin is added to CFLAGS for build. Dave
On 01.12.2025 18:12, John David Anglin wrote: > On 2025-12-01 11:11 a.m., Jan Beulich wrote: >> Okay, but none of this make strings.h really standard. Wouldn't it again be >> libiberty to cover for the differences (e.g. lack of ffs() decl) in such a >> case? > > ffs() is declared in strings.h in both hpux11 and glibc linux. So, I don't > think this is a libiberty issue. I didn't say it's a libiberty issue; I said libiberty might help addressing the issue. Or else other configure machinery to determine whether strings.h exists and actually contains what we're after. Recall that other, "less-GNU" environments (think about the *BSD-s, for example, or see how there's makefile.vms) also need to be covered (i.e. keep building). That said, I notice bfd/elf32-xtensa.c includes strings.h unconditionally as well. I'd similarly question this being legitimate. > I would have thought this issue would affect glibc targets. Have you tried > building binutils with gcc-16 or looking for a warning regarding the implicit > declaration of ffs()? What I see is configure output like this checking whether declaration is required for ffs... yes and later checking whether ffs is declared... yes No compiler warnings. Instead bfd/sysdep.h already has #if !HAVE_DECL_FFS extern int ffs (int); #endif So is it perhaps the case that configure doesn't work correctly on hpux? Jan
John David Anglin <dave.anglin@bell.net> writes: > On 2025-12-01 11:11 a.m., Jan Beulich wrote: >> Okay, but none of this make strings.h really standard. Wouldn't it again be >> libiberty to cover for the differences (e.g. lack of ffs() decl) in such a >> case? > > ffs() is declared in strings.h in both hpux11 and glibc linux. So, I don't > think this is a libiberty issue. > > I would have thought this issue would affect glibc targets. Have you tried > building binutils with gcc-16 or looking for a warning regarding the implicit > declaration of ffs()? Note that it changed in GCC 14. Not saying this to be pedantic, but that there's been no recent change here (~1.5 years ago now, nearly 2) in terms of GCC, and maybe something else broke instead. > > Maybe problem is hidden by gcc's __builtin_ffs() on targets with hardware support > for ffs. Maybe would show if -fno-builtin is added to CFLAGS for build. > > Dave
On 2025-12-02 2:44 a.m., Jan Beulich wrote: > On 01.12.2025 18:12, John David Anglin wrote: >> On 2025-12-01 11:11 a.m., Jan Beulich wrote: >>> Okay, but none of this make strings.h really standard. Wouldn't it again be >>> libiberty to cover for the differences (e.g. lack of ffs() decl) in such a >>> case? >> >> ffs() is declared in strings.h in both hpux11 and glibc linux. So, I don't >> think this is a libiberty issue. > > I didn't say it's a libiberty issue; I said libiberty might help addressing > the issue. Or else other configure machinery to determine whether strings.h > exists and actually contains what we're after. Recall that other, "less-GNU" > environments (think about the *BSD-s, for example, or see how there's > makefile.vms) also need to be covered (i.e. keep building). > > That said, I notice bfd/elf32-xtensa.c includes strings.h unconditionally as > well. I'd similarly question this being legitimate. Okay. I agree that if <strings.h> needs to be included it should be guarded. >> I would have thought this issue would affect glibc targets. Have you tried >> building binutils with gcc-16 or looking for a warning regarding the implicit >> declaration of ffs()? > > What I see is configure output like this > > checking whether declaration is required for ffs... yes > > and later > > checking whether ffs is declared... yes > > No compiler warnings. Instead bfd/sysdep.h already has > > #if !HAVE_DECL_FFS > extern int ffs (int); > #endif > > So is it perhaps the case that configure doesn't work correctly on hpux? If <strings.h> is not included in sysdep.h, we hit the following error: ../../src/bfd/elflink.c: In function 'elf_link_add_object_symbols': ../../src/bfd/elflink.c:5521:30: error: implicit declaration of function 'ffs' [ -Wimplicit-function-declaration] 5521 | symbol_align = ffs (h->root.u.def.value) - 1; | ^~~ We have the following in bfd/config.h: /* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */ #define HAVE_DECL_FFS 1 So, the declaration in bfd/sysdep.h doesn't work. It would seem autoconf 2.69 searches strings.h for ffs. ac_includes_default has #ifdef HAVE_STRINGS_H # include <strings.h> #endif Dave
On 02.12.2025 16:21, John David Anglin wrote: > On 2025-12-02 2:44 a.m., Jan Beulich wrote: >> On 01.12.2025 18:12, John David Anglin wrote: >>> On 2025-12-01 11:11 a.m., Jan Beulich wrote: >>>> Okay, but none of this make strings.h really standard. Wouldn't it again be >>>> libiberty to cover for the differences (e.g. lack of ffs() decl) in such a >>>> case? >>> >>> ffs() is declared in strings.h in both hpux11 and glibc linux. So, I don't >>> think this is a libiberty issue. >> >> I didn't say it's a libiberty issue; I said libiberty might help addressing >> the issue. Or else other configure machinery to determine whether strings.h >> exists and actually contains what we're after. Recall that other, "less-GNU" >> environments (think about the *BSD-s, for example, or see how there's >> makefile.vms) also need to be covered (i.e. keep building). >> >> That said, I notice bfd/elf32-xtensa.c includes strings.h unconditionally as >> well. I'd similarly question this being legitimate. > > Okay. I agree that if <strings.h> needs to be included it should be guarded. > >>> I would have thought this issue would affect glibc targets. Have you tried >>> building binutils with gcc-16 or looking for a warning regarding the implicit >>> declaration of ffs()? >> >> What I see is configure output like this >> >> checking whether declaration is required for ffs... yes >> >> and later >> >> checking whether ffs is declared... yes >> >> No compiler warnings. Instead bfd/sysdep.h already has >> >> #if !HAVE_DECL_FFS >> extern int ffs (int); >> #endif >> >> So is it perhaps the case that configure doesn't work correctly on hpux? > > If <strings.h> is not included in sysdep.h, we hit the following error: > > ../../src/bfd/elflink.c: In function 'elf_link_add_object_symbols': > ../../src/bfd/elflink.c:5521:30: error: implicit declaration of function 'ffs' [ > -Wimplicit-function-declaration] > 5521 | symbol_align = ffs (h->root.u.def.value) - 1; > | ^~~ > > We have the following in bfd/config.h: > > /* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */ > #define HAVE_DECL_FFS 1 > > So, the declaration in bfd/sysdep.h doesn't work. > > It would seem autoconf 2.69 searches strings.h for ffs. ac_includes_default > has > > #ifdef HAVE_STRINGS_H > # include <strings.h> > #endif And I guess your change to bfd/sysdep.h then wants to similarly have an #ifdef around it. At the same time the questionable #include could / should then be dropped from bfd/elf32-xtensa.c. Jan
On 2025-12-03 4:15 a.m., Jan Beulich wrote: > On 02.12.2025 16:21, John David Anglin wrote: >> On 2025-12-02 2:44 a.m., Jan Beulich wrote: >>> On 01.12.2025 18:12, John David Anglin wrote: >>>> On 2025-12-01 11:11 a.m., Jan Beulich wrote: >>>>> Okay, but none of this make strings.h really standard. Wouldn't it again be >>>>> libiberty to cover for the differences (e.g. lack of ffs() decl) in such a >>>>> case? >>>> >>>> ffs() is declared in strings.h in both hpux11 and glibc linux. So, I don't >>>> think this is a libiberty issue. >>> >>> I didn't say it's a libiberty issue; I said libiberty might help addressing >>> the issue. Or else other configure machinery to determine whether strings.h >>> exists and actually contains what we're after. Recall that other, "less-GNU" >>> environments (think about the *BSD-s, for example, or see how there's >>> makefile.vms) also need to be covered (i.e. keep building). >>> >>> That said, I notice bfd/elf32-xtensa.c includes strings.h unconditionally as >>> well. I'd similarly question this being legitimate. >> >> Okay. I agree that if <strings.h> needs to be included it should be guarded. >> >>>> I would have thought this issue would affect glibc targets. Have you tried >>>> building binutils with gcc-16 or looking for a warning regarding the implicit >>>> declaration of ffs()? >>> >>> What I see is configure output like this >>> >>> checking whether declaration is required for ffs... yes >>> >>> and later >>> >>> checking whether ffs is declared... yes >>> >>> No compiler warnings. Instead bfd/sysdep.h already has >>> >>> #if !HAVE_DECL_FFS >>> extern int ffs (int); >>> #endif >>> >>> So is it perhaps the case that configure doesn't work correctly on hpux? >> >> If <strings.h> is not included in sysdep.h, we hit the following error: >> >> ../../src/bfd/elflink.c: In function 'elf_link_add_object_symbols': >> ../../src/bfd/elflink.c:5521:30: error: implicit declaration of function 'ffs' [ >> -Wimplicit-function-declaration] >> 5521 | symbol_align = ffs (h->root.u.def.value) - 1; >> | ^~~ >> >> We have the following in bfd/config.h: >> >> /* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */ >> #define HAVE_DECL_FFS 1 >> >> So, the declaration in bfd/sysdep.h doesn't work. >> >> It would seem autoconf 2.69 searches strings.h for ffs. ac_includes_default >> has >> >> #ifdef HAVE_STRINGS_H >> # include <strings.h> >> #endif > > And I guess your change to bfd/sysdep.h then wants to similarly have an #ifdef > around it. At the same time the questionable #include could / should then be > dropped from bfd/elf32-xtensa.c. I'm testing a revised patch. Dave
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