From 2303031e51ca6e4bc11db858492992c0ea0ecd2a Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Wed, 5 Jan 2022 11:17:38 -0800 Subject: [PATCH] spidermonkey: Force lp64d ABI for riscv64 cc-rs is hardcoded to use the soft-float ABI for riscv64, while the rest of the system is double-float. This is not just a missing stub header file - You can't link object files using different ABIs. --- pkgs/development/interpreters/spidermonkey/78.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/interpreters/spidermonkey/78.nix b/pkgs/development/interpreters/spidermonkey/78.nix index a534026d9ecd..4f525c8f0a5b 100644 --- a/pkgs/development/interpreters/spidermonkey/78.nix +++ b/pkgs/development/interpreters/spidermonkey/78.nix @@ -107,6 +107,10 @@ stdenv.mkDerivation rec { depsBuildBuild = [ buildPackages.stdenv.cc ]; + # cc-rs insists on using -mabi=lp64 (soft-float) for riscv64, + # while we have a double-float toolchain + NIX_CFLAGS_COMPILE = lib.optionalString (with stdenv.hostPlatform; isRiscV && is64bit) "-mabi=lp64d"; + # Remove unnecessary static lib preFixup = '' moveToOutput bin/js78-config "$dev"