commit 666e9df170cb0f492c73fcb566a8cce869895f9b (tree)
parent 43fb74f81a8cdefa447c949ff761bfce3aa8aa91
Author: Jakub Konka <kubkon@jakubkonka.com>
Date: Tue, 17 Oct 2023 11:30:56 +0200
elf: ensure we build with -fPIE when testing init array order
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/test/link/elf.zig b/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);