authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-10-17 11:30:56+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-10-17 11:30:56+02:00
log666e9df170cb0f492c73fcb566a8cce869895f9b
treea299b951a063d36629d169146bb1f9ff6274d8a1
parent43fb74f81a8cdefa447c949ff761bfce3aa8aa91

elf: ensure we build with -fPIE when testing init array order


1 files changed, 5 insertions(+), 0 deletions(-)

test/link/elf.zig+5
...@@ -1362,6 +1362,11 @@ fn testInitArrayOrder(b: *Build, opts: Options) *Step {...@@ -1362,6 +1362,11 @@ fn testInitArrayOrder(b: *Build, opts: Options) *Step {
1362 exe.addObject(g_o);1362 exe.addObject(g_o);
1363 exe.addObject(h_o);1363 exe.addObject(h_o);
13641364
1365 if (opts.target.isGnuLibC()) {
1366 // TODO I think we need to clarify our use of `-fPIC -fPIE` flags for different targets
1367 exe.pie = true;
1368 }
1369
1365 const run = addRunArtifact(exe);1370 const run = addRunArtifact(exe);
1366 run.expectStdOutEqual("21348756");1371 run.expectStdOutEqual("21348756");
1367 test_step.dependOn(&run.step);1372 test_step.dependOn(&run.step);