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