0025-Move-sched.h-include-ahead-of-user-headers.patch 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From 7422adfb471f4b4f2ec870124064632d55f72e50 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Mon, 11 Apr 2022 15:46:18 -0700
  4. Subject: [PATCH] Move sched.h include ahead of user headers
  5. Fix attempt to use poisoned calloc error, this moves the sched.h before
  6. using system.h from gcc headers which includes #pragma GCC poison calloc
  7. Fixes
  8. In file included from /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux-musl/gcc/12.0.1-r0/recipe-sysroot/usr/include/pthread.h:30,
  9. from /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux-musl/gcc/12.0.1-r0/recipe-sysroot/usr/include/c++/12.0.1/aarch64-yoe-linux-musl/bits/gthr-default.h:35,
  10. from /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux-musl/gcc/12.0.1-r0/recipe-sysroot/usr/include/c++/12.0.1/aarch64-yoe-linux-musl/bits/gthr.h:148,
  11. from /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux-musl/gcc/12.0.1-r0/recipe-sysroot/usr/include/c++/12.0.1/ext/atomicity.h:35,
  12. from /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux-musl/gcc/12.0.1-r0/recipe-sysroot/usr/include/c++/12.0.1/bits/shared_ptr_base.h:61,
  13. from /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux-musl/gcc/12.0.1-r0/recipe-sysroot/usr/include/c++/12.0.1/bits/shared_ptr.h:53,
  14. from /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux-musl/gcc/12.0.1-r0/recipe-sysroot/usr/include/c++/12.0.1/memory:77,
  15. from ../../../../../../../work-shared/gcc-12.0.1-r0/gcc-12-20220410/libcc1/deleter.hh:23,
  16. from ../../../../../../../work-shared/gcc-12.0.1-r0/gcc-12-20220410/libcc1/rpc.hh:25,
  17. from ../../../../../../../work-shared/gcc-12.0.1-r0/gcc-12-20220410/libcc1/libcc1plugin.cc:67:
  18. /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux-musl/gcc/12.0.1-r0/recipe-sysroot/usr/include/sched.h:84:7: error: attempt to use poisoned "calloc"
  19. 84 | void *calloc(size_t, size_t);
  20. | ^
  21. /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux-musl/gcc/12.0.1-r0/recipe-sysroot/usr/include/sched.h:124:36: error: attempt to use poisoned "calloc"
  22. 124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
  23. Upstream-Status: Pending
  24. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  25. ---
  26. libcc1/libcc1plugin.cc | 1 +
  27. libcc1/libcp1plugin.cc | 1 +
  28. 2 files changed, 2 insertions(+)
  29. diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
  30. index 12ab5a57c8d..fff9bfab18b 100644
  31. --- a/libcc1/libcc1plugin.cc
  32. +++ b/libcc1/libcc1plugin.cc
  33. @@ -17,6 +17,7 @@
  34. along with GCC; see the file COPYING3. If not see
  35. <http://www.gnu.org/licenses/>. */
  36. +#include <sched.h>
  37. #include <cc1plugin-config.h>
  38. #undef PACKAGE_NAME
  39. diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
  40. index 83dab7f58b1..0b83ce7a09d 100644
  41. --- a/libcc1/libcp1plugin.cc
  42. +++ b/libcc1/libcp1plugin.cc
  43. @@ -18,6 +18,7 @@
  44. along with GCC; see the file COPYING3. If not see
  45. <http://www.gnu.org/licenses/>. */
  46. +#include <sched.h>
  47. #include <cc1plugin-config.h>
  48. #undef PACKAGE_NAME