summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-05-01 03:03:19 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-05-14 21:29:51 +0000
commit18c38f8aee732b6202042383fc35997a39361830 (patch)
tree466554af31e75e2739adbc2f236206e37eb72fad /lib
parente3a1c149d26bd82c4b42ba5e06fec73933ce8bf6 (diff)
downloadnixpkgs-18c38f8aee732b6202042383fc35997a39361830.tar
nixpkgs-18c38f8aee732b6202042383fc35997a39361830.tar.gz
nixpkgs-18c38f8aee732b6202042383fc35997a39361830.tar.bz2
nixpkgs-18c38f8aee732b6202042383fc35997a39361830.tar.lz
nixpkgs-18c38f8aee732b6202042383fc35997a39361830.tar.xz
nixpkgs-18c38f8aee732b6202042383fc35997a39361830.tar.zst
nixpkgs-18c38f8aee732b6202042383fc35997a39361830.zip
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 <sternenseemann@systemli.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/systems/default.nix13
1 files changed, 13 insertions, 0 deletions
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"