From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id C5XzM4bqrGfy/ywAWB0awg (envelope-from ) for ; Wed, 12 Feb 2025 13:37:58 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OGJDqlE6; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C1AC31E105; Wed, 12 Feb 2025 13:37:58 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id CD2161E08E for ; Wed, 12 Feb 2025 13:37:55 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2DE7D3858424 for ; Wed, 12 Feb 2025 18:37:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2DE7D3858424 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OGJDqlE6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id E4D163858C53 for ; Wed, 12 Feb 2025 18:36:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E4D163858C53 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E4D163858C53 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1739385408; cv=none; b=PkN0Xx32ggddkDK/A47F2pXDSl+0odJWLx1fpuSsdCpmcWWuytRSOz9YWT3B8lnoub9diKThr8k0XYiw5EayBUljwS54FSNbVqpDoU+8a/nb1QDMHkwSxc8gh6eVLbOIQ4Edv8zmiJxvspYN3NIEKRQKMhFiiVmWDunEehGSQXo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1739385408; c=relaxed/simple; bh=gsRg1AwfbGMaXzbgZGGaoJKzAKhTQvL5jf/tLQ4pHvA=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=A0LTxEA9hpXkanmyIS2zHBPlYFCfPuqih78dnHwdrQ2ky/9dXx/x+aZ4wWXtlaRAuhVwvBm0VTaERyhU7K6tSxvhXUewPdaNeM/gCS+bEYna16byGn0Px/XulVS9itBjLHH9HEMRZ0aaj0rXwaSY4cFY5mn8xXsf1MsIT0W7pU8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E4D163858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739385407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=CVpfVS9rSB2BjYvhELf74vL7WdvKCOBxwU79/WFvbwo=; b=OGJDqlE6T63xsw9Yv252ZSHOQ8c+96cZhPS4/wR8B/5kWszoIRz8KthRiMaPD0OimRBTA6 /YGbPx8z0wfmELzbw7iMTvVin8WJ7eQ10UFP7msqLt67/teQKxv0tufxzbSv62gr3OvRM7 WVWPCx1+K+e3bAsFzB6waqS7hM37Gzc= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-241-t4yr7Cl9MmWD78DVoiS_Pg-1; Wed, 12 Feb 2025 13:36:46 -0500 X-MC-Unique: t4yr7Cl9MmWD78DVoiS_Pg-1 X-Mimecast-MFC-AGG-ID: t4yr7Cl9MmWD78DVoiS_Pg_1739385405 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-ab397fff5a3so2365066b.1 for ; Wed, 12 Feb 2025 10:36:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739385404; x=1739990204; h=mime-version:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CVpfVS9rSB2BjYvhELf74vL7WdvKCOBxwU79/WFvbwo=; b=ux5MW/pOO9qfIJFIh420ENxJYNVaZWZRum/m3p25vK8tAOV/NAJQzgt5ZRUmoqYT0o YaGcLgSlgasQ3YyZDHrb3ff1VgICRDWyXOEzPjxBJh0oHQFO0up77/3U18yT5aJbJqif sAPW1cDuCZIaA5UG8quFK0fwWHTSTbnhRulpe+v4UVSI4CZyWSIJewHU6On/Ig8hPyEy +msGXBrbZE2t+V640synbYh2BTbiUK9KIU9h781tgluptJvCJIGSgF7y86aOGX2VSe0X K8fAdl0AJtkzS9RzHSqGYxv7fDh3Gq8A6VwzCcX/wk2cKuxa/Bv4WF7cHkYubpE+aQOM ZDPg== X-Forwarded-Encrypted: i=1; AJvYcCUgOJ0tmVXd5aUyCKZ4w/S0HIhA5mdshEdzYKuzAO+8XLxtfXtRNGbzPVQj8WKjcjnFce+dTDwTRbYYjg==@sourceware.org X-Gm-Message-State: AOJu0YyHtqh8sSaOK78ivY2guGFdrocXHKI8hEdX6KJ2BBCzn+UsIaJt aljcuZzcjmNRlobm0hnZ0gm/wpaf9bIXNmFN9EfniU1HfgWfK3eTO7cp81MeALP2AMNqOo0IYjb RqjeK/fNGl9C8sJ3aW5c1ZVmSH0MT/loqT9f+j6G3tdLmqejrCs5zexqETk4= X-Gm-Gg: ASbGncsGtN0zjWnviUhx5LypPdcKqzZKpsJX7aR4gaiQMYH/2eMH0O+EeUhP19zuWZG kK0J+ZYqm5Fde092U8ZiZHdF3chYqDWrEQpKLRHM4I+MjFowBGzEsVS/5Nz+XIYAGu9/yFcyl0T lt4qpvujwZNiQu/wIW1z8Vb97mRhsBDaPeYMcU7S2AQ8cMhIzUZ0CrmGeA09kbRXkibzP2QXggi qnhF1YvbH96zOVqyvAbgL32AcBFDXZTJDyHGc0IIm09b3Fk5EsvQQ93O7ntkcRHXnh0KZqcvzzF 2LJ/lc85WNr0Ew== X-Received: by 2002:a17:907:7e8e:b0:ab7:5983:13b5 with SMTP id a640c23a62f3a-aba5108fa17mr579466b.20.1739385403501; Wed, 12 Feb 2025 10:36:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IFh9UyoZnng6+nbHwG8iDsRrUd5Pmx40gYY6sMZt9MfeY0reXD3XsLb50G+CsMQyJNLqLvbMw== X-Received: by 2002:a17:907:7e8e:b0:ab7:5983:13b5 with SMTP id a640c23a62f3a-aba5108fa17mr575666b.20.1739385402731; Wed, 12 Feb 2025 10:36:42 -0800 (PST) Received: from tpp.orcam.me.uk (tpp.orcam.me.uk. [81.187.245.177]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab7f83bfa09sm147698266b.76.2025.02.12.10.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 10:36:42 -0800 (PST) Date: Wed, 12 Feb 2025 18:36:39 +0000 (GMT) From: "Maciej W. Rozycki" To: binutils@sourceware.org, gdb-patches@sourceware.org cc: Guinevere Larsen , Andrew Burgess Subject: [PATCH] Fix 64-bit BFD detection causing build failures Message-ID: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: fVkr9kwFhsEHVnqwyzG8_FtTvjrBEIe4p6d28LzSDvw_1739385405 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org We have a discrepancy with 64-bit BFD handling across our component subdirectories leading to link failures such as: ld: ../opcodes/.libs/libopcodes.a(disassemble.o): in function `disassembler': disassemble.c:(.text+0x65): undefined reference to `print_insn_alpha' ld: disassemble.c:(.text+0x105): undefined reference to `print_insn_ia64' ld: disassemble.c:(.text+0x11d): undefined reference to `print_insn_loongarch' ld: disassemble.c:(.text+0x1a1): undefined reference to `print_insn_big_mips' [...] with some configurations having a 32-bit host and 64-bit BFD, such as: `--host=i386-linux-gnu --target=riscv64-linux-gnu --enable-targets=all'. This is ultimately due to how 64-bit BFD is enabled for bfd/ itself and other subdirectorses and has been a regression from commit 1d5269c994bf ("unify 64-bit bfd checks"). For bfd/ the BFD_64_BIT autoconf macro from config/bfd64.m4 is used combined with this logic in bfd/configure.ac: case ${host64}-${target64}-${want64} in *true*) wordsize=64 bfd64_libs='$(BFD64_LIBS)' all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' [...] ;; false-false-false) wordsize=32 all_backends='$(BFD32_BACKENDS)' ;; esac where the value of ${wordsize} switches between 32-bit and 64-bit BFD via these pieces: #define BFD_ARCH_SIZE @wordsize@ and: #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif in bfd/bfd-in.h, which ultimately becomes a part of "bfd.h". Then ${host64} is determined in bfd/configure.ac from the host's word size, via the host's pointer size: if test "x${ac_cv_sizeof_void_p}" = "x8"; then host64=true fi And ${target64} is determined in bfd/configure.ac from the target's word size: if test ${target_size} = 64; then target64=true fi Where multiple targets have been requested with `--enable-targets=all' the presence of any 64-bit target will set "true" here. Finally ${want64} is set according to `--enable-64-bit-bfd' user option with an arrangement involving BFD_64_BIT: BFD_64_BIT if test $enable_64_bit_bfd = yes ; then want64=true else want64=false fi which also, redundantly, checks and sets its result upon the host's word size. Lastly ${want64} is also selectively set by target fragments in bfd/config.bfd, which mostly if not completely overlaps with ${target64} setting as described above. Conversely other subdirectories only rely on BFD_64_BIT, so they fail to notice that BFD is 64-bit and do not enable their 64-bit handling where the host requested is 32-bit and 64-bit BFD has been enabled other than with `--enable-64-bit-bfd'. One consequence is opcodes/disassemble.c enables calls to its numerous own 64-bit backends by checking the BFD64 macro from "bfd.h", however does not actually enable said backends in its Makefile. Hence the link errors quoted above. Address the problem then by moving the `--enable-64-bit-bfd' option back to bfd/configure.ac and remove the call to BFD_64_BIT from there and then rewrite the macro in terms of checking for the presence of BFD64 macro in "bfd.h", which is the canonical way of determining whether BFD is 64-bit or not. Rather than running `grep' directly on ../bfd/bfd-in3.h as the opcodes/ fragment used to before the problematic commit: if grep '#define BFD_ARCH_SIZE 64' ../bfd/bfd-in3.h > /dev/null; then run the preprocessor on "bfd.h", which allows to invoke the macro from configure.ac files placed in subdirectories located at deeper levels, by relying on the preprocessor's search path. This requires however that the invokers rely on `all-bfd' rather than `configure-bfd' for their `configure' invocation stage, because "bfd.h" is made by `make all' rather than `configure' in bfd/. The "ac_cv_" prefix is the namespace reserved by autoconf for own use, so choose "bfd_cv_" for the cache variable. It is safe to use one here, because the setting of BFD64 will only ever change if the configured host or target does and that triggers a consistency check such as: configure: loading cache ./config.cache configure: error: `target_alias' has changed since the previous run: configure: former value: `riscv64-linux-gnu' configure: current value: `i386-linux-gnu' configure: error: in `.../libiberty': configure: error: changes in the environment can compromise the build configure: error: run `make distclean' and/or `rm ./config.cache' and start over and the cache will have to be removed to proceed. Last but not least remove the hack from gdb/configure.ac to fail builds for `mips*-*-*' hosts where `--enable-targets=all' has been requested, but `--enable-64-bit-bfd' has not as it's no longer needed. Such builds complete successfully now, having enabled 64-bit BFD implicitly. --- Hi, Verified for binutils and GDB by building with a `powerpc64le-linux-gnu' build and `i386-linux-gnu' and `mips-linux-gnu' native hosts, and then the same build and hosts and the `riscv64-linux-gnu' target (and verifying in opcodes/config.log that 64-bit BFD has or hasn't been detected, according to the expectation) with and without `--enable-targets=all'. For binutils also verified via regression testing across my usual set of targets (currently counting 238), with `--enable-targets=all'. OK to apply? Maciej --- Makefile.def | 4 Makefile.in | 40 +++---- bfd/configure | 60 ---------- bfd/configure.ac | 8 + config/bfd64.m4 | 40 ++++--- gdb/configure | 115 ++++++-------------- gdb/configure.ac | 15 -- gdb/configure.tgt | 8 - ld/configure | 289 ++++++--------------------------------------------- ld/configure.ac | 6 - opcodes/configure | 285 ++++++-------------------------------------------- opcodes/configure.ac | 2 12 files changed, 174 insertions(+), 698 deletions(-) binutils-gdb-bfd64.diff Index: binutils-gdb/Makefile.def =================================================================== --- binutils-gdb.orig/Makefile.def +++ binutils-gdb/Makefile.def @@ -523,7 +523,7 @@ dependencies = { module=install-bfd; on= dependencies = { module=install-strip-bfd; on=install-strip-libsframe; }; // libopcodes depends on libbfd -dependencies = { module=configure-opcodes; on=configure-bfd; hard=true; }; +dependencies = { module=configure-opcodes; on=all-bfd; hard=true; }; dependencies = { module=install-opcodes; on=install-bfd; }; dependencies = { module=install-strip-opcodes; on=install-strip-bfd; }; @@ -549,8 +549,8 @@ dependencies = { module=install-gprofng; dependencies = { module=install-gprofng; on=install-bfd; }; dependencies = { module=configure-ld; on=configure-gettext; }; +dependencies = { module=configure-ld; on=all-bfd; }; dependencies = { module=all-ld; on=all-libiberty; }; -dependencies = { module=all-ld; on=all-bfd; }; dependencies = { module=all-ld; on=all-opcodes; }; dependencies = { module=all-ld; on=all-build-bison; }; dependencies = { module=all-ld; on=all-build-flex; }; Index: binutils-gdb/Makefile.in =================================================================== --- binutils-gdb.orig/Makefile.in +++ binutils-gdb/Makefile.in @@ -67369,16 +67369,16 @@ install-strip-ld: maybe-install-strip-bf install-strip-ld: maybe-install-strip-libctf install-bfd: maybe-install-libsframe install-strip-bfd: maybe-install-strip-libsframe -configure-opcodes: configure-bfd -configure-stage1-opcodes: configure-stage1-bfd -configure-stage2-opcodes: configure-stage2-bfd -configure-stage3-opcodes: configure-stage3-bfd -configure-stage4-opcodes: configure-stage4-bfd -configure-stageprofile-opcodes: configure-stageprofile-bfd -configure-stagetrain-opcodes: configure-stagetrain-bfd -configure-stagefeedback-opcodes: configure-stagefeedback-bfd -configure-stageautoprofile-opcodes: configure-stageautoprofile-bfd -configure-stageautofeedback-opcodes: configure-stageautofeedback-bfd +configure-opcodes: all-bfd +configure-stage1-opcodes: all-stage1-bfd +configure-stage2-opcodes: all-stage2-bfd +configure-stage3-opcodes: all-stage3-bfd +configure-stage4-opcodes: all-stage4-bfd +configure-stageprofile-opcodes: all-stageprofile-bfd +configure-stagetrain-opcodes: all-stagetrain-bfd +configure-stagefeedback-opcodes: all-stagefeedback-bfd +configure-stageautoprofile-opcodes: all-stageautoprofile-bfd +configure-stageautofeedback-opcodes: all-stageautofeedback-bfd install-opcodes: maybe-install-bfd install-strip-opcodes: maybe-install-strip-bfd configure-gas: maybe-configure-gettext @@ -67443,6 +67443,16 @@ configure-stagetrain-ld: maybe-configure configure-stagefeedback-ld: maybe-configure-stagefeedback-gettext configure-stageautoprofile-ld: maybe-configure-stageautoprofile-gettext configure-stageautofeedback-ld: maybe-configure-stageautofeedback-gettext +configure-ld: maybe-all-bfd +configure-stage1-ld: maybe-all-stage1-bfd +configure-stage2-ld: maybe-all-stage2-bfd +configure-stage3-ld: maybe-all-stage3-bfd +configure-stage4-ld: maybe-all-stage4-bfd +configure-stageprofile-ld: maybe-all-stageprofile-bfd +configure-stagetrain-ld: maybe-all-stagetrain-bfd +configure-stagefeedback-ld: maybe-all-stagefeedback-bfd +configure-stageautoprofile-ld: maybe-all-stageautoprofile-bfd +configure-stageautofeedback-ld: maybe-all-stageautofeedback-bfd all-ld: maybe-all-libiberty all-stage1-ld: maybe-all-stage1-libiberty all-stage2-ld: maybe-all-stage2-libiberty @@ -67453,16 +67463,6 @@ all-stagetrain-ld: maybe-all-stagetrain- all-stagefeedback-ld: maybe-all-stagefeedback-libiberty all-stageautoprofile-ld: maybe-all-stageautoprofile-libiberty all-stageautofeedback-ld: maybe-all-stageautofeedback-libiberty -all-ld: maybe-all-bfd -all-stage1-ld: maybe-all-stage1-bfd -all-stage2-ld: maybe-all-stage2-bfd -all-stage3-ld: maybe-all-stage3-bfd -all-stage4-ld: maybe-all-stage4-bfd -all-stageprofile-ld: maybe-all-stageprofile-bfd -all-stagetrain-ld: maybe-all-stagetrain-bfd -all-stagefeedback-ld: maybe-all-stagefeedback-bfd -all-stageautoprofile-ld: maybe-all-stageautoprofile-bfd -all-stageautofeedback-ld: maybe-all-stageautofeedback-bfd all-ld: maybe-all-opcodes all-stage1-ld: maybe-all-stage1-opcodes all-stage2-ld: maybe-all-stage2-opcodes Index: binutils-gdb/bfd/configure =================================================================== --- binutils-gdb.orig/bfd/configure +++ binutils-gdb/bfd/configure @@ -702,8 +702,6 @@ REPORT_BUGS_TEXI REPORT_BUGS_TO PKGVERSION DEBUGDIR -ENABLE_BFD_64_BIT_FALSE -ENABLE_BFD_64_BIT_TRUE PLUGINS_FALSE PLUGINS_TRUE LARGEFILE_CPPFLAGS @@ -11155,7 +11153,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11158 "configure" +#line 11156 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11261,7 +11259,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11264 "configure" +#line 11262 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11930,56 +11928,6 @@ else enable_64_bit_bfd=no fi - -if test "x$enable_64_bit_bfd" = "xno"; then : - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } -if ${ac_cv_sizeof_void_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (void *) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_void_p=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p -_ACEOF - - - if test "x$ac_cv_sizeof_void_p" = "x8"; then : - enable_64_bit_bfd=yes -fi - -fi - - if test "x$enable_64_bit_bfd" = "xyes"; then - ENABLE_BFD_64_BIT_TRUE= - ENABLE_BFD_64_BIT_FALSE='#' -else - ENABLE_BFD_64_BIT_TRUE='#' - ENABLE_BFD_64_BIT_FALSE= -fi - - if test $enable_64_bit_bfd = yes ; then want64=true else @@ -17677,10 +17625,6 @@ if test -z "${PLUGINS_TRUE}" && test -z as_fn_error $? "conditional \"PLUGINS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_BFD_64_BIT_TRUE}" && test -z "${ENABLE_BFD_64_BIT_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_BFD_64_BIT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 Index: binutils-gdb/bfd/configure.ac =================================================================== --- binutils-gdb.orig/bfd/configure.ac +++ binutils-gdb/bfd/configure.ac @@ -81,7 +81,13 @@ if test x$ac_checking != x ; then AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want run-time sanity checks.]) fi -BFD_64_BIT +AC_ARG_ENABLE(64-bit-bfd, + AS_HELP_STRING([--enable-64-bit-bfd], + [64-bit support (on hosts with narrower word sizes)]), + [AS_CASE([$enableval], + [yes|no], [], + [*], [AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option)])], + [enable_64_bit_bfd=no]) if test $enable_64_bit_bfd = yes ; then want64=true else Index: binutils-gdb/config/bfd64.m4 =================================================================== --- binutils-gdb.orig/config/bfd64.m4 +++ binutils-gdb/config/bfd64.m4 @@ -16,21 +16,27 @@ dnl along with this program; see the fil dnl . dnl -dnl See whether 64-bit bfd lib has been enabled. +dnl Make sure your module depends on `all-bfd' when invoking this macro. AC_DEFUN([BFD_64_BIT], [dnl -AC_ARG_ENABLE(64-bit-bfd, - AS_HELP_STRING([--enable-64-bit-bfd], - [64-bit support (on hosts with narrower word sizes)]), - [AS_CASE([$enableval], - [yes|no], [], - [*], [AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option)])], - [enable_64_bit_bfd=no]) - -dnl If the host is 64-bit, then 64-bit bfd is enabled automatically. -AS_IF([test "x$enable_64_bit_bfd" = "xno"], [dnl - AC_CHECK_SIZEOF(void *) - AS_IF([test "x$ac_cv_sizeof_void_p" = "x8"], [enable_64_bit_bfd=yes]) -]) - -AM_CONDITIONAL([ENABLE_BFD_64_BIT], [test "x$enable_64_bit_bfd" = "xyes"]) -]) +# See whether 64-bit bfd lib has been enabled. +OLD_CPPFLAGS=$CPPFLAGS +# Put the old CPPFLAGS last, in case the user's CPPFLAGS point somewhere +# with bfd, with -I/foo/include. We always want our bfd. +CPPFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CPPFLAGS" +AC_CACHE_CHECK([whether BFD is 64-bit], [bfd_cv_64_bit], + [AC_EGREP_CPP( + [HAVE_BFD64], + AC_LANG_PROGRAM( + [#include "bfd.h"], + [dnl +#ifdef BFD64 +HAVE_BFD64 +#endif]), + [bfd_cv_64_bit=yes], + [bfd_cv_64_bit=no])]) +if test $bfd_cv_64_bit = yes; then + have_64_bit_bfd=yes +else + have_64_bit_bfd=no +fi +CPPFLAGS=$OLD_CPPFLAGS]) Index: binutils-gdb/gdb/configure =================================================================== --- binutils-gdb.orig/gdb/configure +++ binutils-gdb/gdb/configure @@ -761,8 +761,6 @@ TARGET_OBS AMD_DBGAPI_LIBS AMD_DBGAPI_CFLAGS HAVE_GSTACK -ENABLE_BFD_64_BIT_FALSE -ENABLE_BFD_64_BIT_TRUE subdirs GDB_DATADIR DEBUGDIR @@ -934,7 +932,6 @@ with_relocated_sources with_auto_load_dir with_auto_load_safe_path enable_targets -enable_64_bit_bfd with_amd_dbgapi enable_tui enable_gdbtk @@ -1645,7 +1642,6 @@ if test -n "$ac_init_help"; then --disable-nls do not use Native Language Support --enable-targets=TARGETS alternative target configurations - --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) --enable-tui enable full-screen terminal user interface (TUI) --enable-gdbtk enable gdbtk graphical user interface (GUI) --enable-profiling enable profiling of GDB @@ -11500,7 +11496,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11503 "configure" +#line 11499 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11606,7 +11602,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11609 "configure" +#line 11605 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -24876,70 +24872,46 @@ fi -# Check whether --enable-64-bit-bfd was given. -if test "${enable_64_bit_bfd+set}" = set; then : - enableval=$enable_64_bit_bfd; case $enableval in #( - yes|no) : - ;; #( - *) : - as_fn_error $? "bad value ${enableval} for 64-bit-bfd option" "$LINENO" 5 ;; #( - *) : - ;; -esac -else - enable_64_bit_bfd=no -fi - - -if test "x$enable_64_bit_bfd" = "xno"; then : - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } -if ${ac_cv_sizeof_void_p+:} false; then : +# See whether 64-bit bfd lib has been enabled. +OLD_CPPFLAGS=$CPPFLAGS +# Put the old CPPFLAGS last, in case the user's CPPFLAGS point somewhere +# with bfd, with -I/foo/include. We always want our bfd. +CPPFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CPPFLAGS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether BFD is 64-bit" >&5 +$as_echo_n "checking whether BFD is 64-bit... " >&6; } +if ${bfd_cv_64_bit+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (void *) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_void_p=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "bfd.h" +int +main () +{ +#ifdef BFD64 +HAVE_BFD64 +#endif + ; + return 0; +} _ACEOF - - - if test "x$ac_cv_sizeof_void_p" = "x8"; then : - enable_64_bit_bfd=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "HAVE_BFD64" >/dev/null 2>&1; then : + bfd_cv_64_bit=yes +else + bfd_cv_64_bit=no fi +rm -f conftest* fi - - if test "x$enable_64_bit_bfd" = "xyes"; then - ENABLE_BFD_64_BIT_TRUE= - ENABLE_BFD_64_BIT_FALSE='#' +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_64_bit" >&5 +$as_echo "$bfd_cv_64_bit" >&6; } +if test $bfd_cv_64_bit = yes; then + have_64_bit_bfd=yes else - ENABLE_BFD_64_BIT_TRUE='#' - ENABLE_BFD_64_BIT_FALSE= + have_64_bit_bfd=no fi - - +CPPFLAGS=$OLD_CPPFLAGS # Provide defaults for some variables set by the per-host and per-target # configuration. @@ -24989,7 +24961,7 @@ fi done # Check whether this target needs 64-bit CORE_ADDR - if test x${enable_64_bit_bfd} = xno; then + if test x${have_64_bit_bfd} = xno; then . ${srcdir}/../bfd/config.bfd fi @@ -25002,19 +24974,10 @@ fi done if test x${all_targets} = xtrue; then - if test x${enable_64_bit_bfd} = xyes; then + if test x${have_64_bit_bfd} = xyes; then TARGET_OBS='$(ALL_TARGET_OBS) $(ALL_64_TARGET_OBS)' else - case ${host} in - mips*) - # If all targets were requested, but 64 bit bfd is not enabled, - # the build will fail. See PR 28684. - as_fn_error $? "--enable-targets=all requires --enable-64-bit-bfd" "$LINENO" 5 - ;; - *) - TARGET_OBS='$(ALL_TARGET_OBS)' - ;; - esac + TARGET_OBS='$(ALL_TARGET_OBS)' fi fi @@ -33895,10 +33858,6 @@ if test -z "${MAINTAINER_MODE_TRUE}" && as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_BFD_64_BIT_TRUE}" && test -z "${ENABLE_BFD_64_BIT_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_BFD_64_BIT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${HAVE_PYTHON_TRUE}" && test -z "${HAVE_PYTHON_FALSE}"; then as_fn_error $? "conditional \"HAVE_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 Index: binutils-gdb/gdb/configure.ac =================================================================== --- binutils-gdb.orig/gdb/configure.ac +++ binutils-gdb/gdb/configure.ac @@ -241,7 +241,7 @@ do done # Check whether this target needs 64-bit CORE_ADDR - if test x${enable_64_bit_bfd} = xno; then + if test x${have_64_bit_bfd} = xno; then . ${srcdir}/../bfd/config.bfd fi @@ -254,19 +254,10 @@ do done if test x${all_targets} = xtrue; then - if test x${enable_64_bit_bfd} = xyes; then + if test x${have_64_bit_bfd} = xyes; then TARGET_OBS='$(ALL_TARGET_OBS) $(ALL_64_TARGET_OBS)' else - case ${host} in - mips*) - # If all targets were requested, but 64 bit bfd is not enabled, - # the build will fail. See PR 28684. - AC_MSG_ERROR([--enable-targets=all requires --enable-64-bit-bfd]) - ;; - *) - TARGET_OBS='$(ALL_TARGET_OBS)' - ;; - esac + TARGET_OBS='$(ALL_TARGET_OBS)' fi fi Index: binutils-gdb/gdb/configure.tgt =================================================================== --- binutils-gdb.orig/gdb/configure.tgt +++ binutils-gdb/gdb/configure.tgt @@ -85,7 +85,7 @@ hppa*-*-*) i[34567]86-*-*) cpu_obs="${i386_tobjs}" - if test "x$enable_64_bit_bfd" = "xyes"; then + if test "x$have_64_bit_bfd" = "xyes"; then cpu_obs="${amd64_tobjs} ${cpu_obs}" fi ;; @@ -284,7 +284,7 @@ hppa*-*-openbsd*) i[34567]86-*-darwin*) # Target: Darwin/i386 gdb_target_obs="i386-darwin-tdep.o solib-darwin.o" - if test "x$enable_64_bit_bfd" = "xyes"; then + if test "x$have_64_bit_bfd" = "xyes"; then # Target: GNU/Linux x86-64 gdb_target_obs="amd64-darwin-tdep.o ${gdb_target_obs}" fi @@ -319,7 +319,7 @@ i[34567]86-*-linux*) linux-tdep.o linux-record.o \ arch/i386-linux-tdesc.o \ arch/x86-linux-tdesc-features.o" - if test "x$enable_64_bit_bfd" = "xyes"; then + if test "x$have_64_bit_bfd" = "xyes"; then # Target: GNU/Linux x86-64 gdb_target_obs="amd64-linux-tdep.o \ arch/amd64-linux-tdesc.o ${gdb_target_obs}" @@ -578,7 +578,7 @@ sparc-*-linux*) sparc-linux-tdep.o solib-svr4.o symfile-mem.o \ linux-tdep.o \ ravenscar-thread.o sparc-ravenscar-thread.o" - if test "x$enable_64_bit_bfd" = "xyes"; then + if test "x$have_64_bit_bfd" = "xyes"; then # Target: GNU/Linux UltraSPARC gdb_target_obs="sparc64-tdep.o \ sparc64-linux-tdep.o ${gdb_target_obs}" Index: binutils-gdb/ld/configure =================================================================== --- binutils-gdb.orig/ld/configure +++ binutils-gdb/ld/configure @@ -696,8 +696,6 @@ install_as_default TARGET_SYSTEM_ROOT_DEFINE TARGET_SYSTEM_ROOT use_sysroot -ENABLE_BFD_64_BIT_FALSE -ENABLE_BFD_64_BIT_TRUE LARGEFILE_CPPFLAGS CXXCPP OTOOL64 @@ -842,7 +840,6 @@ enable_largefile enable_checking with_lib_path enable_targets -enable_64_bit_bfd with_sysroot enable_gold enable_got @@ -1536,7 +1533,6 @@ if test -n "$ac_init_help"; then --disable-largefile omit support for large files --enable-checking enable run-time checks --enable-targets alternative target configurations - --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) --enable-gold[=ARG] build gold [ARG={default,yes,no}] --enable-got= GOT handling scheme (target, single, negative, multigot) @@ -2177,189 +2173,6 @@ fi } # ac_fn_cxx_try_link -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 conftest.$ac_ext <<_LT_EOF -#line 11691 "configure" +#line 11504 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11794,7 +11607,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11797 "configure" +#line 11610 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15462,70 +15275,46 @@ fi esac fi -# Check whether --enable-64-bit-bfd was given. -if test "${enable_64_bit_bfd+set}" = set; then : - enableval=$enable_64_bit_bfd; case $enableval in #( - yes|no) : - ;; #( - *) : - as_fn_error $? "bad value ${enableval} for 64-bit-bfd option" "$LINENO" 5 ;; #( - *) : - ;; -esac -else - enable_64_bit_bfd=no -fi - - -if test "x$enable_64_bit_bfd" = "xno"; then : - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } -if ${ac_cv_sizeof_void_p+:} false; then : +# See whether 64-bit bfd lib has been enabled. +OLD_CPPFLAGS=$CPPFLAGS +# Put the old CPPFLAGS last, in case the user's CPPFLAGS point somewhere +# with bfd, with -I/foo/include. We always want our bfd. +CPPFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CPPFLAGS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether BFD is 64-bit" >&5 +$as_echo_n "checking whether BFD is 64-bit... " >&6; } +if ${bfd_cv_64_bit+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (void *) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_void_p=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "bfd.h" +int +main () +{ +#ifdef BFD64 +HAVE_BFD64 +#endif + ; + return 0; +} _ACEOF - - - if test "x$ac_cv_sizeof_void_p" = "x8"; then : - enable_64_bit_bfd=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "HAVE_BFD64" >/dev/null 2>&1; then : + bfd_cv_64_bit=yes +else + bfd_cv_64_bit=no fi +rm -f conftest* fi - - if test "x$enable_64_bit_bfd" = "xyes"; then - ENABLE_BFD_64_BIT_TRUE= - ENABLE_BFD_64_BIT_FALSE='#' +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_64_bit" >&5 +$as_echo "$bfd_cv_64_bit" >&6; } +if test $bfd_cv_64_bit = yes; then + have_64_bit_bfd=yes else - ENABLE_BFD_64_BIT_TRUE='#' - ENABLE_BFD_64_BIT_FALSE= + have_64_bit_bfd=no fi - - +CPPFLAGS=$OLD_CPPFLAGS # Check whether --with-sysroot was given. @@ -19306,11 +19095,11 @@ do EMUL=$targ_emul fi - if test x${enable_64_bit_bfd} = xno; then + if test x${have_64_bit_bfd} = xno; then . ${srcdir}/../bfd/config.bfd fi - if test x${enable_64_bit_bfd} = xyes; then + if test x${have_64_bit_bfd} = xyes; then targ_extra_emuls="$targ_extra_emuls $targ64_extra_emuls" targ_extra_libpath="$targ_extra_libpath $targ64_extra_libpath" fi @@ -19534,7 +19323,7 @@ _ACEOF if test x${all_targets} = xtrue; then - if test x${enable_64_bit_bfd} = xyes; then + if test x${have_64_bit_bfd} = xyes; then EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)' EMUL_EXTRA_OFILES='$(ALL_EMUL_EXTRA_OFILES) $(ALL_64_EMUL_EXTRA_OFILES)' else @@ -19737,10 +19526,6 @@ if test -z "${am__fastdepCXX_TRUE}" && t as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_BFD_64_BIT_TRUE}" && test -z "${ENABLE_BFD_64_BIT_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_BFD_64_BIT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${ENABLE_LIBCTF_TRUE}" && test -z "${ENABLE_LIBCTF_FALSE}"; then as_fn_error $? "conditional \"ENABLE_LIBCTF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 Index: binutils-gdb/ld/configure.ac =================================================================== --- binutils-gdb.orig/ld/configure.ac +++ binutils-gdb/ld/configure.ac @@ -495,11 +495,11 @@ do EMUL=$targ_emul fi - if test x${enable_64_bit_bfd} = xno; then + if test x${have_64_bit_bfd} = xno; then . ${srcdir}/../bfd/config.bfd fi - if test x${enable_64_bit_bfd} = xyes; then + if test x${have_64_bit_bfd} = xyes; then targ_extra_emuls="$targ_extra_emuls $targ64_extra_emuls" targ_extra_libpath="$targ_extra_libpath $targ64_extra_libpath" fi @@ -686,7 +686,7 @@ AC_SUBST(TDIRS) AM_SUBST_NOTMAKE(TDIRS) if test x${all_targets} = xtrue; then - if test x${enable_64_bit_bfd} = xyes; then + if test x${have_64_bit_bfd} = xyes; then EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)' EMUL_EXTRA_OFILES='$(ALL_EMUL_EXTRA_OFILES) $(ALL_64_EMUL_EXTRA_OFILES)' else Index: binutils-gdb/opcodes/configure =================================================================== --- binutils-gdb.orig/opcodes/configure +++ binutils-gdb/opcodes/configure @@ -646,8 +646,6 @@ cgendir CGEN_MAINT_FALSE CGEN_MAINT_TRUE HDEFINES -ENABLE_BFD_64_BIT_FALSE -ENABLE_BFD_64_BIT_TRUE EXEEXT_FOR_BUILD CC_FOR_BUILD CATOBJEXT @@ -819,7 +817,6 @@ with_libiconv_prefix with_libiconv_type with_libintl_prefix with_libintl_type -enable_64_bit_bfd enable_cgen_maint ' ac_precious_vars='build_alias @@ -1471,7 +1468,6 @@ if test -n "$ac_init_help"; then --enable-install-libbfd controls installation of libbfd and related headers --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths - --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) --enable-cgen-maint=dir build cgen generated files Optional Packages: @@ -1926,189 +1922,6 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_func -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 conftest.$ac_ext <<_LT_EOF -#line 11093 "configure" +#line 10906 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11196,7 +11009,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11199 "configure" +#line 11012 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14025,70 +13838,46 @@ $as_echo "$bfd_cv_build_exeext" >&6; } test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} fi -# Check whether --enable-64-bit-bfd was given. -if test "${enable_64_bit_bfd+set}" = set; then : - enableval=$enable_64_bit_bfd; case $enableval in #( - yes|no) : - ;; #( - *) : - as_fn_error $? "bad value ${enableval} for 64-bit-bfd option" "$LINENO" 5 ;; #( - *) : - ;; -esac -else - enable_64_bit_bfd=no -fi - - -if test "x$enable_64_bit_bfd" = "xno"; then : - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } -if ${ac_cv_sizeof_void_p+:} false; then : +# See whether 64-bit bfd lib has been enabled. +OLD_CPPFLAGS=$CPPFLAGS +# Put the old CPPFLAGS last, in case the user's CPPFLAGS point somewhere +# with bfd, with -I/foo/include. We always want our bfd. +CPPFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CPPFLAGS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether BFD is 64-bit" >&5 +$as_echo_n "checking whether BFD is 64-bit... " >&6; } +if ${bfd_cv_64_bit+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (void *) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_void_p=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "bfd.h" +int +main () +{ +#ifdef BFD64 +HAVE_BFD64 +#endif + ; + return 0; +} _ACEOF - - - if test "x$ac_cv_sizeof_void_p" = "x8"; then : - enable_64_bit_bfd=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "HAVE_BFD64" >/dev/null 2>&1; then : + bfd_cv_64_bit=yes +else + bfd_cv_64_bit=no fi +rm -f conftest* fi - - if test "x$enable_64_bit_bfd" = "xyes"; then - ENABLE_BFD_64_BIT_TRUE= - ENABLE_BFD_64_BIT_FALSE='#' +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_64_bit" >&5 +$as_echo "$bfd_cv_64_bit" >&6; } +if test $bfd_cv_64_bit = yes; then + have_64_bit_bfd=yes else - ENABLE_BFD_64_BIT_TRUE='#' - ENABLE_BFD_64_BIT_FALSE= + have_64_bit_bfd=no fi - - +CPPFLAGS=$OLD_CPPFLAGS @@ -14567,7 +14356,7 @@ if test x${all_targets} = xfalse ; then else # all_targets is true archdefs=-DARCH_all - if test "$enable_64_bit_bfd" = "yes" ; then + if test "$have_64_bit_bfd" = "yes" ; then BFD_MACHINES='$(ALL32_MACHINES) $(ALL64_MACHINES)' else BFD_MACHINES='$(ALL32_MACHINES)' @@ -14720,10 +14509,6 @@ if test -z "${INSTALL_LIBBFD_TRUE}" && t as_fn_error $? "conditional \"INSTALL_LIBBFD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_BFD_64_BIT_TRUE}" && test -z "${ENABLE_BFD_64_BIT_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_BFD_64_BIT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${CGEN_MAINT_TRUE}" && test -z "${CGEN_MAINT_FALSE}"; then as_fn_error $? "conditional \"CGEN_MAINT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 Index: binutils-gdb/opcodes/configure.ac =================================================================== --- binutils-gdb.orig/opcodes/configure.ac +++ binutils-gdb/opcodes/configure.ac @@ -383,7 +383,7 @@ if test x${all_targets} = xfalse ; then else # all_targets is true archdefs=-DARCH_all - if test "$enable_64_bit_bfd" = "yes" ; then + if test "$have_64_bit_bfd" = "yes" ; then BFD_MACHINES='$(ALL32_MACHINES) $(ALL64_MACHINES)' else BFD_MACHINES='$(ALL32_MACHINES)'