https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105632
Bug ID: 105632 Summary: Canadian Cross build failure - error: attempt to use poisoned "malloc" Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: lancethepants at gmail dot com Target Milestone: --- I'm having an issue where creating a "Canadian Cross" toolchain is giving me error: attempt to use poisoned "malloc" build x86_64 host armv7 target mipsel libc uclibc-ng I don't know if this is all "Canadian Cross" builds or perhaps just uclibc related. The patch I use to fix this for myself is here. https://github.com/lancethepants/gcc/commit/84eef8a8760740c6483c7236b28e2a2e22609104 I add "#define INCLUDE_MEMORY" so system.h will define it although it was necessary to put it before #include "gcc-plugin.h" as well. Here is the full error I get. In file included from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/sysroot/usr/include/sched.h:34, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/sysroot/usr/include/pthread.h:24, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/include/c++/12.1.0/arm-tomatoware-linux-uclibcgnueabi/bits/gthr-default.h:35, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/include/c++/12.1.0/arm-tomatoware-linux-uclibcgnueabi/bits/gthr.h:148, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/include/c++/12.1.0/ext/atomicity.h:35, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/include/c++/12.1.0/bits/shared_ptr_base.h:61, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/include/c++/12.1.0/bits/shared_ptr.h:53, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/include/c++/12.1.0/memory:77, from ../../gcc/libcc1/deleter.hh:23, from ../../gcc/libcc1/rpc.hh:25, from ../../gcc/libcc1/libcc1plugin.cc:67: /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/sysroot/usr/include/bits/sched.h:210:46: error: attempt to use poisoned "malloc" 210 | # define __sched_cpualloc(cnt) ((cpu_set_t *)malloc(__CPU_ALLOC_SIZE(cnt))) | ^ In file included from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/sysroot/usr/include/sched.h:34, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/sysroot/usr/include/pthread.h:24, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/include/c++/12.1.0/arm-tomatoware-linux-uclibcgnueabi/bits/gthr-default.h:35, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/include/c++/12.1.0/arm-tomatoware-linux-uclibcgnueabi/bits/gthr.h:148, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/include/c++/12.1.0/ext/atomicity.h:35, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/include/c++/12.1.0/bits/shared_ptr_base.h:61, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/include/c++/12.1.0/bits/shared_ptr.h:53, from /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/include/c++/12.1.0/memory:77, from ../../gcc/libcc1/deleter.hh:23, from ../../gcc/libcc1/marshall-cp.hh:25, from ../../gcc/libcc1/libcp1plugin.cc:69: /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/sysroot/usr/include/bits/sched.h:210:46: error: attempt to use poisoned "malloc" 210 | # define __sched_cpualloc(cnt) ((cpu_set_t *)malloc(__CPU_ALLOC_SIZE(cnt)))