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