Skip to content

Commit a195fb0

Browse files
committed
.
1 parent cc39abb commit a195fb0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

nix/util.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ rec {
7070
};
7171
mkShellWithCC_valgrind' = cc:
7272
mkShellWithCC cc {
73-
packages = [ pkgs.python3 ] ++ pkgs.lib.optionals (!pkgs.stdenv.isDarwin) [ valgrind_varlat ];
73+
packages = [ pkgs.python3 ] ++ pkgs.lib.optionals (!pkgs.stdenv.isDarwin) [ valgrind_varlat ]
74+
++ pkgs.lib.optionals (builtins.hasAttr "isClang" cc && cc.isClang or false) [ pkgs.llvmPackages.bintools ];
7475
hardeningDisable = [ "fortify" ];
7576
};
7677

test/mk/config.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ SIZE := $(CROSS_PREFIX)size
2525
# such as lto. Using gcc-ar is preferred when creating or linking static libraries
2626
# if the binary is compiled with -flto. However, it is not universally present, so
2727
# only use it if available.
28-
CC_AR ?= $(if $(and $(findstring gcc,$(shell $(CC) --version)), $(findstring gcc-ar, $(shell which $(CROSS_PREFIX)gcc-ar))),gcc-ar,ar)
28+
# NOTE: Similarly, clang's LTO requires llvm-ar for proper static library creation.
29+
CC_AR ?= $(if $(and $(findstring gcc,$(shell $(CC) --version)), $(findstring gcc-ar, $(shell which $(CROSS_PREFIX)gcc-ar))),gcc-ar,$(if $(and $(findstring clang,$(shell $(CC) --version)), $(findstring llvm-ar, $(shell which $(CROSS_PREFIX)llvm-ar))),llvm-ar,ar))
2930
CC_AR := $(CROSS_PREFIX)$(CC_AR)
3031

32+
3133
#################
3234
# Common config #
3335
#################

0 commit comments

Comments
 (0)