public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r8-10416] Arm: Add GCC_CPUINFO override
@ 2020-08-21 15:37 Tamar Christina
  0 siblings, 0 replies; only message in thread
From: Tamar Christina @ 2020-08-21 15:37 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f7f6626f0398b9977a67a9e219302274c4121e3a

commit r8-10416-gf7f6626f0398b9977a67a9e219302274c4121e3a
Author: Tamar Christina <tamar.christina@arm.com>
Date:   Fri Jul 17 13:12:00 2020 +0100

    Arm: Add GCC_CPUINFO override
    
    This adds an in intentionally undocumented environment variable
    GCC_CPUINFO which can be used to test -mcpu=native.
    
    Tests using these are added later on.
    
    gcc/ChangeLog:
    
            * config/arm/driver-arm.c (host_detect_local_cpu): Add GCC_CPUINFO.
    
    (cherry picked from commit 34a6c43487caf3a2a0ec9c7c79c526d116abc8b9)

Diff:
---
 gcc/config/arm/driver-arm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gcc/config/arm/driver-arm.c b/gcc/config/arm/driver-arm.c
index dc2f1de01a8..a53c2272864 100644
--- a/gcc/config/arm/driver-arm.c
+++ b/gcc/config/arm/driver-arm.c
@@ -97,6 +97,7 @@ host_detect_local_cpu (int argc, const char **argv)
   FILE *f = NULL;
   bool arch;
   const struct vendor_cpu *cpu_table = NULL;
+  char *fcpu_info = NULL;
 
   if (argc < 1)
     goto not_found;
@@ -105,7 +106,12 @@ host_detect_local_cpu (int argc, const char **argv)
   if (!arch && strcmp (argv[0], "cpu") != 0 && strcmp (argv[0], "tune"))
     goto not_found;
 
-  f = fopen ("/proc/cpuinfo", "r");
+  fcpu_info = getenv ("GCC_CPUINFO");
+  if (fcpu_info)
+    f = fopen (fcpu_info, "r");
+  else
+    f = fopen ("/proc/cpuinfo", "r");
+
   if (f == NULL)
     goto not_found;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-21 15:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 15:37 [gcc r8-10416] Arm: Add GCC_CPUINFO override Tamar Christina

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).