1 From 7f28cd1f88145a701e5dbbf50558bb65fce79f61 Mon Sep 17 00:00:00 2001
2 From: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
3 Date: Thu, 14 Jul 2016 17:20:51 +0100
4 Subject: [PATCH] Complete support for MIPS n32 ABI
6 Pull request: https://github.com/xianyi/OpenBLAS/pull/926
8 Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
10 Makefile.system | 27 +++++++++------------------
13 3 files changed, 22 insertions(+), 21 deletions(-)
15 diff --git a/Makefile.system b/Makefile.system
16 index 24a7a64..bbcdb82 100644
19 @@ -502,13 +502,16 @@ endif
23 -ifeq ($(ARCH), $(filter $(ARCH),mips64 mips))
24 +ifeq ($(ARCH), $(filter $(ARCH),mips64))
26 CCOMMON_OPT += -mabi=64
28 -CCOMMON_OPT += -mabi=32
29 +CCOMMON_OPT += -mabi=n32
32 +else ifeq ($(ARCH), $(filter $(ARCH),mips))
33 +CCOMMON_OPT += -mabi=32
37 ifeq ($(CORE), LOONGSON3A)
38 @@ -599,12 +602,14 @@ ifneq ($(NO_LAPACK), 1)
39 EXTRALIB += -lgfortran
42 -ifeq ($(ARCH), $(filter $(ARCH),mips64 mips))
43 +ifeq ($(ARCH), $(filter $(ARCH),mips64))
45 FCOMMON_OPT += -mabi=64
47 -FCOMMON_OPT += -mabi=32
48 +FCOMMON_OPT += -mabi=n32
50 +else ifeq ($(ARCH), $(filter $(ARCH),mips))
51 +FCOMMON_OPT += -mabi=32
55 @@ -688,20 +693,6 @@ endif
59 -ifeq ($(filter $(ARCH),mips64 mips))
67 -FCOMMON_OPT += -mabi=64
69 -FCOMMON_OPT += -mabi=32
73 ifeq ($(USE_OPENMP), 1)
76 diff --git a/c_check b/c_check
77 index 50ff360..9f457df 100644
80 @@ -79,8 +79,13 @@ if ($os eq "AIX") {
84 -if (($architecture eq "mips") || ($architecture eq "mips64")) {
85 - $compiler_name .= " -mabi=32" if ($binary eq "32");
86 +if ($architecture eq "mips") {
87 + $compiler_name .= " -mabi=32";
91 +if ($architecture eq "mips64") {
92 + $compiler_name .= " -mabi=n32" if ($binary eq "32");
93 $compiler_name .= " -mabi=64" if ($binary eq "64");
96 diff --git a/f_check b/f_check
97 index 4c03ac7..3520e8b 100644
100 @@ -223,7 +223,12 @@ if (!$?) {
104 - $link = `$compiler $openmp -mabi=32 -v ftest2.f 2>&1 && rm -f a.out a.exe`;
105 + $mips_data = `$compiler_bin -E -dM - < /dev/null`;
106 + if ($mips_data =~ /_MIPS_ISA_MIPS64/) {
107 + $link = `$compiler $openmp -mabi=n32 -v ftest2.f 2>&1 && rm -f a.out a.exe`;
109 + $link = `$compiler $openmp -mabi=32 -v ftest2.f 2>&1 && rm -f a.out a.exe`;
112 $binary = "" if ($?);