public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Vladimir Mezentsev <vmezents@sourceware.org>
To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org
Subject: [binutils-gdb] gprofng: adjust GPROFNG_VARIANT
Date: Thu,  7 Jul 2022 05:37:40 +0000 (GMT)	[thread overview]
Message-ID: <20220707053740.828773858D32@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1bb1f55d648e9c32bbead00afc95761646a6d050

commit 1bb1f55d648e9c32bbead00afc95761646a6d050
Author: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Date:   Wed Jul 6 13:52:57 2022 -0700

    gprofng: adjust GPROFNG_VARIANT
    
    GPROFNG_VARIANT depends on compiler options, not on $(host).
    
    gprofng/ChangeLog
    2022-07-06  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
    
            PR gprofng/29116
            * libcollector/configure.ac: Adjust GPROFNG_VARIANT.
            * libcollector/configure: Rebuild.

Diff:
---
 gprofng/libcollector/configure    | 23 +++++++++++++----------
 gprofng/libcollector/configure.ac | 23 +++++++++++++----------
 2 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/gprofng/libcollector/configure b/gprofng/libcollector/configure
index 52d9892fadd..cbb20405ffd 100755
--- a/gprofng/libcollector/configure
+++ b/gprofng/libcollector/configure
@@ -15476,17 +15476,20 @@ $as_echo "$as_me: WARNING: Cannot set --enable-shared for gprofng/libcollector.
 fi
 
 GPROFNG_VARIANT=unknown
-case "${host}" in
-  x86_64-*-linux*)
-    GPROFNG_VARIANT=amd64-Linux
-    ;;
-  i?86-*-linux*)
+x=`echo | $CC $CFLAGS -dM -E - | grep -w __x86_64`
+if test -n "$x"; then
+  GPROFNG_VARIANT=amd64-Linux
+else
+  x=`echo | $CC $CFLAGS -dM -E - | grep -w __i386__`
+  if test -n "$x"; then
     GPROFNG_VARIANT=intel-Linux
-    ;;
-  aarch64-*-linux*)
-    GPROFNG_VARIANT=aarch64-Linux
-    ;;
-esac
+  else
+    x=`echo | $CC $CFLAGS -dM -E - | grep -w __aarch64__`
+    if test -n "$x"; then
+      GPROFNG_VARIANT=aarch64-Linux
+    fi
+  fi
+fi
 
 
 ac_ext=c
diff --git a/gprofng/libcollector/configure.ac b/gprofng/libcollector/configure.ac
index 2e67e740c9e..d3c6bd5588d 100644
--- a/gprofng/libcollector/configure.ac
+++ b/gprofng/libcollector/configure.ac
@@ -42,17 +42,20 @@ if test "$enable_shared" != "yes"; then
 fi
 
 GPROFNG_VARIANT=unknown
-case "${host}" in
-  x86_64-*-linux*)
-    GPROFNG_VARIANT=amd64-Linux
-    ;;
-  i?86-*-linux*)
+x=`echo | $CC $CFLAGS -dM -E - | grep -w __x86_64`
+if test -n "$x"; then
+  GPROFNG_VARIANT=amd64-Linux
+else
+  x=`echo | $CC $CFLAGS -dM -E - | grep -w __i386__`
+  if test -n "$x"; then
     GPROFNG_VARIANT=intel-Linux
-    ;;
-  aarch64-*-linux*)
-    GPROFNG_VARIANT=aarch64-Linux
-    ;;
-esac
+  else
+    x=`echo | $CC $CFLAGS -dM -E - | grep -w __aarch64__`
+    if test -n "$x"; then
+      GPROFNG_VARIANT=aarch64-Linux
+    fi
+  fi
+fi
 AC_SUBST(GPROFNG_VARIANT)
 
 ACX_PROG_CC_WARNING_OPTS([-Wno-nonnull-compare], [GPROFNG_NO_NONNULL_COMPARE_CFLAGS])


                 reply	other threads:[~2022-07-07  5:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220707053740.828773858D32@sourceware.org \
    --to=vmezents@sourceware.org \
    --cc=bfd-cvs@sourceware.org \
    --cc=gdb-cvs@sourceware.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).