]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/libffi/0005-mips-use-__linux__-and-not-linux.patch
libffi: add patch to fix MIPS support
[coffee/buildroot.git] / package / libffi / 0005-mips-use-__linux__-and-not-linux.patch
1 From 1f43e5edfd91bee80e518432b80db01f1bf226e3 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Sun, 22 Oct 2017 15:02:11 +0200
4 Subject: [PATCH] mips: use __linux__ and not linux
5
6 The "linux" symbol is not POSIX compliant [1], and therefore not
7 defined when building with -std=c99. Due to this, the linux
8 conditional block doesn't get used on Linux when building Python 3.x
9 (which is built with -std=c99). To fix this, we use the POSIX
10 compliant __linux__ symbol, which is defined when -std=c99 is used.
11
12 This fixes the build of Python 3.x on MIPS/musl configuration, as it
13 makes sures that <asm/sgidefs.h> gets included and not <sgidefs.h>.
14
15 [1] https://sourceforge.net/p/predef/wiki/OperatingSystems/
16
17 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
18 ---
19  src/mips/ffitarget.h | 2 +-
20  1 file changed, 1 insertion(+), 1 deletion(-)
21
22 diff --git a/src/mips/ffitarget.h b/src/mips/ffitarget.h
23 index 717d659..6faa358 100644
24 --- a/src/mips/ffitarget.h
25 +++ b/src/mips/ffitarget.h
26 @@ -32,7 +32,7 @@
27  #error "Please do not include ffitarget.h directly into your source.  Use ffi.h instead."
28  #endif
29  
30 -#ifdef linux
31 +#ifdef __linux__
32  # include <asm/sgidefs.h>
33  #elif defined(__rtems__)
34  /*
35 -- 
36 2.13.6
37