aboutsummaryrefslogtreecommitdiff
path: root/gcc/config.gcc
diff options
context:
space:
mode:
authorYunQiang Su <yunqiang.su@cipunited.com>2022-08-02 10:57:18 +0000
committerYunQiang Su <yunqiang.su@cipunited.com>2022-10-09 06:39:04 +0000
commit66c48be23e0fa5ee7474b4b078e013f901c71eed (patch)
treed8e437b2fb99d5820c2f84a8bbc01e4a1848f1ea /gcc/config.gcc
parentd7346a3bf6554ddaef9853c1b0fb770c4a3cd9d2 (diff)
downloadgcc-66c48be23e0fa5ee7474b4b078e013f901c71eed.zip
gcc-66c48be23e0fa5ee7474b4b078e013f901c71eed.tar.gz
gcc-66c48be23e0fa5ee7474b4b078e013f901c71eed.tar.bz2
MIPS: improve -march=native arch detection
If we cannot get info from options and cpuinfo, we try to get from: 1. getauxval(AT_BASE_PLATFORM), introduced since Linux 5.7 2. _MIPS_ARCH from host compiler. mnan=2008 option is also used if __mips_nan2008__ is used. This can fix the wrong loader usage on r5/r6 platform with -march=native. gcc/ChangeLog: * config.gcc: set with_arch to default_mips_arch if no defined. * config/mips/driver-native.cc (host_detect_local_cpu): try getauxval(AT_BASE_PLATFORM) and _MIPS_ARCH, too. pass -mnan=2008 if __mips_nan2008__ is defined. * config.in: define HAVE_SYS_AUXV_H and HAVE_GETAUXVAL. * configure.ac: detect sys/auxv.h and getauxval. * configure: regenerated.
Diffstat (limited to 'gcc/config.gcc')
-rw-r--r--gcc/config.gcc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc
index e73cb84..eec544f 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -5608,6 +5608,8 @@ case ${target} in
esac
if test x$with_arch != x; then
default_mips_arch=$with_arch
+ else
+ with_arch=$default_mips_arch
fi
if test x$with_abi != x; then
default_mips_abi=$with_abi