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

Consider adding the option to building openssl #580

Closed
malbarbo opened this issue Feb 13, 2017 · 11 comments
Closed

Consider adding the option to building openssl #580

malbarbo opened this issue Feb 13, 2017 · 11 comments

Comments

@malbarbo
Copy link

Many people have to cross compile openssl many times...

curl-sys is capable of building libcurl.

If rust-openssl was capable of building openssl, this would simplify cross compile crates that depends on rust-openssl. For example, cargo and rustup build system would be simplified (cargo was an option to build openssl, the ci of rustup is similar)

@sfackler
Copy link
Owner

This has come up before, and I am not comfortable being on the hook for rolling out emergency releases immediately after some critical CVEs get fixed in OpenSSL.

@malbarbo
Copy link
Author

malbarbo commented Feb 13, 2017

What if the user provides a tar.gz with the openssl source? That way, is the responsibility of the user to choose a release.

Note that building openssl does not mean static linking, the user can still choose dynamic linking.

The main idea is to facilitate cross compiling, if the user chooses static link, that their responsibility, even if using the openssl from the system.

@sfackler
Copy link
Owner

That seems like it could be workable.

@sfackler
Copy link
Owner

One "fun" bit of this would be the need to translate from rust target specs to openssl Configure's target spec and manage CC.

@malbarbo
Copy link
Author

Take a look at the approach that cargo and rustup has taken.

@sfackler
Copy link
Owner

@alexcrichton I'm thinking compiler detection will probably work the same way gcc-rs does. Could you give a quick overview of how the logic there works?

@sfackler
Copy link
Owner

I'm not sure it's a good idea to allow dynamic linking with this setup - compile time settings can break ABI compatibility. If we build an OpenSSL and dynamically link with the intention of using the local copy on the target, there is a decent chance things will go wrong in ways that I don't think can be detected ahead of time.

@alexcrichton
Copy link
Collaborator

FWIW I'm adding logic to rustbuild to build OpenSSL, so if you'd like to copy/crib off that you're more than welcome :)

@jwilm
Copy link
Contributor

jwilm commented Feb 22, 2017

We (OneSignal) would love to see this supported. Our build system has added complexity to support building and statically linking libssl/libcrypto.

Providing our own tarball would be totally fine. Would this be accomplished through a build script?

@sfackler
Copy link
Owner

sfackler commented Feb 22, 2017

It'd just be a check in the openssl-sys build script for OPENSSL_SRC (or whatever it's called) which would cause it skip the normal search step, untar that, build it and statically link to it.

sfackler added a commit that referenced this issue Feb 23, 2017
@sfackler
Copy link
Owner

Take a look at #589. It's still a bit hacky - Windows isn't supported and cross compilation requires you to set CC, LD and RANLIB yourself, but it seems to work.

alexcrichton added a commit to alexcrichton/rust-openssl that referenced this issue Jul 27, 2018
This is a revival of sfackler#684 to see if I can help push it across the finish line!

Closes sfackler#580
alexcrichton added a commit to alexcrichton/rust-openssl that referenced this issue Jul 30, 2018
This is a revival of sfackler#684 to see if I can help push it across the finish line!

Closes sfackler#580
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

No branches or pull requests

4 participants