Skip to content

Commit e335620

Browse files
authored
Auto merge of #36983 - alexcrichton:configure-multiple-musl, r=brson
configure: Add options for separate musl roots This allows using the `./configure` script to enable rustbuild to compile multiple musl targets at once. We'll hopefully use this soon on our bots to produce a bunch of targets.
2 parents 1e4c8b1 + 19d1929 commit e335620

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

configure

+6-9
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,12 @@ valopt arm-linux-androideabi-ndk "" "arm-linux-androideabi NDK standalone path"
653653
valopt armv7-linux-androideabi-ndk "" "armv7-linux-androideabi NDK standalone path"
654654
valopt aarch64-linux-android-ndk "" "aarch64-linux-android NDK standalone path"
655655
valopt nacl-cross-path "" "NaCl SDK path (Pepper Canary is recommended). Must be absolute!"
656-
valopt musl-root "/usr/local" "MUSL root installation directory"
656+
valopt musl-root "/usr/local" "MUSL root installation directory (deprecated)"
657+
valopt musl-root-x86_64 "/usr/local" "x86_64-unknown-linux-musl install directory"
658+
valopt musl-root-i686 "/usr/local" "i686-unknown-linux-musl install directory"
659+
valopt musl-root-arm "/usr/local" "arm-unknown-linux-musleabi install directory"
660+
valopt musl-root-armhf "/usr/local" "arm-unknown-linux-musleabihf install directory"
661+
valopt musl-root-armv7 "/usr/local" "armv7-unknown-linux-musleabihf install directory"
657662
valopt extra-filename "" "Additional data that is hashed and passed to the -C extra-filename flag"
658663

659664
if [ -e ${CFG_SRC_DIR}.git ]
@@ -1212,14 +1217,6 @@ do
12121217
fi
12131218
;;
12141219

1215-
1216-
x86_64-*-musl | arm-*-musleabi)
1217-
if [ ! -f $CFG_MUSL_ROOT/lib/libc.a ]
1218-
then
1219-
err "musl libc $CFG_MUSL_ROOT/lib/libc.a not found"
1220-
fi
1221-
;;
1222-
12231220
*-msvc)
12241221
# There are three builds of cmake on windows: MSVC, MinGW and Cygwin
12251222
# The Cygwin build does not have generators for Visual Studio, so

src/bootstrap/config.rs

+30
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,36 @@ impl Config {
350350
"CFG_MUSL_ROOT" if value.len() > 0 => {
351351
self.musl_root = Some(PathBuf::from(value));
352352
}
353+
"CFG_MUSL_ROOT_X86_64" if value.len() > 0 => {
354+
let target = "x86_64-unknown-linux-musl".to_string();
355+
let target = self.target_config.entry(target)
356+
.or_insert(Target::default());
357+
target.musl_root = Some(PathBuf::from(value));
358+
}
359+
"CFG_MUSL_ROOT_I686" if value.len() > 0 => {
360+
let target = "i686-unknown-linux-musl".to_string();
361+
let target = self.target_config.entry(target)
362+
.or_insert(Target::default());
363+
target.musl_root = Some(PathBuf::from(value));
364+
}
365+
"CFG_MUSL_ROOT_ARM" if value.len() > 0 => {
366+
let target = "arm-unknown-linux-musleabi".to_string();
367+
let target = self.target_config.entry(target)
368+
.or_insert(Target::default());
369+
target.musl_root = Some(PathBuf::from(value));
370+
}
371+
"CFG_MUSL_ROOT_ARMHF" if value.len() > 0 => {
372+
let target = "arm-unknown-linux-musleabihf".to_string();
373+
let target = self.target_config.entry(target)
374+
.or_insert(Target::default());
375+
target.musl_root = Some(PathBuf::from(value));
376+
}
377+
"CFG_MUSL_ROOT_ARMV7" if value.len() > 0 => {
378+
let target = "armv7-unknown-linux-musleabihf".to_string();
379+
let target = self.target_config.entry(target)
380+
.or_insert(Target::default());
381+
target.musl_root = Some(PathBuf::from(value));
382+
}
353383
"CFG_DEFAULT_AR" if value.len() > 0 => {
354384
self.rustc_default_ar = Some(value.to_string());
355385
}

0 commit comments

Comments
 (0)