summaryrefslogtreecommitdiffstats
path: root/package/libffi/0005-mips-use-__linux__-and-not-linux.patch
blob: a48f3d3b6d3f429c0adc61afee30da99df4ea148 (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
From 1f43e5edfd91bee80e518432b80db01f1bf226e3 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Sun, 22 Oct 2017 15:02:11 +0200
Subject: [PATCH] mips: use __linux__ and not linux

The "linux" symbol is not POSIX compliant [1], and therefore not
defined when building with -std=c99. Due to this, the linux
conditional block doesn't get used on Linux when building Python 3.x
(which is built with -std=c99). To fix this, we use the POSIX
compliant __linux__ symbol, which is defined when -std=c99 is used.

This fixes the build of Python 3.x on MIPS/musl configuration, as it
makes sures that <asm/sgidefs.h> gets included and not <sgidefs.h>.

[1] https://sourceforge.net/p/predef/wiki/OperatingSystems/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 src/mips/ffitarget.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mips/ffitarget.h b/src/mips/ffitarget.h
index 717d659..6faa358 100644
--- a/src/mips/ffitarget.h
+++ b/src/mips/ffitarget.h
@@ -32,7 +32,7 @@
 #error "Please do not include ffitarget.h directly into your source.  Use ffi.h instead."
 #endif
 
-#ifdef linux
+#ifdef __linux__
 # include <asm/sgidefs.h>
 #elif defined(__rtems__)
 /*
-- 
2.13.6

OpenPOWER on IntegriCloud