0005-mips-use-__linux__-and-not-linux.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. The "linux" symbol is not POSIX compliant [1], and therefore not
  6. defined when building with -std=c99. Due to this, the linux
  7. conditional block doesn't get used on Linux when building Python 3.x
  8. (which is built with -std=c99). To fix this, we use the POSIX
  9. compliant __linux__ symbol, which is defined when -std=c99 is used.
  10. This fixes the build of Python 3.x on MIPS/musl configuration, as it
  11. makes sures that <asm/sgidefs.h> gets included and not <sgidefs.h>.
  12. [1] https://sourceforge.net/p/predef/wiki/OperatingSystems/
  13. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  14. ---
  15. src/mips/ffitarget.h | 2 +-
  16. 1 file changed, 1 insertion(+), 1 deletion(-)
  17. diff --git a/src/mips/ffitarget.h b/src/mips/ffitarget.h
  18. index 717d659..6faa358 100644
  19. --- a/src/mips/ffitarget.h
  20. +++ b/src/mips/ffitarget.h
  21. @@ -32,7 +32,7 @@
  22. #error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
  23. #endif
  24. -#ifdef linux
  25. +#ifdef __linux__
  26. # include <asm/sgidefs.h>
  27. #elif defined(__rtems__)
  28. /*
  29. --
  30. 2.13.6