pmaports/cross/gcc-armv7/0042-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch
2022-02-21 17:53:32 +01:00

80 lines
2.3 KiB
Diff

From 72f32e3383129ad139df76d9a063fac9b03079b1 Mon Sep 17 00:00:00 2001
From: Alex McGrath <amk@amk.ie>
Date: Wed, 13 Oct 2021 23:24:27 +0100
Subject: [PATCH] Fix attempt to use poisoned calloc error in libgccjit
This moves usages of pthread.h to above any usage of system.h as it
included #pragma GCC poison calloc
---
gcc/jit/jit-playback.c | 4 ++--
gcc/jit/jit-recording.c | 4 ++--
gcc/jit/libgccjit.c | 3 ++-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
index cee9daa8220..a5600084933 100644
--- a/gcc/jit/jit-playback.c
+++ b/gcc/jit/jit-playback.c
@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#include <pthread.h>
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "stmt.h"
-#include <pthread.h>
-
#include "jit-playback.h"
#include "jit-result.h"
#include "jit-builtins.h"
diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
index 117ff70114c..d2634a546b1 100644
--- a/gcc/jit/jit-recording.c
+++ b/gcc/jit/jit-recording.c
@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#include <pthread.h>
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3. If not see
#include "pretty-print.h"
#include "toplev.h"
-#include <pthread.h>
-
#include "jit-builtins.h"
#include "jit-recording.h"
#include "jit-playback.h"
diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
index 0cc650f9810..2f44481eeb0 100644
--- a/gcc/jit/libgccjit.c
+++ b/gcc/jit/libgccjit.c
@@ -18,13 +18,14 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#include <pthread.h>
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "timevar.h"
#include "typed-splay-tree.h"
#include "cppbuiltin.h"
-#include <pthread.h>
#include "libgccjit.h"
#include "jit-recording.h"
--
2.35.1