{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/29177","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/29177/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/29177/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/29177/events","html_url":"https://github.com/rust-lang/rust/pull/29177","id":112269321,"number":29177,"title":"Remove dependency on libgcc-dw2-1.dll from win32 executables.","user":{"login":"vadimcn","id":3203809,"avatar_url":"https://avatars.githubusercontent.com/u/3203809?v=3","gravatar_id":"","url":"https://api.github.com/users/vadimcn","html_url":"https://github.com/vadimcn","followers_url":"https://api.github.com/users/vadimcn/followers","following_url":"https://api.github.com/users/vadimcn/following{/other_user}","gists_url":"https://api.github.com/users/vadimcn/gists{/gist_id}","starred_url":"https://api.github.com/users/vadimcn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vadimcn/subscriptions","organizations_url":"https://api.github.com/users/vadimcn/orgs","repos_url":"https://api.github.com/users/vadimcn/repos","events_url":"https://api.github.com/users/vadimcn/events{/privacy}","received_events_url":"https://api.github.com/users/vadimcn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-10-20T02:00:07Z","updated_at":"2015-10-23T05:09:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/29177","html_url":"https://github.com/rust-lang/rust/pull/29177","diff_url":"https://github.com/rust-lang/rust/pull/29177.diff","patch_url":"https://github.com/rust-lang/rust/pull/29177.patch"},"body":"Note: for now, this change only affects `-windows-gnu` builds.\r\n\r\nSo why was this `libgcc` dylib dependency needed in the first place?\r\nThe stack unwinder needs to know about locations of unwind tables of all the modules loaded in the current process.  The easiest portable way of achieving this is to have each module register itself with the unwinder when loaded into the process.  All modules compiled by GCC do this by calling the __register_frame_info() in their startup code (that's `crtbegin.o` and `crtend.o`, which are automatically linked into any gcc output).\r\nAnother important piece is that there should be only one copy of the unwinder (and thus unwind tables registry) in the process.  This pretty much means that the unwinder must be in a shared library (unless everything is statically linked). \r\n\r\nNow, Rust compiler tries very hard to make sure that any given Rust crate appears in the final output just once.   So if we link the unwinder statically to one of Rust's crates, everything should be fine.\r\n\r\nUnfortunately, GCC startup objects are built under assumption that `libgcc` is the one true place for the unwind info registry, so I couldn't find any better way than to replace them.  So out go `crtbegin`/`crtend`, in come `rsbegin`/`rsend`!  \r\n\r\nA side benefit of this change is that rustc is now more in control of the command line that goes to the linker, so we could stop using `gcc` as the linker driver and just invoke `ld` directly.\r\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/150473545","html_url":"https://github.com/rust-lang/rust/pull/29177#issuecomment-150473545","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/29177","id":150473545,"user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T05:09:37Z","updated_at":"2015-10-23T05:09:37Z","body":"cc @brson, just wanna give you a heads up about the we-are-building-our-own-object-files strategy. It seems fine to me but figured you may want to know!"}}