bootstrap: Configurable musl libdir
Make it possible to customize the location of musl libdir using musl-libdir in config.toml, e.g., to use lib64 instead of lib.
This commit is contained in:
@@ -877,6 +877,15 @@ impl Build {
|
||||
.map(|p| &**p)
|
||||
}
|
||||
|
||||
/// Returns the "musl libdir" for this `target`.
|
||||
fn musl_libdir(&self, target: Interned<String>) -> Option<PathBuf> {
|
||||
let t = self.config.target_config.get(&target)?;
|
||||
if let libdir @ Some(_) = &t.musl_libdir {
|
||||
return libdir.clone();
|
||||
}
|
||||
self.musl_root(target).map(|root| root.join("lib"))
|
||||
}
|
||||
|
||||
/// Returns the sysroot for the wasi target, if defined
|
||||
fn wasi_root(&self, target: Interned<String>) -> Option<&Path> {
|
||||
self.config.target_config.get(&target).and_then(|t| t.wasi_root.as_ref()).map(|p| &**p)
|
||||
|
||||
Reference in New Issue
Block a user