Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 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 | |
| 6 | Fix attempt to use poisoned calloc error, this moves the sched.h before |
| 7 | using system.h from gcc headers which includes #pragma GCC poison calloc |
| 8 | |
| 9 | Fixes |
| 10 | 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, |
| 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/aarch64-yoe-linux-musl/bits/gthr-default.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/aarch64-yoe-linux-musl/bits/gthr.h:148, |
| 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/ext/atomicity.h:35, |
| 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/bits/shared_ptr_base.h:61, |
| 15 | 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, |
| 16 | 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, |
| 17 | from ../../../../../../../work-shared/gcc-12.0.1-r0/gcc-12-20220410/libcc1/deleter.hh:23, |
| 18 | from ../../../../../../../work-shared/gcc-12.0.1-r0/gcc-12-20220410/libcc1/rpc.hh:25, |
| 19 | from ../../../../../../../work-shared/gcc-12.0.1-r0/gcc-12-20220410/libcc1/libcc1plugin.cc:67: |
| 20 | /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" |
| 21 | 84 | void *calloc(size_t, size_t); |
| 22 | | ^ |
| 23 | /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" |
| 24 | 124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n))) |
| 25 | |
| 26 | Upstream-Status: Pending |
| 27 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 28 | --- |
| 29 | libcc1/libcc1plugin.cc | 1 + |
| 30 | libcc1/libcp1plugin.cc | 1 + |
| 31 | 2 files changed, 2 insertions(+) |
| 32 | |
| 33 | diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc |
| 34 | index 12ab5a57c8d..fff9bfab18b 100644 |
| 35 | --- a/libcc1/libcc1plugin.cc |
| 36 | +++ b/libcc1/libcc1plugin.cc |
| 37 | @@ -17,6 +17,7 @@ |
| 38 | along with GCC; see the file COPYING3. If not see |
| 39 | <http://www.gnu.org/licenses/>. */ |
| 40 | |
| 41 | +#include <sched.h> |
| 42 | #include <cc1plugin-config.h> |
| 43 | |
| 44 | #undef PACKAGE_NAME |
| 45 | diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc |
| 46 | index 83dab7f58b1..0b83ce7a09d 100644 |
| 47 | --- a/libcc1/libcp1plugin.cc |
| 48 | +++ b/libcc1/libcp1plugin.cc |
| 49 | @@ -18,6 +18,7 @@ |
| 50 | along with GCC; see the file COPYING3. If not see |
| 51 | <http://www.gnu.org/licenses/>. */ |
| 52 | |
| 53 | +#include <sched.h> |
| 54 | #include <cc1plugin-config.h> |
| 55 | |
| 56 | #undef PACKAGE_NAME |