From 3fdf8a8f68b98831a068736d220f920dca4460ed Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Thu, 25 Jul 2024 13:28:29 -0700 Subject: [PATCH] sourceHighlight: fix tests with llvm --- pkgs/tools/text/source-highlight/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/text/source-highlight/default.nix b/pkgs/tools/text/source-highlight/default.nix index 07ed74f91c73..715b9d8ce91d 100644 --- a/pkgs/tools/text/source-highlight/default.nix +++ b/pkgs/tools/text/source-highlight/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchpatch, fetchurl, boost, updateAutotoolsGnuConfigScriptsHook }: +{ lib, stdenv, fetchpatch, fetchurl, boost, updateAutotoolsGnuConfigScriptsHook, llvmPackages }: stdenv.mkDerivation rec { pname = "source-highlight"; @@ -46,7 +46,10 @@ stdenv.mkDerivation rec { # necessary to build on FreeBSD native pending inclusion of # https://git.savannah.gnu.org/cgit/config.git/commit/?id=e4786449e1c26716e3f9ea182caf472e4dbc96e0 nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; - buildInputs = [ boost ]; + buildInputs = [ boost ] + ++ lib.optional (stdenv.targetPlatform.useLLVM or false) (llvmPackages.compiler-rt.override { + doFakeLibgcc = true; + }); configureFlags = [ "--with-boost=${boost.out}" @@ -71,4 +74,7 @@ stdenv.mkDerivation rec { platforms = platforms.unix; maintainers = with maintainers; [ SuperSandro2000 ]; }; +} // lib.optionalAttrs (stdenv.targetPlatform.useLLVM or false) { + # Force linking to "libgcc" so tests pass + NIX_CFLAGS_COMPILE = "-lgcc"; }