diff --git a/nodejs/fix-trap-handler.patch b/nodejs/fix-trap-handler.patch new file mode 100644 index 000000000..44c696307 --- /dev/null +++ b/nodejs/fix-trap-handler.patch @@ -0,0 +1,37 @@ +From 2674676fe3b01cc9652a5922badc9b044080fce7 Mon Sep 17 00:00:00 2001 +From: Lu Yahan +Date: Wed, 8 May 2024 16:34:24 +0800 +Subject: [PATCH] tools: fix riscv64 build failed + +--- + tools/v8_gypfiles/v8.gyp | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp +index 1e2b3645132aab..ab96e0c7d2c1f2 100644 +--- a/tools/v8_gypfiles/v8.gyp ++++ b/tools/v8_gypfiles/v8.gyp +@@ -1150,6 +1150,23 @@ + 'sources': [ + ' -+makedepends+=(clang) -+ -+_set_compilation_env() { -+ # https://bugs.chromium.org/p/v8/issues/detail?id=14547 -+ export CC=/usr/bin/clang -+ export CXX=/usr/bin/clang++ ++prepare() { ++ cd node ++ patch -Np1 -i ../fix-trap-handler.patch +} + build() { -+ _set_compilation_env cd node - # /usr/lib/libnode.so uses malloc_usable_size, which is incompatible with fortification level 3 -@@ -48,11 +57,13 @@ build() { - } - - check() { -+ _set_compilation_env - cd node - make test || : - } - - package() { -+ _set_compilation_env - cd node - make DESTDIR="$pkgdir" install - install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/nodejs/