Skip to content

Remove C++ dependencies #11121

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

Merged
merged 1 commit into from
Dec 24, 2013
Merged

Remove C++ dependencies #11121

merged 1 commit into from
Dec 24, 2013

Conversation

vadimcn
Copy link
Contributor

@vadimcn vadimcn commented Dec 22, 2013

This PR removes Rust's dependency on C++ for exception handling. Instead, it will use the unwind library API directly.

closes #10469

@alexcrichton
Copy link
Member

The only thing blocking me from r+'ing this PR is the forceful addition of -shared-libgcc to the command line. See my comments on the code for why.

Other than that though, this is again truly amazing! Fantastic job with explaining everything in the comments, you are a hero!

@vadimcn
Copy link
Contributor Author

vadimcn commented Dec 23, 2013

@acrichton: PR updated. BTW, that -shared-libgcc switch may be overridden by --link-args "-static-libgcc"

@vadimcn
Copy link
Contributor Author

vadimcn commented Dec 23, 2013

thanks!

@alexcrichton
Copy link
Member

I think this just needs to compile the .ll file with -relocation-model=pic

@vadimcn
Copy link
Contributor Author

vadimcn commented Dec 23, 2013

Ok, done.

bors added a commit that referenced this pull request Dec 23, 2013
This PR removes Rust's dependency on C++ for exception handling. Instead, it will use the unwind library API directly.

closes #10469
@alexcrichton
Copy link
Member

OSX has libgcc_s apparently instead of libgcc.

@vadimcn
Copy link
Contributor Author

vadimcn commented Dec 23, 2013

Should I get rid of #[link(name="gcc")] then?

@brson
Copy link
Contributor

brson commented Dec 23, 2013

I would like to better understand our GPL obligations after this patch. In what scenario will we be statically linking libstcxx? More than just for snapshots now? I suspect that we need to leave in the previous language about the GPL re libstcxx in the snapshots and furthermore may have new obligations depending on where else were doing static linking.

@vadimcn
Copy link
Contributor Author

vadimcn commented Dec 23, 2013

@brson: I've removed static linking from this PR on Alex's request. But GPL with exception does allow static linking without any obligations (their FAQ)

@alexcrichton
Copy link
Member

I believe that this will need something along the lines of:

// explain that this is what provides the gcc_personality function and libunwind interface in this comment.
#[cfg(target_os = "macos")]
#[link(name = "gcc_s")]
extern {}
#[cfg(not(target_os = "macos"))]
#[link(name = "gcc")]
extern {}

Apparently both ubuntu and freebsd have both libgcc and libgcc_s, unsure of what the difference is.

@brson
Copy link
Contributor

brson commented Dec 24, 2013

@vadimcn I do see that the GPL runtime exception allows distribution via static linking, but I'm assuming that if we distribute the statically linked binary then we have to include the license. That makes me think we need to leave the language in the "third-party" readme about the library.

@vadimcn
Copy link
Contributor Author

vadimcn commented Dec 24, 2013

hope this does it. r?

@alexcrichton
Copy link
Member

Can you squash these commits into one?

@vadimcn
Copy link
Contributor Author

vadimcn commented Dec 24, 2013

Done.

bors added a commit that referenced this pull request Dec 24, 2013
This PR removes Rust's dependency on C++ for exception handling. Instead, it will use the unwind library API directly.

closes #10469
@bors bors closed this Dec 24, 2013
@bors bors merged commit e3b3715 into rust-lang:master Dec 24, 2013
@thestinger thestinger mentioned this pull request Feb 14, 2014
4 tasks
@vadimcn vadimcn deleted the no-c++2 branch March 1, 2015 08:00
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 14, 2023
…lip1995

Pass correct substs to `implements_trait` in `incorrect_impls`

`Copy<T>` does in fact not exist. The substs on the trait_ref contain the `Self` type of the impl as the first parameter, so passing that to `implements_trait`, which then nicely prepends the `Self` type for us does not end will.

fixes  rust-lang#11121

The assertions requires debug assertions inside rustc, which is probably why it didn't fire here. I tested the change locally in rust-lang/rust and it did not ICE anymore.

cc `@xFrednet` `@Centri3`

changelog: [`incorrect_impls`]: fix confusion about generic parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rust should have an optional dependency on C++
4 participants