gcc: provide build support for gccrs
Patches from the gccrs project are being upstreamed into gcc. With
these changes we are now able to build a gcc with rust support like
this:
```nix
wrapCC (gcc14.cc.override {
langRust = true;
});
```
More info:
https://rust-gcc.github.io/
https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608387.html
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
, langObjC
|
||||
, langObjCpp
|
||||
, langJit
|
||||
, langRust ? false
|
||||
, disableBootstrap ? stdenv.targetPlatform != stdenv.hostPlatform
|
||||
}:
|
||||
|
||||
@@ -171,6 +172,7 @@ let
|
||||
++ lib.optional langObjCpp "obj-c++"
|
||||
++ lib.optionals crossDarwin [ "objc" "obj-c++" ]
|
||||
++ lib.optional langJit "jit"
|
||||
++ lib.optional langRust "rust"
|
||||
)
|
||||
}"
|
||||
]
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
, javaAwtGtk ? false
|
||||
, langAda ? false
|
||||
, langGo ? false
|
||||
, langRust ? false
|
||||
, cargo
|
||||
, withoutTargetLibc ? null
|
||||
, threadsCross ? null
|
||||
}:
|
||||
@@ -53,6 +55,7 @@ in
|
||||
++ optionals javaAwtGtk [ pkg-config ]
|
||||
++ optionals (with stdenv.targetPlatform; isVc4 || isRedox && flex != null) [ flex ]
|
||||
++ optionals langAda [ gnat-bootstrap ]
|
||||
++ optionals langRust [ cargo ]
|
||||
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with
|
||||
# "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
|
||||
++ optionals buildPlatform.isDarwin [ gnused ]
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
, reproducibleBuild ? true
|
||||
, profiledCompiler ? false
|
||||
, langJit ? false
|
||||
, langRust ? false
|
||||
, cargo
|
||||
, staticCompiler ? false
|
||||
, enableShared ? stdenv.targetPlatform.hasSharedLibraries
|
||||
, enableLTO ? stdenv.hostPlatform.hasSharedLibraries
|
||||
@@ -128,6 +130,7 @@ let
|
||||
inherit
|
||||
binutils
|
||||
buildPackages
|
||||
cargo
|
||||
cloog
|
||||
withoutTargetLibc
|
||||
darwin
|
||||
@@ -153,6 +156,7 @@ let
|
||||
langJit
|
||||
langObjC
|
||||
langObjCpp
|
||||
langRust
|
||||
lib
|
||||
libcCross
|
||||
libmpc
|
||||
|
||||
Reference in New Issue
Block a user