From 18c38f8aee732b6202042383fc35997a39361830 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 1 May 2021 03:03:19 +0000 Subject: treewide: All the linker to be chosen independently This will begin the process of breaking up the `useLLVM` monolith. That is good in general, but I hope will be good for NetBSD and Darwin in particular. Co-authored-by: sterni --- lib/systems/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 21b00374da4..549f01b058f 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -41,6 +41,19 @@ rec { else if final.isNetBSD then "nblibc" # TODO(@Ericson2314) think more about other operating systems else "native/impure"; + # Choose what linker we wish to use by default. Someday we might also + # choose the C compiler, runtime library, C++ standard library, etc. in + # this way, nice and orthogonally, and deprecate `useLLVM`. But due to + # the monolithic GCC build we cannot actually make those choices + # independently, so we are just doing `linker` and keeping `useLLVM` for + # now. + linker = + /**/ if final.useLLVM or false then "lld" + else if final.isDarwin then "cctools" + # "bfd" and "gold" both come from GNU binutils. The existance of Gold + # is why we use the more obscure "bfd" and not "binutils" for this + # choice. + else "bfd"; extensions = { sharedLibrary = /**/ if final.isDarwin then ".dylib" -- cgit 1.4.1