From e1c6b5908e3deabc56b6e730776789c33d95a83f Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sat, 9 May 2020 13:00:19 +0530 Subject: [PATCH] WiP! boehmgc --- overlay/boehmgc/genode.patch | 17 +++++++++++++++++ overlay/default.nix | 5 +++++ overlay/libc/default.nix | 6 ++++-- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 overlay/boehmgc/genode.patch diff --git a/overlay/boehmgc/genode.patch b/overlay/boehmgc/genode.patch new file mode 100644 index 0000000..6e79c23 --- /dev/null +++ b/overlay/boehmgc/genode.patch @@ -0,0 +1,17 @@ +diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h +index 348255d..5e0b7cd 100644 +--- a/include/private/gcconfig.h ++++ b/include/private/gcconfig.h +@@ -697,6 +697,12 @@ EXTERN_C_BEGIN + # define mach_type_known + # endif + ++# if defined(__GENODE__) && (defined(__amd64__) || defined(__x86_64__)) ++# define X86_64 ++# define GENODE ++# define mach_type_known ++# endif ++ + /* Feel free to add more clauses here */ + + /* Or manually define the machine type here. A machine type is */ diff --git a/overlay/default.nix b/overlay/default.nix index ffcfd80..01319f6 100644 --- a/overlay/default.nix +++ b/overlay/default.nix @@ -20,6 +20,11 @@ in { ++ [ "--without-bash-malloc" ]; # no sbrk please }); + boehmgc = overrideHostAttrs boehmgc (attrs: { + patches = [ ./boehmgc/genode.patch ]; + configureFlags = attrs.configureFlags ++ [ "--enable-threads=none" ]; + }); + binutils-unwrapped = addPatches binutils-unwrapped [ ./binutils/support-genode.patch ]; diff --git a/overlay/libc/default.nix b/overlay/libc/default.nix index 7457064..9100b16 100644 --- a/overlay/libc/default.nix +++ b/overlay/libc/default.nix @@ -14,8 +14,10 @@ genodeSources.buildDepot { # The libc needs a lot of work and we can't afford to # rebuild the toolchain for every fix. '' - find depot -name libc.abi.so -exec install -D {} "''${!outputLib}/libc.so" \; - find depot -name libm.abi.so -exec install -D {} "''${!outputLib}/libm.so" \; + libOutput="''${!outputLib}" + find depot -name libc.abi.so -exec install -D {} "$libOutput/libc.so" \; + find depot -name libm.abi.so -exec install -D {} "$libOutput/libm.so" \; + ln -s "libc.so" "$libOutput/libpthread.so" ''; postInstall = '' local headerDir="''${!outputDev}/include" -- 2.45.2