| ... | ... | @@ -3,21 +3,24 @@ pub fn build(b: *Build) void { |
| 3 | 3 | b.default_step = test_step; |
| 4 | 4 | |
| 5 | 5 | if (b.graph.host.result.cpu.arch == .x86_64 and b.graph.host.result.os.tag == .linux) { |
| 6 | | addOne(b, test_step, b.graph.host, false, .static, false, "elf2-hello-native-selfhosted-static"); |
| 7 | | addOne(b, test_step, b.graph.host, false, .dynamic, false, "elf2-hello-native-selfhosted-dynamic"); |
| 8 | | addOne(b, test_step, b.graph.host, false, .static, true, "elf2-hello-native-selfhosted-static-pie"); |
| 9 | | addOne(b, test_step, b.graph.host, false, .dynamic, true, "elf2-hello-native-selfhosted-dynamic-pie"); |
| 10 | | addOne(b, test_step, b.graph.host, true, .static, false, "elf2-hello-native-llvm-static"); |
| 11 | | addOne(b, test_step, b.graph.host, true, .dynamic, false, "elf2-hello-native-llvm-dynamic"); |
| 6 | addOne(b, test_step, b.graph.host, false, .static, false, false, "elf2-hello-native-selfhosted-static"); |
| 7 | addOne(b, test_step, b.graph.host, false, .dynamic, false, false, "elf2-hello-native-selfhosted-dynamic"); |
| 8 | addOne(b, test_step, b.graph.host, false, .static, true, false, "elf2-hello-native-selfhosted-static-pie"); |
| 9 | addOne(b, test_step, b.graph.host, false, .dynamic, true, false, "elf2-hello-native-selfhosted-dynamic-pie"); |
| 10 | addOne(b, test_step, b.graph.host, true, .static, false, false, "elf2-hello-native-llvm-static"); |
| 11 | addOne(b, test_step, b.graph.host, true, .dynamic, false, false, "elf2-hello-native-llvm-dynamic"); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | const x86_64_linux_target: Build.ResolvedTarget = b.resolveTargetQuery(.{ |
| 15 | 15 | .cpu_arch = .x86_64, |
| 16 | 16 | .os_tag = .linux, |
| 17 | 17 | }); |
| 18 | | addOne(b, test_step, x86_64_linux_target, false, .static, false, "elf2-hello-selfhosted-static"); |
| 19 | | addOne(b, test_step, x86_64_linux_target, false, .static, true, "elf2-hello-selfhosted-static-pie"); |
| 20 | | addOne(b, test_step, x86_64_linux_target, true, .static, false, "elf2-hello-llvm-static"); |
| 18 | addOne(b, test_step, x86_64_linux_target, false, .static, false, false, "elf2-hello-selfhosted-static"); |
| 19 | addOne(b, test_step, x86_64_linux_target, false, .static, true, false, "elf2-hello-selfhosted-static-pie"); |
| 20 | addOne(b, test_step, x86_64_linux_target, true, .static, false, false, "elf2-hello-llvm-static"); |
| 21 | addOne(b, test_step, x86_64_linux_target, false, .static, false, true, "elf2-hello-selfhosted-static-libc"); |
| 22 | addOne(b, test_step, x86_64_linux_target, false, .static, true, true, "elf2-hello-selfhosted-static-libc-pie"); |
| 23 | addOne(b, test_step, x86_64_linux_target, true, .static, false, true, "elf2-hello-llvm-static-libc"); |
| 21 | 24 | } |
| 22 | 25 | |
| 23 | 26 | fn addOne( |
| ... | ... | @@ -27,13 +30,14 @@ fn addOne( |
| 27 | 30 | use_llvm: bool, |
| 28 | 31 | link_mode: std.lang.LinkMode, |
| 29 | 32 | pie: bool, |
| 33 | force_link_libc: bool, |
| 30 | 34 | name: []const u8, |
| 31 | 35 | ) void { |
| 32 | 36 | const mod = b.createModule(.{ |
| 33 | 37 | .root_source_file = b.path("hello.zig"), |
| 34 | 38 | .target = target, |
| 35 | 39 | .optimize = .debug, |
| 36 | | .link_libc = link_mode == .dynamic, |
| 40 | .link_libc = link_mode == .dynamic or force_link_libc, |
| 37 | 41 | }); |
| 38 | 42 | const exe = b.addExecutable(.{ |
| 39 | 43 | .name = name, |