File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -151,8 +151,15 @@ pub fn check(build: &mut Build) {
151
151
panic ! ( "the iOS target is only supported on macOS" ) ;
152
152
}
153
153
154
- // Make sure musl-root is valid if specified
154
+ // Make sure musl-root is valid
155
155
if target. contains ( "musl" ) && !target. contains ( "mips" ) {
156
+ // If this is a native target (host is also musl) and no musl-root is given,
157
+ // fall back to the system toolchain in /usr before giving up
158
+ if build. musl_root ( * target) . is_none ( ) && build. config . build == * target {
159
+ let target = build. config . target_config . entry ( target. clone ( ) )
160
+ . or_insert ( Default :: default ( ) ) ;
161
+ target. musl_root = Some ( "/usr" . into ( ) ) ;
162
+ }
156
163
match build. musl_root ( * target) {
157
164
Some ( root) => {
158
165
if fs:: metadata ( root. join ( "lib/libc.a" ) ) . is_err ( ) {
You can’t perform that action at this time.
0 commit comments