From 71b85973dd334b983b9ec7b7489953e48316a67c Mon Sep 17 00:00:00 2001 From: Ivar Scholten Date: Tue, 6 Sep 2022 02:57:08 +0200 Subject: [PATCH] nodejs-18_x: fix cross compilation to aarch64-linux This adds a patch reverting https://github.com/nodejs/node/pull/43200 because it breaks cross compilation to aarch64-linux. Gcc would not recognize the `-msign-return-address=all` flag causing compilation to fail. --- pkgs/development/web/nodejs/v18.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/web/nodejs/v18.nix b/pkgs/development/web/nodejs/v18.nix index 27d9022f31dd..84dd3a91ceba 100644 --- a/pkgs/development/web/nodejs/v18.nix +++ b/pkgs/development/web/nodejs/v18.nix @@ -1,4 +1,4 @@ -{ callPackage, python3, enableNpm ? true }: +{ callPackage, fetchpatch, python3, enableNpm ? true }: let buildNodejs = callPackage ./nodejs.nix { @@ -10,6 +10,14 @@ buildNodejs { version = "18.8.0"; sha256 = "sha256-K12YJdBe3mYU8WaKjZfXdP6S68gQiOxf31gYTc48hrk="; patches = [ + (fetchpatch { + # Fixes cross compilation to aarch64-linux by reverting https://github.com/nodejs/node/pull/43200 + name = "revert-arm64-pointer-auth.patch"; + url = "https://github.com/nodejs/node/pull/43200/commits/d42c42cc8ac652ab387aa93205aed6ece8a5040a.patch"; + sha256 = "sha256-ipGzg4lEoftTJbt6sW+0QJO/AZqHvUkFKe0qlum+iLY="; + revert = true; + }) + ./disable-darwin-v8-system-instrumentation.patch ]; }