Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthew Finkel
tor-browser-build
Commits
85db911c
Unverified
Commit
85db911c
authored
Jun 15, 2018
by
boklm
Browse files
Merge remote-tracking branch 'gk/bug_26250_v5'
parents
dc355882
61aac87c
Changes
4
Hide whitespace changes
Inline
Side-by-side
projects/rust/binaryen.patch
deleted
100644 → 0
View file @
dc355882
From 820f26810baf35c1961763f6b0013e4f7e7380da Mon Sep 17 00:00:00 2001
From: Georg Koppen <gk@torproject.org>
Date: Thu, 12 Apr 2018 13:10:13 +0000
Subject: [PATCH] Use our gcc/c++
diff --git a/src/librustc_binaryen/build.rs b/src/librustc_binaryen/build.rs
index f23ff3cee5..2496dd1be9 100644
--- a/src/librustc_binaryen/build.rs
+++ b/src/librustc_binaryen/build.rs
@@ -26,6 +26,8 @@
fn main() {
Config::new("../binaryen")
.define("BUILD_STATIC_LIB", "ON")
+ .define("CMAKE_C_COMPILER", "gcc")
+ .define("CMAKE_CXX_COMPILER", "c++")
.build_target("binaryen")
.build();
--
2.16.3
projects/rust/build
View file @
85db911c
...
...
@@ -52,20 +52,13 @@ mkdir /var/tmp/build
tar
-
C
/
var
/
tmp
/
build
-
xf
[
%
c
(
'input_files_by_name/rust'
)
%
]
cd
/
var
/
tmp
/
build
/
rustc
-
[
%
c
(
'version'
)
%
]
-
src
[
%
IF
c
(
"var/linux"
)
%
]
# binaryen hardcodes /usr/bin/cc and /usr/bin/c++ as the C and C++ compiler.
# But that is too old on Debian Wheezy which is why we need to patch it, so
# we can use our own GCC instead.
patch
-
p1
<
$
rootdir
/
binaryen
.
patch
[
%
END
%
]
[
%
IF
c
(
"var/windows-i686"
)
%
]
# Cross-compiling for Windows 32bit is currently not possible without any
# patches. The reason for that is libstd expecting DWARF unwinding while most
# toolchains on Linux, targeting Windows 32bit, use SjLj unwinding.
# See: https://github.com/rust-lang/rust/issues/12859 for discussion about
# that and https://github.com/rust-lang/rust/pull/49633 for a newer attempt to
# fix this problem. We
backport and
apply the patch from neersighted.
# fix this problem. We apply the patch from neersighted.
patch
-
p1
<
$
rootdir
/
unwind
.
patch
[
%
END
%
]
...
...
projects/rust/config
View file @
85db911c
# vim: filetype=yaml sw=2
filename
:
'
[%
project
%]-[%
c("version")
%]-[%
c("var/osname")
%]-[%
c("var/build_id")
%].tar.gz'
version
:
1.2
5.0
version
:
1.2
6.1
var
:
prev_version
:
1.2
4.1
prev_version
:
1.2
5.0
container
:
use_container
:
1
...
...
@@ -71,7 +71,5 @@ input_files:
sig_ext
:
asc
file_gpg_id
:
1
gpg_keyring
:
rust.gpg
-
filename
:
binaryen.patch
enable
:
'
[%
c("var/linux")
%]'
-
filename
:
unwind.patch
enable
:
'
[%
c("var/windows-i686")
%]'
projects/rust/unwind.patch
View file @
85db911c
From
f967c575e502e507ed51b7ed8d1e2a08525e6ae6
Mon Sep 17 00:00:00 2001
From
dd808373aefe6247975455006bbfb89aa6410ed9
Mon Sep 17 00:00:00 2001
From: Bjorn Neergaard <bjorn@neersighted.com>
Date: Tue, 3 Apr 2018 19:01:07 -0600
Subject: [PATCH] Fix cross-compiling i686-pc-windows-gnu from Linux
...
...
@@ -32,15 +32,15 @@ rethinking of how iOS is special-cased above, to avoid further
duplication. Input on how to best structure this file is requested.
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index
c85b04ddc0..2f58f0d9fa
100644
index
e6aa78fba5..624f2ccfbe
100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -14
5
,6 +14
5
,11 @@
pub fn std_cargo(build: &Build,
@@ -14
6
,6 +14
6
,11 @@
pub fn std_cargo(build: &Build
er
,
cargo.env("MACOSX_DEPLOYMENT_TARGET", target);
}
+ // FIXME: Temporary detection of SJLJ MinGW compilers.
+ if build.build.contains("linux") && target == "i686-pc-windows-gnu" {
+ if build.build.
build.
contains("linux") && target == "i686-pc-windows-gnu" {
+ features.push_str(" sjlj_eh");
+ }
+
...
...
@@ -48,7 +48,7 @@ index c85b04ddc0..2f58f0d9fa 100644
// stage0. This works fine if the local rust and being-built rust have the
// same view of what the default allocator is, but fails otherwise. Since
diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml
index
c1fe4a89d6..6c8cb330d8
100644
index
1201759885..a06ef7e0e6
100644
--- a/src/libstd/Cargo.toml
+++ b/src/libstd/Cargo.toml
@@ -49,3 +49,4 @@
force_alloc_system = []
...
...
@@ -57,18 +57,19 @@ index c1fe4a89d6..6c8cb330d8 100644
wasm_syscall = []
+sjlj_eh = ["unwind/sjlj_eh"]
diff --git a/src/libunwind/Cargo.toml b/src/libunwind/Cargo.toml
index fbd9789d2f..
5e319c67fa
100644
index fbd9789d2f..
15a20d7ff4
100644
--- a/src/libunwind/Cargo.toml
+++ b/src/libunwind/Cargo.toml
@@ -14,3 +14,
6
@@
doc = false
@@ -14,3 +14,
7
@@
doc = false
[dependencies]
core = { path = "../libcore" }
libc = { path = "../rustc/libc_shim" }
+
+[features]
+sjlj_eh = []
+
diff --git a/src/libunwind/libunwind.rs b/src/libunwind/libunwind.rs
index
e6fff7963f..6a57cf7c93
100644
index
aa73b11fb3..16c21be736
100644
--- a/src/libunwind/libunwind.rs
+++ b/src/libunwind/libunwind.rs
@@ -10,11 +10,6 @@
...
...
@@ -83,15 +84,15 @@ index e6fff7963f..6a57cf7c93 100644
use libc::{c_int, c_void, uintptr_t};
#[repr(C)]
@@ -84,7 +79,6 @@
pub type _Unwind_Exception_Cleanup_Fn = extern "C" fn(unwind_code: _Unwind_Reaso
exception: *mut _Unwind_Exception);
@@ -85,7 +80,6 @@
pub type _Unwind_Exception_Cleanup_Fn = extern "C" fn(unwind_code: _Unwind_Reaso
extern "C" {
#[unwind]
#[cfg_attr(stage0, unwind)]
#[cfg_attr(not(stage0), unwind(allowed))]
- pub fn _Unwind_Resume(exception: *mut _Unwind_Exception) -> !;
pub fn _Unwind_DeleteException(exception: *mut _Unwind_Exception);
pub fn _Unwind_GetLanguageSpecificData(ctx: *mut _Unwind_Context) -> *mut c_void;
pub fn _Unwind_GetRegionStart(ctx: *mut _Unwind_Context) -> _Unwind_Ptr;
@@ -21
6
,2
6
+21
0,49
@@
if #[cfg(all(any(target_os = "ios", not(target_arch = "arm"))))] {
@@ -21
7
,2
8
+21
1,52
@@
if #[cfg(all(any(target_os = "ios", not(target_arch = "arm"))))] {
pc
}
}
...
...
@@ -103,7 +104,8 @@ index e6fff7963f..6a57cf7c93 100644
+if #[cfg(all(target_os = "ios", target_arch = "arm"))] {
+ // 32-bit iOS uses SjLj and does not provide _Unwind_Backtrace()
extern "C" {
#[unwind]
#[cfg_attr(stage0, unwind)]
#[cfg_attr(not(stage0), unwind(allowed))]
- pub fn _Unwind_RaiseException(exception: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
- pub fn _Unwind_Backtrace(trace: _Unwind_Trace_Fn,
- trace_argument: *mut c_void)
...
...
@@ -121,7 +123,8 @@ index e6fff7963f..6a57cf7c93 100644
+
+} else if #[cfg(feature = "sjlj_eh")] {
extern "C" {
#[unwind]
#[cfg_attr(stage0, unwind)]
#[cfg_attr(not(stage0), unwind(allowed))]
+ pub fn _Unwind_SjLj_Resume(e: *mut _Unwind_Exception) -> !;
pub fn _Unwind_SjLj_RaiseException(e: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
+ pub fn _Unwind_Backtrace(trace: _Unwind_Trace_Fn,
...
...
@@ -140,7 +143,8 @@ index e6fff7963f..6a57cf7c93 100644
}
+} else {
+ extern "C" {
+ #[unwind]
+ #[cfg_attr(stage0, unwind)]
+ #[cfg_attr(not(stage0), unwind(allowed))]
+ pub fn _Unwind_Resume(exception: *mut _Unwind_Exception) -> !;
+ pub fn _Unwind_RaiseException(exception: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
+ pub fn _Unwind_Backtrace(trace: _Unwind_Trace_Fn,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment