Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Win64 eh_personality natively. #27210

Merged
merged 3 commits into from Aug 3, 2015
Merged

Conversation

vadimcn
Copy link
Contributor

@vadimcn vadimcn commented Jul 22, 2015

After this change, the only remaining symbol we are pulling from libgcc on Win64 is __chkstk_ms - the stack probing routine.

@rust-highfive
Copy link
Collaborator

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@vadimcn
Copy link
Contributor Author

vadimcn commented Jul 22, 2015

I am not quite happy about the way rust_eh_unwind_resume get linked. It should have probably been a lang item, but I couldn't quite figure out how to plumb it through to LLVMRustHookUnwindResume...

@rust-highfive rust-highfive assigned alexcrichton and unassigned brson Jul 22, 2015
@vadimcn
Copy link
Contributor Author

vadimcn commented Jul 22, 2015

r? @alexcrichton

@bors
Copy link
Contributor

bors commented Jul 22, 2015

☔ The latest upstream changes (presumably #27176) made this pull request unmergeable. Please resolve the merge conflicts.

[libstd implementation](../std/rt/unwind/index.html) for more
The second and third of these functions, `eh_personality` and `rust_eh_unwind_resume`,
are used by the failure mechanisms of the compiler. These are often mapped to GCC's
personality function and libgcc's `_Unwind_Resume` respectively
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wording of this sentence somehow seems to suggest GCC personality function and _Unwind_Resume come from two different locations, while in practice they both come from libgcc.

@alexcrichton
Copy link
Member

Nice work @vadimcn!

// [24:27] = type
// [0:23] = magic
const ETYPE: DWORD = 0b1110_u32 << 28;
const MAGIC: DWORD = 0x525354; // "RST"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RST also refers to reStructuredText. How about we use .rs here?

const MAGIC: DWORD = 0x2e7273; // ".rs"

@brson brson added the relnotes Marks issues that should be documented in the release notes of the next release. label Jul 23, 2015
@brson
Copy link
Contributor

brson commented Jul 23, 2015

Epic patch.

@vadimcn vadimcn force-pushed the win64-eh-pers branch 2 times, most recently from 502a189 to 59d5b19 Compare July 24, 2015 09:28
@vadimcn
Copy link
Contributor Author

vadimcn commented Jul 24, 2015

Addressed comments and rebased on top of master. r?

pub mod imp;
#[cfg(not(target_env = "msvc"))] #[path = "gcc.rs"] #[doc(hidden)]

// x86-pc-windows-gnu and all others
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/x86/i686/

@vadimcn
Copy link
Contributor Author

vadimcn commented Aug 2, 2015

Works now. r?

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 2, 2015

📌 Commit e493027 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Aug 2, 2015

⌛ Testing commit e493027 with merge 2c60a05...

@bors
Copy link
Contributor

bors commented Aug 2, 2015

💔 Test failed - auto-linux-64-x-android-t

@Gankra
Copy link
Contributor

Gankra commented Aug 2, 2015

Seems legit:


../src/libstd/rt/unwind/gcc.rs:231:38: 231:43 error: use of moved
value: `state` [E0382]
../src/libstd/rt/unwind/gcc.rs:231
__gcc_personality_v0(state, ue_header, context)
                                                                        ^~~~~
../src/libstd/rt/unwind/gcc.rs:225:13: 225:18 note: `state` moved here
because it has type `rt::libunwind::_Unwind_State`, which is
non-copyable
../src/libstd/rt/unwind/gcc.rs:225         if (state as c_int &
uw::_US_ACTION_MASK as c_int)
                                               ^~~~~
error: aborting due to previous error
make: *** [x86_64-unknown-linux-gnu/stage2/lib/rustlib/arm-linux-androideabi/lib/stamp.std]
Error 101
make: *** Waiting for unfinished jobs....

On Sun, Aug 2, 2015 at 12:08 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-linux-64-x-android-t
http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/5916


Reply to this email directly or view it on GitHub
#27210 (comment).

@vadimcn
Copy link
Contributor Author

vadimcn commented Aug 3, 2015

Fixed. Let's try again?

@alexcrichton
Copy link
Member

@bors: r+ 96d1db2

@bors
Copy link
Contributor

bors commented Aug 3, 2015

⌛ Testing commit 96d1db2 with merge d99b3c5...

@bors
Copy link
Contributor

bors commented Aug 3, 2015

💔 Test failed - auto-mac-64-opt

@alexcrichton
Copy link
Member

@bors: retry

On Mon, Aug 3, 2015 at 10:37 AM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-mac-64-opt
http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/5957


Reply to this email directly or view it on GitHub
#27210 (comment).

bors added a commit that referenced this pull request Aug 3, 2015
After this change, the only remaining symbol we are pulling from libgcc on Win64 is `__chkstk_ms` - the stack probing routine.
@bors
Copy link
Contributor

bors commented Aug 3, 2015

⌛ Testing commit 96d1db2 with merge ceded6a...

@bors bors merged commit 96d1db2 into rust-lang:master Aug 3, 2015
@alexcrichton
Copy link
Member

🎊

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Aug 11, 2015
This commit leverages the runtime support for DWARF exception info added
in rust-lang#27210 to enable unwinding by default on 64-bit MSVC. This also additionally
adds a few minor fixes here and there in the test harness and such to get
`make check` entirely passing on 64-bit MSVC:

* The invocation of `maketest.py` now works with spaces/quotes in CC
* debuginfo tests are disabled on MSVC
* A link error for librustc was hacked around (see rust-lang#27438)
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Aug 12, 2015
This commit leverages the runtime support for DWARF exception info added
in rust-lang#27210 to enable unwinding by default on 64-bit MSVC. This also additionally
adds a few minor fixes here and there in the test harness and such to get
`make check` entirely passing on 64-bit MSVC:

* The invocation of `maketest.py` now works with spaces/quotes in CC
* debuginfo tests are disabled on MSVC
* A link error for librustc was hacked around (see rust-lang#27438)
@vadimcn vadimcn deleted the win64-eh-pers branch October 9, 2015 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants