You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
side note- I also prefer to use clang even though I'm not in a freebsd environment. The build script overrides both CC and CXX even if I pass it in as an environment variable.
the patches below remove the freebsd check and just override the script to use clang and clang++, this is obviously not necessary but it conforms to my usecase
this is the patch set I use to get it to compile correctly under alpine:
https://git.alpinelinux.org/aports/plain/main/gcc/0042-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch
https://bugs.gentoo.org/828580
https://gcc.gnu.org/bugzillgnu-orig/gcc-12.10/show_bug.cgi?id=104799 (additional two hunks thrown in from here for 12)
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
--- gnu-orig/gcc-12.10/gcc/jit/jit-playback.cc+++ gnu/gcc-12.10/gcc/jit/jit-playback.cc@@ -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"
--- gnu-orig/gcc-12.10/gcc/jit/jit-recording.cc+++ gnu/gcc-12.10/gcc/jit/jit-recording.cc@@ -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"
--- gnu-orig/gcc-12.10/gcc/jit/libgccjit.cc+++ gnu/gcc-12.10/gcc/jit/libgccjit.cc@@ -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"
--- gnu-orig/gcc-12.10/libcc1/libcc1plugin.cc+++ gnu/gcc-12.10/libcc1/libcc1plugin.cc@@ -17,6 +17,7 @@
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#include <pthread.h>
#include <cc1plugin-config.h>
#undef PACKAGE_NAME
--- gnu-orig/gcc-12.10/libcc1/libcp1plugin.cc+++ gnu/gcc-12.10/libcc1/libcp1plugin.cc@@ -18,6 +18,7 @@
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#include <pthread.h>
#include <cc1plugin-config.h>
#undef PACKAGE_NAME
--- gnu-orig/gcc-12.10/gcc/cp/mapper-client.cc+++ gnu/gcc-12.10/gcc/cp/mapper-client.cc@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see
#define INCLUDE_STRING
#define INCLUDE_VECTOR
#define INCLUDE_MAP
+#include <pthread.h>
#include "system.h"
#include "line-map.h"
--- gnu-orig/gcc-12.10/gcc/cp/module.cc+++ gnu/gcc-12.10/gcc/cp/module.cc@@ -204,6 +204,7 @@ Classes used:
#include "config.h"
#define INCLUDE_STRING
#define INCLUDE_VECTOR
+#include <pthread.h>
#include "system.h"
#include "coretypes.h"
#include "cp-tree.h"
--- gnu-orig/gcc-12.10/gcc/cp/mapper-resolver.cc+++ gnu/gcc-12.10/gcc/cp/mapper-resolver.cc@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
#define INCLUDE_VECTOR
#define INCLUDE_ALGORITHM
#define INCLUDE_MAP
+#include <pthread.h>
#include "system.h"
// We don't want or need to be aware of networking
The text was updated successfully, but these errors were encountered:
basically its a gcc problem but the djgpp doesn't build under a muslc environment (and therefore alpine linux)
I had to include this patch for it to build correctly
https://gitweb.gentoo.org/proj/gcc-patches.git/tree/12.1.0/musl/50_all_calloc_libgccjit.patch?id=caa4485a49e1064181e7ac2df2c5476fbb6e9cf5
side note- I also prefer to use clang even though I'm not in a freebsd environment. The build script overrides both
CC
andCXX
even if I pass it in as an environment variable.the patches below remove the freebsd check and just override the script to use clang and clang++, this is obviously not necessary but it conforms to my usecase
this is the patch set I use to get it to compile correctly under alpine:
/tmp/patches/djgcc/0001-Add-calloc-patch-to-build-script.patch
/tmp/patches/djgcc/0002-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch
The text was updated successfully, but these errors were encountered: