Fix cross-compiling by building only with the "build" architecture

This commit is contained in:
Ximin Luo 2019-11-25 21:59:11 +00:00
parent 3cc6a50366
commit 981dad5c00
4 changed files with 52 additions and 1 deletions

View File

@ -9,7 +9,7 @@ cargo = "RUST_DESTDIR/usr/bin/cargo"
build = "DEB_BUILD_RUST_TYPE"
host = ["DEB_HOST_RUST_TYPE"]
target = ["wasm32-unknown-unknown", "DEB_TARGET_RUST_TYPE"]
target = ["DEB_TARGET_RUST_TYPE"]
#full-bootstrap = true
# originally needed to work around #45317 but no longer necessary

View File

@ -0,0 +1,49 @@
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -159,7 +159,7 @@
pathset, self.name, builder.config.exclude
);
}
- let hosts = &builder.hosts;
+ //let hosts = &builder.hosts;
// Determine the targets participating in this rule.
let targets = if self.only_hosts {
@@ -172,17 +172,17 @@
&builder.targets
};
- for host in hosts {
+ //for host in hosts {
for target in targets {
let run = RunConfig {
builder,
path: pathset.path(builder),
- host: *host,
+ host: builder.build.build,
target: *target,
};
(self.make_run)(run);
}
- }
+ //}
}
fn run(v: &[StepDescription], builder: &Builder<'_>, paths: &[PathBuf]) {
--- a/config.toml.example
+++ b/config.toml.example
@@ -115,12 +115,11 @@
# In addition to the build triple, other triples to produce full compiler
# toolchains for. Each of these triples will be bootstrapped from the build
-# triple and then will continue to bootstrap themselves. This platform must
-# currently be able to run all of the triples provided here.
+# triple and then will continue to bootstrap themselves.
#host = ["x86_64-unknown-linux-gnu"] # defaults to just the build triple
# In addition to all host triples, other triples to produce the standard library
-# for. Each host triple will be used to produce a copy of the standard library
+# for. Each build triple will be used to produce a copy of the standard library
# for each target triple.
#target = ["x86_64-unknown-linux-gnu"] # defaults to just the build triple

View File

@ -29,6 +29,7 @@ d-read-beta-version-from-file.patch
d-ignore-avx-44056.patch
d-i686-baseline.patch
d-no-jemalloc.patch
d-cross-compile-with-build-not-host.patch
# Porter fixes under discussion, not suitable for upstreaming
# as-is but a proper fix is being discussed

1
debian/rules vendored
View File

@ -196,6 +196,7 @@ override_dh_auto_configure-indep: debian/dh_auto_configure.stamp
ifeq (true,$(BUILD_DOCS))
# Change config.toml now and not later, since that might trigger a rebuild
sed -i -e 's/^docs = false/docs = true/' debian/config.toml
sed -i -e 's/^target = \["\(.*\)"\]/target = ["\1", "wasm32-unknown-unknown"]/' debian/config.toml
endif
override_dh_auto_clean: