Skip to content

Commit

Permalink
test: Enable long calls for all thumb/thumbeb module tests.
Browse files Browse the repository at this point in the history
The relocation range issues will happen eventually as we add more code to the
standard library and test suites, so we may as well just deal with this now.
@MasonRemaley ran into this in ziglang#20271, for example.
  • Loading branch information
alexrp authored and Fri3dNstuff committed Jan 27, 2025
1 parent 195c812 commit 347bc8b
Showing 1 changed file with 23 additions and 86 deletions.
109 changes: 23 additions & 86 deletions test/tests.zig
Original file line number Diff line number Diff line change
Expand Up @@ -425,54 +425,30 @@ const test_targets = blk: {
.link_libc = true,
},

// Calls are normally lowered to branch instructions that only support +/- 16 MB range when
// targeting Thumb. This easily becomes insufficient for our test binaries, so use long
// calls to avoid out-of-range relocations.
.{
.target = .{
.cpu_arch = .thumb,
.os_tag = .linux,
.abi = .eabi,
},
},
.{
.target = .{
.cpu_arch = .thumb,
.os_tag = .linux,
.abi = .eabihf,
},
},
.{
.target = .{
.cpu_arch = .thumb,
.os_tag = .linux,
.abi = .musleabi,
},
.link_libc = true,
.skip_modules = &.{"std"},
.target = std.Target.Query.parse(.{
.arch_os_abi = "thumb-linux-eabi",
.cpu_features = "baseline+long_calls",
}) catch unreachable,
.pic = false, // Long calls don't work with PIC.
},
.{
.target = .{
.cpu_arch = .thumb,
.os_tag = .linux,
.abi = .musleabihf,
},
.link_libc = true,
.skip_modules = &.{"std"},
.target = std.Target.Query.parse(.{
.arch_os_abi = "thumb-linux-eabihf",
.cpu_features = "baseline+long_calls",
}) catch unreachable,
.pic = false, // Long calls don't work with PIC.
},
// Calls are normally lowered to branch instructions that only support +/- 16 MB range when
// targeting Thumb. This is not sufficient for the std test binary linked statically with
// musl, so use long calls to avoid out-of-range relocations.
.{
.target = std.Target.Query.parse(.{
.arch_os_abi = "thumb-linux-musleabi",
.cpu_features = "baseline+long_calls",
}) catch unreachable,
.link_libc = true,
.pic = false, // Long calls don't work with PIC.
.skip_modules = &.{
"behavior",
"c-import",
"compiler-rt",
"universal-libc",
},
},
.{
.target = std.Target.Query.parse(.{
Expand All @@ -481,62 +457,29 @@ const test_targets = blk: {
}) catch unreachable,
.link_libc = true,
.pic = false, // Long calls don't work with PIC.
.skip_modules = &.{
"behavior",
"c-import",
"compiler-rt",
"universal-libc",
},
},

.{
.target = .{
.cpu_arch = .thumbeb,
.os_tag = .linux,
.abi = .eabi,
},
},
.{
.target = .{
.cpu_arch = .thumbeb,
.os_tag = .linux,
.abi = .eabihf,
},
},
.{
.target = .{
.cpu_arch = .thumbeb,
.os_tag = .linux,
.abi = .musleabi,
},
.link_libc = true,
.skip_modules = &.{"std"},
.target = std.Target.Query.parse(.{
.arch_os_abi = "thumbeb-linux-eabi",
.cpu_features = "baseline+long_calls",
}) catch unreachable,
.pic = false, // Long calls don't work with PIC.
},
.{
.target = .{
.cpu_arch = .thumbeb,
.os_tag = .linux,
.abi = .musleabihf,
},
.link_libc = true,
.skip_modules = &.{"std"},
.target = std.Target.Query.parse(.{
.arch_os_abi = "thumbeb-linux-eabihf",
.cpu_features = "baseline+long_calls",
}) catch unreachable,
.pic = false, // Long calls don't work with PIC.
},
// Calls are normally lowered to branch instructions that only support +/- 16 MB range when
// targeting Thumb. This is not sufficient for the std test binary linked statically with
// musl, so use long calls to avoid out-of-range relocations.
.{
.target = std.Target.Query.parse(.{
.arch_os_abi = "thumbeb-linux-musleabi",
.cpu_features = "baseline+long_calls",
}) catch unreachable,
.link_libc = true,
.pic = false, // Long calls don't work with PIC.
.skip_modules = &.{
"behavior",
"c-import",
"compiler-rt",
"universal-libc",
},
},
.{
.target = std.Target.Query.parse(.{
Expand All @@ -545,12 +488,6 @@ const test_targets = blk: {
}) catch unreachable,
.link_libc = true,
.pic = false, // Long calls don't work with PIC.
.skip_modules = &.{
"behavior",
"c-import",
"compiler-rt",
"universal-libc",
},
},

.{
Expand Down

0 comments on commit 347bc8b

Please sign in to comment.