public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Subject: [PATCH] config: Fix host -rdynamic detection for build != host != target
Date: Thu, 10 Aug 2023 21:30:32 +0000	[thread overview]
Message-ID: <5f53789-e0f5-7c5a-a0b1-b098a076d572@codesourcery.com> (raw)

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

             reply	other threads:[~2023-08-10 21:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10 21:30 Joseph Myers [this message]
2023-08-11  6:43 ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f53789-e0f5-7c5a-a0b1-b098a076d572@codesourcery.com \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).