syslog-ng: Bump version to 3.7.3
[buildroot-gz.git] / package / openblas / 0001-Complete-support-for-MIPS-n32-ABI.patch
blob6e6c5a68bc817f6bce053bdf86a57297a4f150cd
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>
9 ---
10 Makefile.system | 27 +++++++++------------------
11 c_check | 9 +++++++--
12 f_check | 7 ++++++-
13 3 files changed, 22 insertions(+), 21 deletions(-)
15 diff --git a/Makefile.system b/Makefile.system
16 index 24a7a64..bbcdb82 100644
17 --- a/Makefile.system
18 +++ b/Makefile.system
19 @@ -502,13 +502,16 @@ endif
21 ifdef NO_BINARY_MODE
23 -ifeq ($(ARCH), $(filter $(ARCH),mips64 mips))
24 +ifeq ($(ARCH), $(filter $(ARCH),mips64))
25 ifdef BINARY64
26 CCOMMON_OPT += -mabi=64
27 else
28 -CCOMMON_OPT += -mabi=32
29 +CCOMMON_OPT += -mabi=n32
30 endif
31 BINARY_DEFINED = 1
32 +else ifeq ($(ARCH), $(filter $(ARCH),mips))
33 +CCOMMON_OPT += -mabi=32
34 +BINARY_DEFINED = 1
35 endif
37 ifeq ($(CORE), LOONGSON3A)
38 @@ -599,12 +602,14 @@ ifneq ($(NO_LAPACK), 1)
39 EXTRALIB += -lgfortran
40 endif
41 ifdef NO_BINARY_MODE
42 -ifeq ($(ARCH), $(filter $(ARCH),mips64 mips))
43 +ifeq ($(ARCH), $(filter $(ARCH),mips64))
44 ifdef BINARY64
45 FCOMMON_OPT += -mabi=64
46 else
47 -FCOMMON_OPT += -mabi=32
48 +FCOMMON_OPT += -mabi=n32
49 endif
50 +else ifeq ($(ARCH), $(filter $(ARCH),mips))
51 +FCOMMON_OPT += -mabi=32
52 endif
53 else
54 ifdef BINARY64
55 @@ -688,20 +693,6 @@ endif
56 endif
57 endif
59 -ifeq ($(filter $(ARCH),mips64 mips))
60 -ifndef BINARY64
61 -FCOMMON_OPT += -m32
62 -else
63 -FCOMMON_OPT += -m64
64 -endif
65 -else
66 -ifdef BINARY64
67 -FCOMMON_OPT += -mabi=64
68 -else
69 -FCOMMON_OPT += -mabi=32
70 -endif
71 -endif
73 ifeq ($(USE_OPENMP), 1)
74 FCOMMON_OPT += -mp
75 endif
76 diff --git a/c_check b/c_check
77 index 50ff360..9f457df 100644
78 --- a/c_check
79 +++ b/c_check
80 @@ -79,8 +79,13 @@ if ($os eq "AIX") {
81 $defined = 1;
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";
88 + $defined = 1;
91 +if ($architecture eq "mips64") {
92 + $compiler_name .= " -mabi=n32" if ($binary eq "32");
93 $compiler_name .= " -mabi=64" if ($binary eq "64");
94 $defined = 1;
96 diff --git a/f_check b/f_check
97 index 4c03ac7..3520e8b 100644
98 --- a/f_check
99 +++ b/f_check
100 @@ -223,7 +223,12 @@ if (!$?) {
102 #For gfortran MIPS
103 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`;
108 + } else {
109 + $link = `$compiler $openmp -mabi=32 -v ftest2.f 2>&1 && rm -f a.out a.exe`;
112 $binary = "" if ($?);
115 2.7.3