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

Add pie build mode to all binary builds #2997

Merged
merged 1 commit into from
May 7, 2024

Conversation

xiaokangwang
Copy link
Contributor

This pull request adds pie build mode support to v2ray binaries for binary hardening.

@database64128
Copy link
Contributor

https://github.com/golang/go/blob/20130cc36a17ba131b80cc8674f1ef8d002e9dbe/src/internal/platform/supported.go#L234-L252

PIE was made default on darwin/amd64 in Go 1.22, leaving Linux as the only remaining popular platform where PIE isn't the default build mode.

I remember reading through an issue where changing the default build mode on Linux to PIE was discussed, but I can't seem to find it right now. I think it's best that we focus on what we are good at, and leave this up for the Go maintainers to decide.

@xiaokangwang
Copy link
Contributor Author

https://github.com/golang/go/blob/20130cc36a17ba131b80cc8674f1ef8d002e9dbe/src/internal/platform/supported.go#L234-L252

PIE was made default on darwin/amd64 in Go 1.22, leaving Linux as the only remaining popular platform where PIE isn't the default build mode.

I remember reading through an issue where changing the default build mode on Linux to PIE was discussed, but I can't seem to find it right now. I think it's best that we focus on what we are good at, and leave this up for the Go maintainers to decide.

Are you aware the reason why Linux is not PIE by default? The reason I found is that Go developers wish to make sure Go binary is easily debuggable, which does not apply to us in this case.

@xiaokangwang
Copy link
Contributor Author

I believe the most credible reason pie is not enabled on Linus by default is because it impacts debug support of application, and this is not relevant in our case.

@xiaokangwang xiaokangwang merged commit 8191faa into v2fly:master May 7, 2024
35 checks passed
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.

None yet

2 participants