Skip to content

Instantly share code, notes, and snippets.

@takikawa
Last active April 6, 2023 18:16
Show Gist options
  • Save takikawa/e3bdb81eb987b26d7584d3f4e885d5ed to your computer and use it in GitHub Desktop.
Save takikawa/e3bdb81eb987b26d7584d3f4e885d5ed to your computer and use it in GitHub Desktop.
Patch BDW GC Bigloo patch with backported Emscripten-related changes from BDW HEAD
--- gc-8.2.2.patch.orig 2023-04-06 11:06:22.632147840 -0700
+++ gc-8.2.2.patch 2023-04-06 11:05:51.015432730 -0700
@@ -189,3 +189,19 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backgraph.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blacklst.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checksums.Plo@am__quote@ # am--include-marker
+diff -Naur gc-8.2.2.orig/include/private/gcconfig.h gc-8.2.2/include/private/gcconfig.h
+--- gc-8.2.2.orig/include/private/gcconfig.h 2022-08-26 11:44:49.000000000 -0700
++++ gc-8.2.2/include/private/gcconfig.h 2023-04-06 11:03:32.704304226 -0700
+@@ -1422,7 +1422,11 @@
+ # define OS_TYPE "EMSCRIPTEN"
+ # define DATASTART (ptr_t)ALIGNMENT
+ # define DATAEND (ptr_t)ALIGNMENT
+-# define USE_MMAP_ANON /* avoid /dev/zero, not supported */
++ /* Emscripten does emulate mmap and munmap, but those should */
++ /* not be used in the collector, since WebAssembly lacks the */
++ /* native support of memory mapping. Use sbrk() instead. */
++# undef USE_MMAP
++# undef USE_MUNMAP
+ # define STACK_GROWS_DOWN
+ # endif
+ # if defined(__QNX__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment