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

This commit is contained in:
Jakub Konka 2023-10-17 11:30:56 +02:00
parent 43fb74f81a
commit 666e9df170

View File

@ -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);