Loading pkgs/build-support/rust/hooks/default.nix +2 −2 Original line number Diff line number Diff line Loading @@ -66,10 +66,10 @@ cargoConfig = '' [target."${stdenv.buildPlatform.rust.rustcTarget}"] "linker" = "${rust.envVars.linkerForBuild}" "linker" = "${rust.envVars.ccForBuild}" ${lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) '' [target."${stdenv.hostPlatform.rust.rustcTarget}"] "linker" = "${rust.envVars.linkerForHost}" "linker" = "${rust.envVars.ccForHost}" ''} "rustflags" = [ "-C", "target-feature=${if stdenv.hostPlatform.isStatic then "+" else "-"}crt-static" ] ''; Loading pkgs/build-support/rust/lib/default.nix +6 −9 Original line number Diff line number Diff line Loading @@ -16,11 +16,9 @@ rec { ccForBuild = "${pkgsBuildHost.stdenv.cc}/bin/${pkgsBuildHost.stdenv.cc.targetPrefix}cc"; cxxForBuild = "${pkgsBuildHost.stdenv.cc}/bin/${pkgsBuildHost.stdenv.cc.targetPrefix}c++"; linkerForBuild = ccForBuild; ccForHost = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"; cxxForHost = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"; linkerForHost = ccForHost; # Unfortunately we must use the dangerous `pkgsTargetTarget` here # because hooks are artificially phase-shifted one slot earlier Loading @@ -28,7 +26,6 @@ rec { # a targetPlatform to them). ccForTarget = "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"; cxxForTarget = "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"; linkerForTarget = ccForTarget; rustBuildPlatform = stdenv.buildPlatform.rust.rustcTarget; rustBuildPlatformSpec = stdenv.buildPlatform.rust.rustcTargetSpec; Loading @@ -38,9 +35,9 @@ rec { rustTargetPlatformSpec = stdenv.targetPlatform.rust.rustcTargetSpec; in { inherit ccForBuild cxxForBuild linkerForBuild rustBuildPlatform rustBuildPlatformSpec ccForHost cxxForHost linkerForHost rustHostPlatform rustHostPlatformSpec ccForTarget cxxForTarget linkerForTarget rustTargetPlatform rustTargetPlatformSpec; ccForBuild cxxForBuild rustBuildPlatform rustBuildPlatformSpec ccForHost cxxForHost rustHostPlatform rustHostPlatformSpec ccForTarget cxxForTarget rustTargetPlatform rustTargetPlatformSpec; # Prefix this onto a command invocation in order to set the # variables needed by cargo. Loading @@ -56,15 +53,15 @@ rec { + lib.optionalString (rustTargetPlatform != rustHostPlatform) '' "CC_${stdenv.targetPlatform.rust.cargoEnvVarTarget}=${ccForTarget}" \ "CXX_${stdenv.targetPlatform.rust.cargoEnvVarTarget}=${cxxForTarget}" \ "CARGO_TARGET_${stdenv.targetPlatform.rust.cargoEnvVarTarget}_LINKER=${linkerForTarget}" \ "CARGO_TARGET_${stdenv.targetPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForTarget}" \ '' + '' "CC_${stdenv.hostPlatform.rust.cargoEnvVarTarget}=${ccForHost}" \ "CXX_${stdenv.hostPlatform.rust.cargoEnvVarTarget}=${cxxForHost}" \ "CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER=${linkerForHost}" \ "CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForHost}" \ '' + '' "CC_${stdenv.buildPlatform.rust.cargoEnvVarTarget}=${ccForBuild}" \ "CXX_${stdenv.buildPlatform.rust.cargoEnvVarTarget}=${cxxForBuild}" \ "CARGO_TARGET_${stdenv.buildPlatform.rust.cargoEnvVarTarget}_LINKER=${linkerForBuild}" \ "CARGO_TARGET_${stdenv.buildPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForBuild}" \ "CARGO_BUILD_TARGET=${rustBuildPlatform}" \ "HOST_CC=${pkgsBuildHost.stdenv.cc}/bin/cc" \ "HOST_CXX=${pkgsBuildHost.stdenv.cc}/bin/c++" \ Loading Loading
pkgs/build-support/rust/hooks/default.nix +2 −2 Original line number Diff line number Diff line Loading @@ -66,10 +66,10 @@ cargoConfig = '' [target."${stdenv.buildPlatform.rust.rustcTarget}"] "linker" = "${rust.envVars.linkerForBuild}" "linker" = "${rust.envVars.ccForBuild}" ${lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) '' [target."${stdenv.hostPlatform.rust.rustcTarget}"] "linker" = "${rust.envVars.linkerForHost}" "linker" = "${rust.envVars.ccForHost}" ''} "rustflags" = [ "-C", "target-feature=${if stdenv.hostPlatform.isStatic then "+" else "-"}crt-static" ] ''; Loading
pkgs/build-support/rust/lib/default.nix +6 −9 Original line number Diff line number Diff line Loading @@ -16,11 +16,9 @@ rec { ccForBuild = "${pkgsBuildHost.stdenv.cc}/bin/${pkgsBuildHost.stdenv.cc.targetPrefix}cc"; cxxForBuild = "${pkgsBuildHost.stdenv.cc}/bin/${pkgsBuildHost.stdenv.cc.targetPrefix}c++"; linkerForBuild = ccForBuild; ccForHost = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"; cxxForHost = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"; linkerForHost = ccForHost; # Unfortunately we must use the dangerous `pkgsTargetTarget` here # because hooks are artificially phase-shifted one slot earlier Loading @@ -28,7 +26,6 @@ rec { # a targetPlatform to them). ccForTarget = "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"; cxxForTarget = "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"; linkerForTarget = ccForTarget; rustBuildPlatform = stdenv.buildPlatform.rust.rustcTarget; rustBuildPlatformSpec = stdenv.buildPlatform.rust.rustcTargetSpec; Loading @@ -38,9 +35,9 @@ rec { rustTargetPlatformSpec = stdenv.targetPlatform.rust.rustcTargetSpec; in { inherit ccForBuild cxxForBuild linkerForBuild rustBuildPlatform rustBuildPlatformSpec ccForHost cxxForHost linkerForHost rustHostPlatform rustHostPlatformSpec ccForTarget cxxForTarget linkerForTarget rustTargetPlatform rustTargetPlatformSpec; ccForBuild cxxForBuild rustBuildPlatform rustBuildPlatformSpec ccForHost cxxForHost rustHostPlatform rustHostPlatformSpec ccForTarget cxxForTarget rustTargetPlatform rustTargetPlatformSpec; # Prefix this onto a command invocation in order to set the # variables needed by cargo. Loading @@ -56,15 +53,15 @@ rec { + lib.optionalString (rustTargetPlatform != rustHostPlatform) '' "CC_${stdenv.targetPlatform.rust.cargoEnvVarTarget}=${ccForTarget}" \ "CXX_${stdenv.targetPlatform.rust.cargoEnvVarTarget}=${cxxForTarget}" \ "CARGO_TARGET_${stdenv.targetPlatform.rust.cargoEnvVarTarget}_LINKER=${linkerForTarget}" \ "CARGO_TARGET_${stdenv.targetPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForTarget}" \ '' + '' "CC_${stdenv.hostPlatform.rust.cargoEnvVarTarget}=${ccForHost}" \ "CXX_${stdenv.hostPlatform.rust.cargoEnvVarTarget}=${cxxForHost}" \ "CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER=${linkerForHost}" \ "CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForHost}" \ '' + '' "CC_${stdenv.buildPlatform.rust.cargoEnvVarTarget}=${ccForBuild}" \ "CXX_${stdenv.buildPlatform.rust.cargoEnvVarTarget}=${cxxForBuild}" \ "CARGO_TARGET_${stdenv.buildPlatform.rust.cargoEnvVarTarget}_LINKER=${linkerForBuild}" \ "CARGO_TARGET_${stdenv.buildPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForBuild}" \ "CARGO_BUILD_TARGET=${rustBuildPlatform}" \ "HOST_CC=${pkgsBuildHost.stdenv.cc}/bin/cc" \ "HOST_CXX=${pkgsBuildHost.stdenv.cc}/bin/c++" \ Loading