diff options
author | Tamar Christina <tamar.christina@arm.com> | 2020-07-17 13:10:53 +0100 |
---|---|---|
committer | Tamar Christina <tamar.christina@arm.com> | 2020-07-17 13:10:53 +0100 |
commit | 55f6addc0c102eab2bf19d94de3ce52f9de0ab91 (patch) | |
tree | 3c476e65331501ac6ddcad00c2db64a55aca3a6c /gcc | |
parent | b399f3c6425f6c33b64e813899cbd589288ef716 (diff) | |
download | gcc-55f6addc0c102eab2bf19d94de3ce52f9de0ab91.zip gcc-55f6addc0c102eab2bf19d94de3ce52f9de0ab91.tar.gz gcc-55f6addc0c102eab2bf19d94de3ce52f9de0ab91.tar.bz2 |
AArch64: Add GCC_CPUINFO override
This adds an in intentionally undocumented environment variable
GCC_CPUINFO which can be used to test -mcpu=native.
Tests using this are added later on.
gcc/ChangeLog:
* config/aarch64/driver-aarch64.c (host_detect_local_cpu):
Add GCC_CPUINFO.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/aarch64/driver-aarch64.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/config/aarch64/driver-aarch64.c b/gcc/config/aarch64/driver-aarch64.c index 2365716..0c70629 100644 --- a/gcc/config/aarch64/driver-aarch64.c +++ b/gcc/config/aarch64/driver-aarch64.c @@ -256,6 +256,7 @@ host_detect_local_cpu (int argc, const char **argv) uint64_t default_flags = 0; std::string buf; size_t sep_pos = -1; + char *fcpu_info; gcc_assert (argc); @@ -273,7 +274,11 @@ host_detect_local_cpu (int argc, const char **argv) if (!arch && !tune && !cpu) 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; |