Skip to content

Commit cab347b

Browse files
committed
refactor: Move ld=gold rule to mesonBuildLayer
1 parent 3d078cd commit cab347b

File tree

23 files changed

+6
-82
lines changed

23 files changed

+6
-82
lines changed

flake.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,6 @@
283283
# These attributes go right into `packages.<system>`.
284284
"${pkgName}" = nixpkgsFor.${system}.native.nixComponents.${pkgName};
285285
"${pkgName}-static" = nixpkgsFor.${system}.static.nixComponents.${pkgName};
286-
/**
287-
Nix and dependencies built with LLVM and Clang, maintainers:
288-
@RossComputerGuy, Nix team
289-
*/
290286
"${pkgName}-llvm" = nixpkgsFor.${system}.llvm.nixComponents.${pkgName};
291287
}
292288
// lib.optionalAttrs supportsCross (flatMapAttrs (lib.genAttrs crossSystems (_: { })) (crossSystem: {}: {

packaging/dependencies.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ let
9797
];
9898
separateDebugInfo = !stdenv.hostPlatform.isStatic;
9999
hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
100+
env = prevAttrs.env or {}
101+
// lib.optionalAttrs
102+
(stdenv.isLinux
103+
&& !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux")
104+
&& !(stdenv.hostPlatform.useLLVM or false))
105+
{ LDFLAGS = "-fuse-ld=gold"; };
100106
};
101107

102108
mesonLibraryLayer = finalAttrs: prevAttrs:

src/libcmd/package.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ mkMesonLibrary (finalAttrs: {
7676
(lib.mesonOption "readline-flavor" readlineFlavor)
7777
];
7878

79-
env = lib.optionalAttrs (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux") && !(stdenv.hostPlatform.useLLVM or false)) {
80-
LDFLAGS = "-fuse-ld=gold";
81-
};
82-
8379
meta = {
8480
platforms = lib.platforms.unix ++ lib.platforms.windows;
8581
};

src/libexpr-c/package.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ mkMesonLibrary (finalAttrs: {
4747
mesonFlags = [
4848
];
4949

50-
env = lib.optionalAttrs (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux")) {
51-
LDFLAGS = "-fuse-ld=gold";
52-
};
53-
5450
meta = {
5551
platforms = lib.platforms.unix ++ lib.platforms.windows;
5652
};

src/libexpr-test-support/package.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ mkMesonLibrary (finalAttrs: {
5151
mesonFlags = [
5252
];
5353

54-
env = lib.optionalAttrs (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux")) {
55-
LDFLAGS = "-fuse-ld=gold";
56-
};
57-
5854
meta = {
5955
platforms = lib.platforms.unix ++ lib.platforms.windows;
6056
};

src/libexpr-tests/package.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ mkMesonExecutable (finalAttrs: {
5656
mesonFlags = [
5757
];
5858

59-
env = lib.optionalAttrs (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux")) {
60-
LDFLAGS = "-fuse-ld=gold";
61-
};
62-
6359
passthru = {
6460
tests = {
6561
run = runCommand "${finalAttrs.pname}-run" {

src/libexpr/package.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ mkMesonLibrary (finalAttrs: {
9696
# https://github.com/NixOS/nixpkgs/issues/86131.
9797
BOOST_INCLUDEDIR = "${lib.getDev boost}/include";
9898
BOOST_LIBRARYDIR = "${lib.getLib boost}/lib";
99-
} // lib.optionalAttrs (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux") && !(stdenv.hostPlatform.useLLVM or false)) {
100-
LDFLAGS = "-fuse-ld=gold";
10199
};
102100

103101
meta = {

src/libfetchers-tests/package.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ mkMesonExecutable (finalAttrs: {
5454
mesonFlags = [
5555
];
5656

57-
env = lib.optionalAttrs (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux")) {
58-
LDFLAGS = "-fuse-ld=gold";
59-
};
60-
6157
passthru = {
6258
tests = {
6359
run = runCommand "${finalAttrs.pname}-run" {

src/libfetchers/package.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ mkMesonLibrary (finalAttrs: {
4949
echo ${version} > ../../.version
5050
'';
5151

52-
env = lib.optionalAttrs (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux") && !(stdenv.hostPlatform.useLLVM or false)) {
53-
LDFLAGS = "-fuse-ld=gold";
54-
};
55-
5652
meta = {
5753
platforms = lib.platforms.unix ++ lib.platforms.windows;
5854
};

src/libflake-c/package.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ mkMesonLibrary (finalAttrs: {
4949
mesonFlags = [
5050
];
5151

52-
env = lib.optionalAttrs (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux")) {
53-
LDFLAGS = "-fuse-ld=gold";
54-
};
55-
5652
meta = {
5753
platforms = lib.platforms.unix ++ lib.platforms.windows;
5854
};

0 commit comments

Comments
 (0)