Skip to content

Commit

Permalink
Merge pull request #66 from d3m3vilurr/fix-cpp-thread
Browse files Browse the repository at this point in the history
Fix crash with using C++ thread
  • Loading branch information
d3m3vilurr authored May 1, 2020
2 parents b22e866 + 53836b8 commit ba44b03
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,9 @@ ExternalProject_add(gcc-final
URL http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz
URL_HASH ${GCC_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PATCH_COMMAND patch -d <SOURCE_DIR> -p3 -t -N < ${PROJECT_SOURCE_DIR}/patches/gcc/0001-gcc-8.patch
PATCH_COMMAND
patch -d <SOURCE_DIR> -p3 -t -N < ${PROJECT_SOURCE_DIR}/patches/gcc/0001-gcc-8.patch
&& patch -d <SOURCE_DIR> -p1 -t -N < ${PROJECT_SOURCE_DIR}/patches/gcc/0002-gcc-9-pthread.patch
CONFIGURE_COMMAND ${compiler_flags} ${toolchain_tools} ${compiler_target_tools}
${wrapper_command} <SOURCE_DIR>/configure
--build=${build_native}
Expand Down
13 changes: 13 additions & 0 deletions patches/gcc/0002-gcc-9-pthread.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff -uHNr gcc-9.1.0.orig/libgcc/gthr-posix.h gcc-9.1.0/libgcc/gthr-posix.h
--- gcc-9.1.0.orig/libgcc/gthr-posix.h 2020-04-16 04:40:41.864017273 +0900
+++ gcc-9.1.0/libgcc/gthr-posix.h 2020-05-01 06:31:36.844109263 +0900
@@ -29,6 +29,9 @@
/* POSIX threads specific definitions.
Easy, since the interface is just one-to-one mapping. */

+#undef GTHREAD_USE_WEAK
+#define GTHREAD_USE_WEAK 0
+
#define __GTHREADS 1
#define __GTHREADS_CXX0X 1

0 comments on commit ba44b03

Please sign in to comment.