Skip to content

fix: enable PIE in build.zig for main exe (#3213)#3216

Open
cschanhniem wants to merge 1 commit into
zigtools:masterfrom
cschanhniem:fix/pie-not-enabled
Open

fix: enable PIE in build.zig for main exe (#3213)#3216
cschanhniem wants to merge 1 commit into
zigtools:masterfrom
cschanhniem:fix/pie-not-enabled

Conversation

@cschanhniem

Copy link
Copy Markdown

Fixes #3213

The pie build option was declared (-Dpie=true) but never applied to the main zls executable struct. As a result, the produced binary was always a regular executable regardless of the pie option.

Added exe.pie = pie; so that zig build -Dpie=true correctly produces a position-independent executable.

The  build option was declared and used for modules but was not applied to the main  executable. Added  so that  produces a PIE binary.
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.

PIE not enabled?

1 participant