lol

Merge pull request #28391 from obsidiansystems/gcc-configure-platforms

gcc: Use `configurePlatforms` to control --build, --host, and --target

authored by

John Ericson and committed by
GitHub
46930ef3 9884a3b1

+49 -16
+7 -2
pkgs/development/compilers/gcc/4.5/default.nix
··· 73 73 crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"); 74 74 75 75 crossConfigureFlags = 76 - "--target=${targetPlatform.config}" + 77 76 withArch + 78 77 withCpu + 79 78 withAbi + ··· 231 230 ++ (optionals langVhdl [gnat]) 232 231 ; 233 232 233 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 234 + configurePlatforms = 235 + # TODO(@Ericson2314): Figure out what's going wrong with Arm 236 + if hostPlatform == targetPlatform && targetPlatform.isArm32 237 + then [] 238 + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 239 + 234 240 configureFlags = " 235 241 ${if enableMultilib then "" else "--disable-multilib"} 236 242 ${if enableShared then "" else "--disable-shared"} ··· 313 319 ${if langAda then " --enable-libada" else ""} 314 320 ${if targetplatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""} 315 321 ${if targetPlatform != hostPlatform then crossConfigureFlags else ""} 316 - --target=${targetPlatform.config} 317 322 ''; 318 323 }; 319 324
+7 -2
pkgs/development/compilers/gcc/4.8/default.nix
··· 142 142 withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; 143 143 withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; 144 144 in 145 - "--target=${targetPlatform.config}" + 146 145 withArch + 147 146 withCpu + 148 147 withAbi + ··· 317 316 318 317 dontDisableStatic = true; 319 318 319 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 320 + configurePlatforms = 321 + # TODO(@Ericson2314): Figure out what's going wrong with Arm 322 + if hostPlatform == targetPlatform && targetPlatform.isArm32 323 + then [] 324 + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 325 + 320 326 configureFlags = " 321 327 ${if hostPlatform.isSunOS then 322 328 " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + ··· 436 442 ) 437 443 } 438 444 ${if langAda then " --enable-libada" else ""} 439 - --target=${targetPlatform.config} 440 445 ${xwithArch} 441 446 ${xwithCpu} 442 447 ${xwithAbi}
+7 -2
pkgs/development/compilers/gcc/4.9/default.nix
··· 136 136 withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; 137 137 withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; 138 138 in 139 - "--target=${targetPlatform.config}" + 140 139 withArch + 141 140 withCpu + 142 141 withAbi + ··· 317 316 318 317 dontDisableStatic = true; 319 318 319 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 320 + configurePlatforms = 321 + # TODO(@Ericson2314): Figure out what's going wrong with Arm 322 + if hostPlatform == targetPlatform && targetPlatform.isArm32 323 + then [] 324 + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 325 + 320 326 configureFlags = " 321 327 ${if hostPlatform.isSunOS then 322 328 " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + ··· 434 440 ) 435 441 } 436 442 ${if langAda then " --enable-libada" else ""} 437 - --target=${targetPlatform.config} 438 443 ${xwithArch} 439 444 ${xwithCpu} 440 445 ${xwithAbi}
+7 -4
pkgs/development/compilers/gcc/5/default.nix
··· 142 142 withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; 143 143 withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; 144 144 in 145 - "--target=${targetPlatform.config}" + 146 145 withArch + 147 146 withCpu + 148 147 withAbi + ··· 334 333 335 334 dontDisableStatic = true; 336 335 336 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 337 + configurePlatforms = 338 + # TODO(@Ericson2314): Figure out what's going wrong with Arm 339 + if hostPlatform == targetPlatform && targetPlatform.isArm32 340 + then [] 341 + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 342 + 337 343 configureFlags = " 338 344 ${if hostPlatform.isSunOS then 339 345 " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + ··· 451 457 ) 452 458 } 453 459 ${if langAda then " --enable-libada" else ""} 454 - --build=${buildPlatform.config} 455 - --host=${hostPlatform.config} 456 - --target=${targetPlatform.config} 457 460 ${xwithArch} 458 461 ${xwithCpu} 459 462 ${xwithAbi}
+7 -2
pkgs/development/compilers/gcc/6/default.nix
··· 136 136 withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; 137 137 withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; 138 138 in 139 - "--target=${targetPlatform.config}" + 140 139 withArch + 141 140 withCpu + 142 141 withAbi + ··· 326 325 327 326 dontDisableStatic = true; 328 327 328 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 329 + configurePlatforms = 330 + # TODO(@Ericson2314): Figure out what's going wrong with Arm 331 + if hostPlatform == targetPlatform && targetPlatform.isArm32 332 + then [] 333 + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 334 + 329 335 configureFlags = " 330 336 ${if hostPlatform.isSunOS then 331 337 " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + ··· 443 449 ) 444 450 } 445 451 ${if langAda then " --enable-libada" else ""} 446 - --target=${targetPlatform.config} 447 452 ${xwithArch} 448 453 ${xwithCpu} 449 454 ${xwithAbi}
+7 -2
pkgs/development/compilers/gcc/7/default.nix
··· 137 137 withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; 138 138 withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; 139 139 in 140 - "--target=${targetPlatform.config}" + 141 140 withArch + 142 141 withCpu + 143 142 withAbi + ··· 328 327 329 328 dontDisableStatic = true; 330 329 330 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 331 + configurePlatforms = 332 + # TODO(@Ericson2314): Figure out what's going wrong with Arm 333 + if hostPlatform == targetPlatform && targetPlatform.isArm32 334 + then [] 335 + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 336 + 331 337 configureFlags = " 332 338 ${if hostPlatform.isSunOS then 333 339 " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + ··· 445 451 ) 446 452 } 447 453 ${if langAda then " --enable-libada" else ""} 448 - --target=${targetPlatform.config} 449 454 ${xwithArch} 450 455 ${xwithCpu} 451 456 ${xwithAbi}
+7 -2
pkgs/development/compilers/gcc/snapshot/default.nix
··· 137 137 withFloat = if gccFloat != null then " --with-float=${gccFloat}" else ""; 138 138 withMode = if gccMode != null then " --with-mode=${gccMode}" else ""; 139 139 in 140 - "--target=${targetPlatform.config}" + 141 140 withArch + 142 141 withCpu + 143 142 withAbi + ··· 315 314 316 315 dontDisableStatic = true; 317 316 317 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 318 + configurePlatforms = 319 + # TODO(@Ericson2314): Figure out what's going wrong with Arm 320 + if hostPlatform == targetPlatform && targetPlatform.isArm32 321 + then [] 322 + else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 323 + 318 324 configureFlags = " 319 325 ${if hostPlatform.isSunOS then 320 326 " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " + ··· 432 438 ) 433 439 } 434 440 ${if langAda then " --enable-libada" else ""} 435 - --target=${targetPlatform.config} 436 441 ${xwithArch} 437 442 ${xwithCpu} 438 443 ${xwithAbi}