Skip to content

Commit

Permalink
Fix support for EagerBinding/RelocationHardening properties in Zig 0.…
Browse files Browse the repository at this point in the history
…10.0.

Closes #35.
  • Loading branch information
alexrp committed Nov 8, 2022
1 parent fe1d4f4 commit a2bfbda
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sdk/ZigCompile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -560,11 +560,11 @@ void TryAppendWarningSwitch(string name)
foreach (var header in PreludeHeaders)
builder.AppendSwitchIfNotNull("-include ", header);

if (EagerBinding)
builder.AppendSwitch(isZig ? "-z now" : "-Wl,-z,now");
if (!EagerBinding)
builder.AppendSwitch(isZig ? "-z lazy" : "-Wl,-z,lazy");

if (RelocationHardening)
builder.AppendSwitch(isZig ? "-z relro" : "-Wl,-z,relro");
if (!RelocationHardening)
builder.AppendSwitch(isZig ? "-z norelro" : "-Wl,-z,norelro");

builder.AppendSwitch(isZig ? "-z origin" : "-Wl,-z,origin");
builder.AppendSwitchIfNotNull(isZig ? "-rpath " : "-Wl,-rpath,", "$ORIGIN");
Expand Down

0 comments on commit a2bfbda

Please sign in to comment.