Commit 666e9df170

Jakub Konka <kubkon@jakubkonka.com>
2023-10-17 11:30:56
elf: ensure we build with -fPIE when testing init array order
1 parent 43fb74f
Changed files (1)
test
link
test/link/elf.zig
@@ -1362,6 +1362,11 @@ fn testInitArrayOrder(b: *Build, opts: Options) *Step {
     exe.addObject(g_o);
     exe.addObject(h_o);
 
+    if (opts.target.isGnuLibC()) {
+        // TODO I think we need to clarify our use of `-fPIC -fPIE` flags for different targets
+        exe.pie = true;
+    }
+
     const run = addRunArtifact(exe);
     run.expectStdOutEqual("21348756");
     test_step.dependOn(&run.step);