From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id F2E973858D32 for ; Thu, 10 Aug 2023 21:30:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F2E973858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="6.01,163,1684828800"; d="scan'208";a="15839735" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 10 Aug 2023 13:30:35 -0800 IronPort-SDR: N2pXk6wK4vjD7t4uNcLvoYgi0x+lhLNtOypqxrzxdtk2A4gAJPmpzYpQRzFRJZMJonexgRpNyN 582y+GyOEfi2YaNDa6ejb6QiF7W1ey1gmCzHnb30XD//J+5CPbObpIqJ/mAOQiuarwTYOfsmKh 3ft570TJb/oQrVyL3gHDaxj6+9PGWqAv6xuaa2r7P2G1BcmuUgtlC6JtJ4ciBTUqwOefCM7L4C Mg0R85VrkGy8Qej3xW8+44c0H/M+09dw3QOQMosmKgZx5IRpi3XVptH0cTs9JJB2F7cWFej5CP +t0= Date: Thu, 10 Aug 2023 21:30:32 +0000 From: Joseph Myers To: Subject: [PATCH] config: Fix host -rdynamic detection for build != host != target Message-ID: <5f53789-e0f5-7c5a-a0b1-b098a076d572@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3110.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The GCC_ENABLE_PLUGINS configure logic for detecting whether -rdynamic is necessary and supported uses an appropriate objdump for $host binaries (running on $build) in cases where $host is $build or $target. However, it is missing such logic in the case where $host is neither $build nor $target, resulting in the compilers not being linked with -rdynamic and plugins not being usable with such a compiler. In fact $ac_cv_prog_OBJDUMP, as used when $build = $host, is always an objdump for $host binaries that runs on $build; that is, it's appropriate to use in this case as well. Tested in such a configuration that it does result in cc1 being linked with -rdynamic as expected. Also bootstrapped with no regressions for x86_64-pc-linux-gnu. config/ * gcc-plugin.m4 (GCC_ENABLE_PLUGINS): Use export_sym_check="$ac_cv_prog_OBJDUMP -T" also when host is not build or target. gcc/ * configure: Regenerate. libcc1/ * configure: Regenerate. diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4 index c731a6fab38..c30cfdd8fad 100644 --- a/config/gcc-plugin.m4 +++ b/config/gcc-plugin.m4 @@ -49,7 +49,7 @@ AC_DEFUN([GCC_ENABLE_PLUGINS], elif test x$host = x$target; then export_sym_check="$gcc_cv_objdump -T" else - export_sym_check= + export_sym_check="$ac_cv_prog_OBJDUMP -T" fi ;; esac diff --git a/gcc/configure b/gcc/configure index ea1ad6606a6..db5812d4a63 100755 --- a/gcc/configure +++ b/gcc/configure @@ -31975,7 +31975,7 @@ fi elif test x$host = x$target; then export_sym_check="$gcc_cv_objdump -T" else - export_sym_check= + export_sym_check="$ac_cv_prog_OBJDUMP -T" fi ;; esac diff --git a/libcc1/configure b/libcc1/configure index 1a63a0e4e1a..2a914a0bfc8 100755 --- a/libcc1/configure +++ b/libcc1/configure @@ -15120,7 +15120,7 @@ fi elif test x$host = x$target; then export_sym_check="$gcc_cv_objdump -T" else - export_sym_check= + export_sym_check="$ac_cv_prog_OBJDUMP -T" fi ;; esac -- Joseph S. Myers joseph@codesourcery.com