Skip to content

Build position independent Linux binaries. #11272

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

Conversation

gmilos
Copy link
Contributor

@gmilos gmilos commented Jul 31, 2017

This PR fixes Linux executable to be position independent. It does so by adding -pie flag to clang++ linker invocation.

Resolves SR-5405.

@alblue
Copy link
Contributor

alblue commented Jul 31, 2017

@swift-ci please smoke test

@jrose-apple
Copy link
Contributor

Do we need to compile the stdlib with -pie as well?

@gmilos
Copy link
Contributor Author

gmilos commented Aug 1, 2017

@jrose-apple I'm assuming you meant -fPIC (-pie applies to executables). Standard library is compiled -fPIC already. In fact I'd be surprised if Linux allowed non -fPIC .so-s at all.

@jrose-apple
Copy link
Contributor

Ah, I just straight-up forgot how these flags work. If we're already doing PIC everywhere then okay!

@swift-ci Please smoke test

@alblue
Copy link
Contributor

alblue commented Aug 2, 2017

@jrose-apple @jckarter can this be merged?

@jckarter
Copy link
Contributor

jckarter commented Aug 2, 2017

LGTM, thanks!

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.

6 participants