0002-Fix-usage-of-GLIBC_PREREQ-for-non-glibc-toolchains.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 31dc2951c758698bff060aeae8ffd8854616183b Mon Sep 17 00:00:00 2001
  2. From: Bernd Kuhls <bernd.kuhls@t-online.de>
  3. Date: Fri, 12 Feb 2016 19:25:02 +0100
  4. Subject: [PATCH] Fix usage of __GLIBC_PREREQ for non-glibc toolchains
  5. The way __GLIBC_PREREQ() is currently used means that it's evaluated
  6. even if __GLIBC__ is not defined. But obviously, __GLIBC_PREREQ will
  7. not exist if __GLIBC__ is not defined, causing build failures on C
  8. libraries not defining __GLIBC__ such as the musl C library.
  9. Patch originally taken from:
  10. https://github.com/voidlinux/void-packages/blob/master/srcpkgs/numactl/patches/musl.patch
  11. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  12. [Bernd: Reworked to fix uClibc]
  13. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  14. [Thomas: improve patch description.]
  15. [Upstream commit: https://github.com/numactl/numactl/commit/31dc2951c758698bff060aeae8ffd8854616183b]
  16. ---
  17. syscall.c | 6 +++++-
  18. 1 file changed, 5 insertions(+), 1 deletion(-)
  19. diff --git a/syscall.c b/syscall.c
  20. index 37782d9..255853d 100644
  21. --- a/syscall.c
  22. +++ b/syscall.c
  23. @@ -115,7 +115,11 @@
  24. #endif
  25. -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 11)
  26. +#ifndef __GLIBC_PREREQ
  27. +# define __GLIBC_PREREQ(x,y) 0
  28. +#endif
  29. +
  30. +#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 11)
  31. /* glibc 2.11 seems to have working 6 argument sycall. Use the
  32. glibc supplied syscall in this case.