Merge pull request #25194 from obsidiansystems/host-target-unconfuse

stdenv.cross is a silly attribute that needs to go leaving the well-defined hostPlatform and targetPlatform. This PR doesn't remove it, but changes its definition: before it tracked the target platform which is sometimes more useful for compilers, and now it tracks the host platform which is more useful for everything else. Most usages are libraries, falling in the "everything else" category, so changing the definition makes sense to appease the majority. The few compiler (gcc in particular) uses that exist I remove to use targetPlatform --- preserving correctness and becoming more explicit in the process.

I would also update the documentation aside mentioning stdenv.cross as deprecated, but the definition given actually erroneously assumes this PR is already merged!

authored by

John Ericson and committed by
GitHub
75441dd6 f2d1aa05

+139 -126
+11 -10
pkgs/development/compilers/gcc/4.5/default.nix
··· 26 26 , gnat ? null 27 27 , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd 28 28 , stripped ? true 29 + , buildPlatform, hostPlatform, targetPlatform 29 30 }: 30 31 31 32 assert langJava -> zip != null && unzip != null ··· 271 272 targetConfig = if cross != null then cross.config else null; 272 273 273 274 crossAttrs = { 274 - AR = "${stdenv.cross.config}-ar"; 275 - LD = "${stdenv.cross.config}-ld"; 276 - CC = "${stdenv.cross.config}-gcc"; 277 - CXX = "${stdenv.cross.config}-gcc"; 278 - AR_FOR_TARGET = "${stdenv.cross.config}-ar"; 279 - LD_FOR_TARGET = "${stdenv.cross.config}-ld"; 280 - CC_FOR_TARGET = "${stdenv.cross.config}-gcc"; 281 - NM_FOR_TARGET = "${stdenv.cross.config}-nm"; 282 - CXX_FOR_TARGET = "${stdenv.cross.config}-g++"; 275 + AR = "${targetPlatform.config}-ar"; 276 + LD = "${targetPlatform.config}-ld"; 277 + CC = "${targetPlatform.config}-gcc"; 278 + CXX = "${targetPlatform.config}-gcc"; 279 + AR_FOR_TARGET = "${targetPlatform.config}-ar"; 280 + LD_FOR_TARGET = "${targetPlatform.config}-ld"; 281 + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; 282 + NM_FOR_TARGET = "${targetPlatform.config}-nm"; 283 + CXX_FOR_TARGET = "${targetPlatform.config}-g++"; 283 284 # If we are making a cross compiler, cross != null 284 285 NIX_CC_CROSS = if cross == null then "${stdenv.ccCross}" else ""; 285 286 dontStrip = true; ··· 311 312 ${if langAda then " --enable-libada" else ""} 312 313 ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""} 313 314 ${if cross != null then crossConfigureFlags else ""} 314 - --target=${stdenv.cross.config} 315 + --target=${targetPlatform.config} 315 316 ''; 316 317 }; 317 318
+22 -21
pkgs/development/compilers/gcc/4.8/default.nix
··· 34 34 , stripped ? true 35 35 , gnused ? null 36 36 , darwin ? null 37 + , buildPlatform, hostPlatform, targetPlatform 37 38 }: 38 39 39 40 assert langJava -> zip != null && unzip != null ··· 123 124 crossMingw = cross != null && cross.libc == "msvcrt"; 124 125 crossDarwin = cross != null && cross.libc == "libSystem"; 125 126 crossConfigureFlags = let 126 - gccArch = stdenv.cross.gcc.arch or null; 127 - gccCpu = stdenv.cross.gcc.cpu or null; 128 - gccAbi = stdenv.cross.gcc.abi or null; 129 - gccFpu = stdenv.cross.gcc.fpu or null; 130 - gccFloat = stdenv.cross.gcc.float or null; 131 - gccMode = stdenv.cross.gcc.mode or null; 127 + gccArch = targetPlatform.gcc.arch or null; 128 + gccCpu = targetPlatform.gcc.cpu or null; 129 + gccAbi = targetPlatform.gcc.abi or null; 130 + gccFpu = targetPlatform.gcc.fpu or null; 131 + gccFloat = targetPlatform.gcc.float or null; 132 + gccMode = targetPlatform.gcc.mode or null; 132 133 withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; 133 134 withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; 134 135 withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; ··· 382 383 else "install"; 383 384 384 385 crossAttrs = let 385 - xgccArch = stdenv.cross.gcc.arch or null; 386 - xgccCpu = stdenv.cross.gcc.cpu or null; 387 - xgccAbi = stdenv.cross.gcc.abi or null; 388 - xgccFpu = stdenv.cross.gcc.fpu or null; 389 - xgccFloat = stdenv.cross.gcc.float or null; 386 + xgccArch = targetPlatform.gcc.arch or null; 387 + xgccCpu = targetPlatform.gcc.cpu or null; 388 + xgccAbi = targetPlatform.gcc.abi or null; 389 + xgccFpu = targetPlatform.gcc.fpu or null; 390 + xgccFloat = targetPlatform.gcc.float or null; 390 391 xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; 391 392 xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; 392 393 xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; 393 394 xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; 394 395 xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; 395 396 in { 396 - AR = "${stdenv.cross.config}-ar"; 397 - LD = "${stdenv.cross.config}-ld"; 398 - CC = "${stdenv.cross.config}-gcc"; 399 - CXX = "${stdenv.cross.config}-gcc"; 400 - AR_FOR_TARGET = "${stdenv.cross.config}-ar"; 401 - LD_FOR_TARGET = "${stdenv.cross.config}-ld"; 402 - CC_FOR_TARGET = "${stdenv.cross.config}-gcc"; 403 - NM_FOR_TARGET = "${stdenv.cross.config}-nm"; 404 - CXX_FOR_TARGET = "${stdenv.cross.config}-g++"; 397 + AR = "${targetPlatform.config}-ar"; 398 + LD = "${targetPlatform.config}-ld"; 399 + CC = "${targetPlatform.config}-gcc"; 400 + CXX = "${targetPlatform.config}-gcc"; 401 + AR_FOR_TARGET = "${targetPlatform.config}-ar"; 402 + LD_FOR_TARGET = "${targetPlatform.config}-ld"; 403 + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; 404 + NM_FOR_TARGET = "${targetPlatform.config}-nm"; 405 + CXX_FOR_TARGET = "${targetPlatform.config}-g++"; 405 406 # If we are making a cross compiler, cross != null 406 407 NIX_CC_CROSS = if cross == null then "${stdenv.ccCross}" else ""; 407 408 dontStrip = true; ··· 431 432 ) 432 433 } 433 434 ${if langAda then " --enable-libada" else ""} 434 - --target=${stdenv.cross.config} 435 + --target=${targetPlatform.config} 435 436 ${xwithArch} 436 437 ${xwithCpu} 437 438 ${xwithAbi}
+22 -21
pkgs/development/compilers/gcc/4.9/default.nix
··· 34 34 , stripped ? true 35 35 , gnused ? null 36 36 , darwin ? null 37 + , buildPlatform, hostPlatform, targetPlatform 37 38 }: 38 39 39 40 assert langJava -> zip != null && unzip != null ··· 125 126 crossMingw = cross != null && cross.libc == "msvcrt"; 126 127 crossDarwin = cross != null && cross.libc == "libSystem"; 127 128 crossConfigureFlags = let 128 - gccArch = stdenv.cross.gcc.arch or null; 129 - gccCpu = stdenv.cross.gcc.cpu or null; 130 - gccAbi = stdenv.cross.gcc.abi or null; 131 - gccFpu = stdenv.cross.gcc.fpu or null; 132 - gccFloat = stdenv.cross.gcc.float or null; 133 - gccMode = stdenv.cross.gcc.mode or null; 129 + gccArch = targetPlatform.gcc.arch or null; 130 + gccCpu = targetPlatform.gcc.cpu or null; 131 + gccAbi = targetPlatform.gcc.abi or null; 132 + gccFpu = targetPlatform.gcc.fpu or null; 133 + gccFloat = targetPlatform.gcc.float or null; 134 + gccMode = targetPlatform.gcc.mode or null; 134 135 withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; 135 136 withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; 136 137 withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; ··· 389 390 else "install"; 390 391 391 392 crossAttrs = let 392 - xgccArch = stdenv.cross.gcc.arch or null; 393 - xgccCpu = stdenv.cross.gcc.cpu or null; 394 - xgccAbi = stdenv.cross.gcc.abi or null; 395 - xgccFpu = stdenv.cross.gcc.fpu or null; 396 - xgccFloat = stdenv.cross.gcc.float or null; 393 + xgccArch = targetPlatform.gcc.arch or null; 394 + xgccCpu = targetPlatform.gcc.cpu or null; 395 + xgccAbi = targetPlatform.gcc.abi or null; 396 + xgccFpu = targetPlatform.gcc.fpu or null; 397 + xgccFloat = targetPlatform.gcc.float or null; 397 398 xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; 398 399 xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; 399 400 xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; 400 401 xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; 401 402 xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; 402 403 in { 403 - AR = "${stdenv.cross.config}-ar"; 404 - LD = "${stdenv.cross.config}-ld"; 405 - CC = "${stdenv.cross.config}-gcc"; 406 - CXX = "${stdenv.cross.config}-gcc"; 407 - AR_FOR_TARGET = "${stdenv.cross.config}-ar"; 408 - LD_FOR_TARGET = "${stdenv.cross.config}-ld"; 409 - CC_FOR_TARGET = "${stdenv.cross.config}-gcc"; 410 - NM_FOR_TARGET = "${stdenv.cross.config}-nm"; 411 - CXX_FOR_TARGET = "${stdenv.cross.config}-g++"; 404 + AR = "${targetPlatform.config}-ar"; 405 + LD = "${targetPlatform.config}-ld"; 406 + CC = "${targetPlatform.config}-gcc"; 407 + CXX = "${targetPlatform.config}-gcc"; 408 + AR_FOR_TARGET = "${targetPlatform.config}-ar"; 409 + LD_FOR_TARGET = "${targetPlatform.config}-ld"; 410 + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; 411 + NM_FOR_TARGET = "${targetPlatform.config}-nm"; 412 + CXX_FOR_TARGET = "${targetPlatform.config}-g++"; 412 413 # If we are making a cross compiler, cross != null 413 414 NIX_CC_CROSS = if cross == null then "${stdenv.ccCross}" else ""; 414 415 dontStrip = true; ··· 438 439 ) 439 440 } 440 441 ${if langAda then " --enable-libada" else ""} 441 - --target=${stdenv.cross.config} 442 + --target=${targetPlatform.config} 442 443 ${xwithArch} 443 444 ${xwithCpu} 444 445 ${xwithAbi}
+22 -21
pkgs/development/compilers/gcc/5/default.nix
··· 36 36 , binutils ? null 37 37 , cloog # unused; just for compat with gcc4, as we override the parameter on some places 38 38 , darwin ? null 39 + , buildPlatform, hostPlatform, targetPlatform 39 40 }: 40 41 41 42 assert langJava -> zip != null && unzip != null ··· 129 130 crossMingw = cross != null && cross.libc == "msvcrt"; 130 131 crossDarwin = cross != null && cross.libc == "libSystem"; 131 132 crossConfigureFlags = let 132 - gccArch = stdenv.cross.gcc.arch or null; 133 - gccCpu = stdenv.cross.gcc.cpu or null; 134 - gccAbi = stdenv.cross.gcc.abi or null; 135 - gccFpu = stdenv.cross.gcc.fpu or null; 136 - gccFloat = stdenv.cross.gcc.float or null; 137 - gccMode = stdenv.cross.gcc.mode or null; 133 + gccArch = targetPlatform.gcc.arch or null; 134 + gccCpu = targetPlatform.gcc.cpu or null; 135 + gccAbi = targetPlatform.gcc.abi or null; 136 + gccFpu = targetPlatform.gcc.fpu or null; 137 + gccFloat = targetPlatform.gcc.float or null; 138 + gccMode = targetPlatform.gcc.mode or null; 138 139 withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; 139 140 withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; 140 141 withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; ··· 404 405 else "install"; 405 406 406 407 crossAttrs = let 407 - xgccArch = stdenv.cross.gcc.arch or null; 408 - xgccCpu = stdenv.cross.gcc.cpu or null; 409 - xgccAbi = stdenv.cross.gcc.abi or null; 410 - xgccFpu = stdenv.cross.gcc.fpu or null; 411 - xgccFloat = stdenv.cross.gcc.float or null; 408 + xgccArch = targetPlatform.gcc.arch or null; 409 + xgccCpu = targetPlatform.gcc.cpu or null; 410 + xgccAbi = targetPlatform.gcc.abi or null; 411 + xgccFpu = targetPlatform.gcc.fpu or null; 412 + xgccFloat = targetPlatform.gcc.float or null; 412 413 xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; 413 414 xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; 414 415 xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; 415 416 xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; 416 417 xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; 417 418 in { 418 - AR = "${stdenv.cross.config}-ar"; 419 - LD = "${stdenv.cross.config}-ld"; 420 - CC = "${stdenv.cross.config}-gcc"; 421 - CXX = "${stdenv.cross.config}-gcc"; 422 - AR_FOR_TARGET = "${stdenv.cross.config}-ar"; 423 - LD_FOR_TARGET = "${stdenv.cross.config}-ld"; 424 - CC_FOR_TARGET = "${stdenv.cross.config}-gcc"; 425 - NM_FOR_TARGET = "${stdenv.cross.config}-nm"; 426 - CXX_FOR_TARGET = "${stdenv.cross.config}-g++"; 419 + AR = "${targetPlatform.config}-ar"; 420 + LD = "${targetPlatform.config}-ld"; 421 + CC = "${targetPlatform.config}-gcc"; 422 + CXX = "${targetPlatform.config}-gcc"; 423 + AR_FOR_TARGET = "${targetPlatform.config}-ar"; 424 + LD_FOR_TARGET = "${targetPlatform.config}-ld"; 425 + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; 426 + NM_FOR_TARGET = "${targetPlatform.config}-nm"; 427 + CXX_FOR_TARGET = "${targetPlatform.config}-g++"; 427 428 # If we are making a cross compiler, cross != null 428 429 NIX_CC_CROSS = if cross == null then "${stdenv.ccCross}" else ""; 429 430 dontStrip = true; ··· 452 453 ) 453 454 } 454 455 ${if langAda then " --enable-libada" else ""} 455 - --target=${stdenv.cross.config} 456 + --target=${targetPlatform.config} 456 457 ${xwithArch} 457 458 ${xwithCpu} 458 459 ${xwithAbi}
+22 -21
pkgs/development/compilers/gcc/6/default.nix
··· 36 36 , binutils ? null 37 37 , cloog # unused; just for compat with gcc4, as we override the parameter on some places 38 38 , darwin ? null 39 + , buildPlatform, hostPlatform, targetPlatform 39 40 }: 40 41 41 42 assert langJava -> zip != null && unzip != null ··· 125 126 crossMingw = cross != null && cross.libc == "msvcrt"; 126 127 crossDarwin = cross != null && cross.libc == "libSystem"; 127 128 crossConfigureFlags = let 128 - gccArch = stdenv.cross.gcc.arch or null; 129 - gccCpu = stdenv.cross.gcc.cpu or null; 130 - gccAbi = stdenv.cross.gcc.abi or null; 131 - gccFpu = stdenv.cross.gcc.fpu or null; 132 - gccFloat = stdenv.cross.gcc.float or null; 133 - gccMode = stdenv.cross.gcc.mode or null; 129 + gccArch = targetPlatform.gcc.arch or null; 130 + gccCpu = targetPlatform.gcc.cpu or null; 131 + gccAbi = targetPlatform.gcc.abi or null; 132 + gccFpu = targetPlatform.gcc.fpu or null; 133 + gccFloat = targetPlatform.gcc.float or null; 134 + gccMode = targetPlatform.gcc.mode or null; 134 135 withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; 135 136 withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; 136 137 withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; ··· 386 387 else "install"; 387 388 388 389 crossAttrs = let 389 - xgccArch = stdenv.cross.gcc.arch or null; 390 - xgccCpu = stdenv.cross.gcc.cpu or null; 391 - xgccAbi = stdenv.cross.gcc.abi or null; 392 - xgccFpu = stdenv.cross.gcc.fpu or null; 393 - xgccFloat = stdenv.cross.gcc.float or null; 390 + xgccArch = targetPlatform.gcc.arch or null; 391 + xgccCpu = targetPlatform.gcc.cpu or null; 392 + xgccAbi = targetPlatform.gcc.abi or null; 393 + xgccFpu = targetPlatform.gcc.fpu or null; 394 + xgccFloat = targetPlatform.gcc.float or null; 394 395 xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; 395 396 xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; 396 397 xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; 397 398 xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; 398 399 xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; 399 400 in { 400 - AR = "${stdenv.cross.config}-ar"; 401 - LD = "${stdenv.cross.config}-ld"; 402 - CC = "${stdenv.cross.config}-gcc"; 403 - CXX = "${stdenv.cross.config}-gcc"; 404 - AR_FOR_TARGET = "${stdenv.cross.config}-ar"; 405 - LD_FOR_TARGET = "${stdenv.cross.config}-ld"; 406 - CC_FOR_TARGET = "${stdenv.cross.config}-gcc"; 407 - NM_FOR_TARGET = "${stdenv.cross.config}-nm"; 408 - CXX_FOR_TARGET = "${stdenv.cross.config}-g++"; 401 + AR = "${targetPlatform.config}-ar"; 402 + LD = "${targetPlatform.config}-ld"; 403 + CC = "${targetPlatform.config}-gcc"; 404 + CXX = "${targetPlatform.config}-gcc"; 405 + AR_FOR_TARGET = "${targetPlatform.config}-ar"; 406 + LD_FOR_TARGET = "${targetPlatform.config}-ld"; 407 + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; 408 + NM_FOR_TARGET = "${targetPlatform.config}-nm"; 409 + CXX_FOR_TARGET = "${targetPlatform.config}-g++"; 409 410 # If we are making a cross compiler, cross != null 410 411 NIX_CC_CROSS = if cross == null then "${stdenv.ccCross}" else ""; 411 412 dontStrip = true; ··· 434 435 ) 435 436 } 436 437 ${if langAda then " --enable-libada" else ""} 437 - --target=${stdenv.cross.config} 438 + --target=${targetPlatform.config} 438 439 ${xwithArch} 439 440 ${xwithCpu} 440 441 ${xwithAbi}
+22 -21
pkgs/development/compilers/gcc/snapshot/default.nix
··· 37 37 , cloog # unused; just for compat with gcc4, as we override the parameter on some places 38 38 , darwin ? null 39 39 , flex ? null 40 + , buildPlatform, hostPlatform, targetPlatform 40 41 }: 41 42 42 43 assert langJava -> zip != null && unzip != null ··· 125 126 crossMingw = cross != null && cross.libc == "msvcrt"; 126 127 crossDarwin = cross != null && cross.libc == "libSystem"; 127 128 crossConfigureFlags = let 128 - gccArch = stdenv.cross.gcc.arch or null; 129 - gccCpu = stdenv.cross.gcc.cpu or null; 130 - gccAbi = stdenv.cross.gcc.abi or null; 131 - gccFpu = stdenv.cross.gcc.fpu or null; 132 - gccFloat = stdenv.cross.gcc.float or null; 133 - gccMode = stdenv.cross.gcc.mode or null; 129 + gccArch = targetPlatform.gcc.arch or null; 130 + gccCpu = targetPlatform.gcc.cpu or null; 131 + gccAbi = targetPlatform.gcc.abi or null; 132 + gccFpu = targetPlatform.gcc.fpu or null; 133 + gccFloat = targetPlatform.gcc.float or null; 134 + gccMode = targetPlatform.gcc.mode or null; 134 135 withArch = if gccArch != null then " --with-arch=${gccArch}" else ""; 135 136 withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else ""; 136 137 withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else ""; ··· 386 387 else "install"; 387 388 388 389 crossAttrs = let 389 - xgccArch = stdenv.cross.gcc.arch or null; 390 - xgccCpu = stdenv.cross.gcc.cpu or null; 391 - xgccAbi = stdenv.cross.gcc.abi or null; 392 - xgccFpu = stdenv.cross.gcc.fpu or null; 393 - xgccFloat = stdenv.cross.gcc.float or null; 390 + xgccArch = targetPlatform.gcc.arch or null; 391 + xgccCpu = targetPlatform.gcc.cpu or null; 392 + xgccAbi = targetPlatform.gcc.abi or null; 393 + xgccFpu = targetPlatform.gcc.fpu or null; 394 + xgccFloat = targetPlatform.gcc.float or null; 394 395 xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; 395 396 xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; 396 397 xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; 397 398 xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; 398 399 xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; 399 400 in { 400 - AR = "${stdenv.cross.config}-ar"; 401 - LD = "${stdenv.cross.config}-ld"; 402 - CC = "${stdenv.cross.config}-gcc"; 403 - CXX = "${stdenv.cross.config}-gcc"; 404 - AR_FOR_TARGET = "${stdenv.cross.config}-ar"; 405 - LD_FOR_TARGET = "${stdenv.cross.config}-ld"; 406 - CC_FOR_TARGET = "${stdenv.cross.config}-gcc"; 407 - NM_FOR_TARGET = "${stdenv.cross.config}-nm"; 408 - CXX_FOR_TARGET = "${stdenv.cross.config}-g++"; 401 + AR = "${targetPlatform.config}-ar"; 402 + LD = "${targetPlatform.config}-ld"; 403 + CC = "${targetPlatform.config}-gcc"; 404 + CXX = "${targetPlatform.config}-gcc"; 405 + AR_FOR_TARGET = "${targetPlatform.config}-ar"; 406 + LD_FOR_TARGET = "${targetPlatform.config}-ld"; 407 + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; 408 + NM_FOR_TARGET = "${targetPlatform.config}-nm"; 409 + CXX_FOR_TARGET = "${targetPlatform.config}-g++"; 409 410 # If we are making a cross compiler, cross != null 410 411 NIX_CC_CROSS = if cross == null then "${stdenv.ccCross}" else ""; 411 412 dontStrip = true; ··· 434 435 ) 435 436 } 436 437 ${if langAda then " --enable-libada" else ""} 437 - --target=${stdenv.cross.config} 438 + --target=${targetPlatform.config} 438 439 ${xwithArch} 439 440 ${xwithCpu} 440 441 ${xwithAbi}
+4
pkgs/stdenv/adapters.nix
··· 58 58 # builds. 59 59 makeStdenvCross = stdenv: cross: binutilsCross: gccCross: stdenv // { 60 60 61 + # Overrides are surely not valid as packages built with this run on a 62 + # different platform. 63 + overrides = _: _: {}; 64 + 61 65 mkDerivation = 62 66 { name ? "", buildInputs ? [], nativeBuildInputs ? [] 63 67 , propagatedBuildInputs ? [], propagatedNativeBuildInputs ? []
+1 -3
pkgs/stdenv/cross/default.nix
··· 21 21 selfBuild = false; 22 22 # It's OK to change the built-time dependencies 23 23 allowCustomOverrides = true; 24 - stdenv = vanillaPackages.stdenv // { 25 - overrides = _: _: {}; 26 - }; 24 + inherit (vanillaPackages) stdenv; 27 25 }) 28 26 29 27 # Run Packages
+4 -1
pkgs/stdenv/darwin/default.nix
··· 253 253 inherit 254 254 gnumake gzip gnused bzip2 gawk ed xz patch bash 255 255 libcxxabi libcxx ncurses libffi zlib icu llvm gmp pcre gnugrep 256 - coreutils findutils diffutils patchutils binutils binutils-raw; 256 + coreutils findutils diffutils patchutils; 257 257 258 258 llvmPackages = super.llvmPackages // { 259 259 inherit (llvmPackages) llvm clang-unwrapped; ··· 262 262 darwin = super.darwin // { 263 263 inherit (darwin) dyld Libsystem cctools libiconv; 264 264 }; 265 + } // lib.optionalAttrs (super.targetPlatform == localSystem) { 266 + # Need to get rid of these when cross-compiling. 267 + inherit binutils binutils-raw; 265 268 }; 266 269 267 270 stdenvDarwin = prevStage: let pkgs = prevStage; in import ../generic rec {
+5 -3
pkgs/stdenv/linux/default.nix
··· 298 298 */ 299 299 300 300 overrides = self: super: { 301 - gcc = cc; 302 - 303 301 inherit (prevStage) 304 - gzip bzip2 xz bash binutils coreutils diffutils findutils gawk 302 + gzip bzip2 xz bash coreutils diffutils findutils gawk 305 303 glibc gnumake gnused gnutar gnugrep gnupatch patchelf 306 304 attr acl paxctl zlib pcre; 305 + } // lib.optionalAttrs (super.targetPlatform == localSystem) { 306 + # Need to get rid of these when cross-compiling. 307 + inherit (prevStage) binutils; 308 + gcc = cc; 307 309 }; 308 310 }; 309 311 })
+2 -2
pkgs/top-level/all-packages.nix
··· 4975 4975 4976 4976 gccCrossStageStatic = assert targetPlatform != buildPlatform; let 4977 4977 libcCross1 = 4978 - if stdenv.cross.libc == "msvcrt" then windows.mingw_w64_headers 4979 - else if stdenv.cross.libc == "libSystem" then darwin.xcode 4978 + if targetPlatform.libc == "msvcrt" then windows.mingw_w64_headers 4979 + else if targetPlatform.libc == "libSystem" then darwin.xcode 4980 4980 else null; 4981 4981 in wrapGCCCross { 4982 4982 gcc = forcedNativePackages.gcc.cc.override {
+2 -2
pkgs/top-level/stage.nix
··· 110 110 in { 111 111 stdenv = super.stdenv // { 112 112 inherit (buildPlatform) platform; 113 - } // lib.optionalAttrs (targetPlatform != buildPlatform) { 114 - cross = targetPlatform; 113 + } // lib.optionalAttrs (hostPlatform != buildPlatform) { 114 + cross = hostPlatform; 115 115 }; 116 116 inherit (buildPlatform) system platform; 117 117 };