| ... | @@ -10,6 +10,7 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step { | ... | @@ -10,6 +10,7 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step { |
| 10 | | 10 | |
| 11 | macho_step.dependOn(testDeadStrip(b, .{ .target = default_target })); | 11 | macho_step.dependOn(testDeadStrip(b, .{ .target = default_target })); |
| 12 | macho_step.dependOn(testEntryPointDylib(b, .{ .target = default_target })); | 12 | macho_step.dependOn(testEntryPointDylib(b, .{ .target = default_target })); |
| | 13 | macho_step.dependOn(testLargeBss(b, .{ .target = default_target })); |
| 13 | macho_step.dependOn(testMhExecuteHeader(b, .{ .target = default_target })); | 14 | macho_step.dependOn(testMhExecuteHeader(b, .{ .target = default_target })); |
| 14 | macho_step.dependOn(testSectionBoundarySymbols(b, .{ .target = default_target })); | 15 | macho_step.dependOn(testSectionBoundarySymbols(b, .{ .target = default_target })); |
| 15 | macho_step.dependOn(testSegmentBoundarySymbols(b, .{ .target = default_target })); | 16 | macho_step.dependOn(testSegmentBoundarySymbols(b, .{ .target = default_target })); |
| ... | @@ -162,6 +163,27 @@ fn testEntryPointDylib(b: *Build, opts: Options) *Step { | ... | @@ -162,6 +163,27 @@ fn testEntryPointDylib(b: *Build, opts: Options) *Step { |
| 162 | return test_step; | 163 | return test_step; |
| 163 | } | 164 | } |
| 164 | | 165 | |
| | 166 | fn testLargeBss(b: *Build, opts: Options) *Step { |
| | 167 | const test_step = addTestStep(b, "macho-large-bss", opts); |
| | 168 | |
| | 169 | // TODO this test used use a 4GB zerofill section but this actually fails and causes every |
| | 170 | // linker I tried misbehave in different ways. This only happened on arm64. I thought that |
| | 171 | // maybe S_GB_ZEROFILL section is an answer to this but it doesn't seem supported by dyld |
| | 172 | // anymore. When I get some free time I will re-investigate this. |
| | 173 | const exe = addExecutable(b, opts, .{ .name = "main", .c_source_bytes = |
| | 174 | \\char arr[0x1000000]; |
| | 175 | \\int main() { |
| | 176 | \\ return arr[2000]; |
| | 177 | \\} |
| | 178 | }); |
| | 179 | |
| | 180 | const run = addRunArtifact(exe); |
| | 181 | run.expectExitCode(0); |
| | 182 | test_step.dependOn(&run.step); |
| | 183 | |
| | 184 | return test_step; |
| | 185 | } |
| | 186 | |
| 165 | fn testMhExecuteHeader(b: *Build, opts: Options) *Step { | 187 | fn testMhExecuteHeader(b: *Build, opts: Options) *Step { |
| 166 | const test_step = addTestStep(b, "macho-mh-execute-header", opts); | 188 | const test_step = addTestStep(b, "macho-mh-execute-header", opts); |
| 167 | | 189 | |