authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-06-22 10:40:10+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-06-22 10:40:10+02:00
log211de9b63b53b7252a6321074ace9018cf392db2
tree98f5d139b57581b9d5737931d920ba78eca225f0
parent23a63f4ce445d26d7fc577eecc6c3f5ca129a007

link-tests: fix dumping of LOAD_DYLIB: name instead of path field


3 files changed, 9 insertions(+), 5 deletions(-)

lib/std/build/CheckObjectStep.zig+1-1
...@@ -320,7 +320,7 @@ const MachODumper = struct {...@@ -320,7 +320,7 @@ const MachODumper = struct {
320 const dylib = lc.dylib.inner.dylib;320 const dylib = lc.dylib.inner.dylib;
321 try writer.writeByte('\n');321 try writer.writeByte('\n');
322 try writer.print(322 try writer.print(
323 \\path {s}323 \\name {s}
324 \\timestamp {d}324 \\timestamp {d}
325 \\current version {x}325 \\current version {x}
326 \\compatibility version {x}326 \\compatibility version {x}
test/link/macho/dylib/build.zig+2-2
...@@ -15,7 +15,7 @@ pub fn build(b: *Builder) void {...@@ -15,7 +15,7 @@ pub fn build(b: *Builder) void {
1515
16 const check_dylib = dylib.checkObject(.macho);16 const check_dylib = dylib.checkObject(.macho);
17 check_dylib.check("cmd ID_DYLIB");17 check_dylib.check("cmd ID_DYLIB");
18 check_dylib.checkNext("path @rpath/liba.dylib");18 check_dylib.checkNext("name @rpath/liba.dylib");
19 check_dylib.checkNext("timestamp 2");19 check_dylib.checkNext("timestamp 2");
20 check_dylib.checkNext("current version 10000");20 check_dylib.checkNext("current version 10000");
21 check_dylib.checkNext("compatibility version 10000");21 check_dylib.checkNext("compatibility version 10000");
...@@ -32,7 +32,7 @@ pub fn build(b: *Builder) void {...@@ -32,7 +32,7 @@ pub fn build(b: *Builder) void {
3232
33 const check_exe = exe.checkObject(.macho);33 const check_exe = exe.checkObject(.macho);
34 check_exe.check("cmd LOAD_DYLIB");34 check_exe.check("cmd LOAD_DYLIB");
35 check_exe.checkNext("path @rpath/liba.dylib");35 check_exe.checkNext("name @rpath/liba.dylib");
36 check_exe.checkNext("timestamp 2");36 check_exe.checkNext("timestamp 2");
37 check_exe.checkNext("current version 10000");37 check_exe.checkNext("current version 10000");
38 check_exe.checkNext("compatibility version 10000");38 check_exe.checkNext("compatibility version 10000");
test/link/macho/frameworks/build.zig+6-2
...@@ -11,10 +11,14 @@ pub fn build(b: *Builder) void {...@@ -11,10 +11,14 @@ pub fn build(b: *Builder) void {
11 exe.addCSourceFile("main.c", &[0][]const u8{});11 exe.addCSourceFile("main.c", &[0][]const u8{});
12 exe.setBuildMode(mode);12 exe.setBuildMode(mode);
13 exe.linkLibC();13 exe.linkLibC();
14 // TODO when we figure out how to ship framework stubs for cross-compilation,
15 // populate paths to the sysroot here.
16 exe.linkFramework("Cocoa");14 exe.linkFramework("Cocoa");
1715
16 const check = exe.checkObject(.macho);
17 check.check("cmd LOAD_DYLIB");
18 check.checkNext("name /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa");
19
20 test_step.dependOn(&check.step);
21
18 const run_cmd = exe.run();22 const run_cmd = exe.run();
19 test_step.dependOn(&run_cmd.step);23 test_step.dependOn(&run_cmd.step);
20}24}