summaryrefslogtreecommitdiffstats
path: root/package/openssh/0001-configure-ac-detect-mips-abi.patch
blob: 0d43e6baf0f7d70da0ff379dda19b723aa40c81f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From f4fcd8c788a4854d4ebae400cf55e3957f906835 Mon Sep 17 00:00:00 2001
From: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Date: Tue, 20 Jun 2017 16:42:11 +0100
Subject: [PATCH] configure.ac: detect MIPS ABI

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
[Upstream commit: ttps://github.com/openssh/openssh-portable/commit/f4fcd8c788a4854d4ebae400cf55e3957f906835]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 configure.ac | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/configure.ac b/configure.ac
index 18079acba..f990cfe08 100644
--- a/configure.ac
+++ b/configure.ac
@@ -746,6 +746,27 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
 	fi
 	AC_CHECK_HEADERS([linux/seccomp.h linux/filter.h linux/audit.h], [],
 	    [], [#include <linux/types.h>])
+	# Obtain MIPS ABI
+	case "$host" in
+	mips*)
+		AC_COMPILE_IFELSE([
+#if _MIPS_SIM != _ABIO32
+#error
+#endif
+			],[mips_abi="o32"],[AC_COMPILE_IFELSE([
+#if _MIPS_SIM != _ABIN32
+#error
+#endif
+				],[mips_abi="n32"],[AC_COMPILE_IFELSE([
+#if _MIPS_SIM != _ABI64
+#error
+#endif
+					],[mips_abi="n64"],[AC_MSG_ERROR([unknown MIPS ABI])
+				])
+			])
+		])
+		;;
+	esac
 	AC_MSG_CHECKING([for seccomp architecture])
 	seccomp_audit_arch=
 	case "$host" in
OpenPOWER on IntegriCloud