Skip to content

Commit 2328170

Browse files
committed
test: Enable long calls for all thumb/thumbeb module tests.
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 #20271, for example.
1 parent fc28a71 commit 2328170

File tree

1 file changed

+23
-86
lines changed

1 file changed

+23
-86
lines changed

test/tests.zig

+23-86
Original file line numberDiff line numberDiff line change
@@ -425,54 +425,30 @@ const test_targets = blk: {
425425
.link_libc = true,
426426
},
427427

428+
// Calls are normally lowered to branch instructions that only support +/- 16 MB range when
429+
// targeting Thumb. This easily becomes insufficient for our test binaries, so use long
430+
// calls to avoid out-of-range relocations.
428431
.{
429-
.target = .{
430-
.cpu_arch = .thumb,
431-
.os_tag = .linux,
432-
.abi = .eabi,
433-
},
434-
},
435-
.{
436-
.target = .{
437-
.cpu_arch = .thumb,
438-
.os_tag = .linux,
439-
.abi = .eabihf,
440-
},
441-
},
442-
.{
443-
.target = .{
444-
.cpu_arch = .thumb,
445-
.os_tag = .linux,
446-
.abi = .musleabi,
447-
},
448-
.link_libc = true,
449-
.skip_modules = &.{"std"},
432+
.target = std.Target.Query.parse(.{
433+
.arch_os_abi = "thumb-linux-eabi",
434+
.cpu_features = "baseline+long_calls",
435+
}) catch unreachable,
436+
.pic = false, // Long calls don't work with PIC.
450437
},
451438
.{
452-
.target = .{
453-
.cpu_arch = .thumb,
454-
.os_tag = .linux,
455-
.abi = .musleabihf,
456-
},
457-
.link_libc = true,
458-
.skip_modules = &.{"std"},
439+
.target = std.Target.Query.parse(.{
440+
.arch_os_abi = "thumb-linux-eabihf",
441+
.cpu_features = "baseline+long_calls",
442+
}) catch unreachable,
443+
.pic = false, // Long calls don't work with PIC.
459444
},
460-
// Calls are normally lowered to branch instructions that only support +/- 16 MB range when
461-
// targeting Thumb. This is not sufficient for the std test binary linked statically with
462-
// musl, so use long calls to avoid out-of-range relocations.
463445
.{
464446
.target = std.Target.Query.parse(.{
465447
.arch_os_abi = "thumb-linux-musleabi",
466448
.cpu_features = "baseline+long_calls",
467449
}) catch unreachable,
468450
.link_libc = true,
469451
.pic = false, // Long calls don't work with PIC.
470-
.skip_modules = &.{
471-
"behavior",
472-
"c-import",
473-
"compiler-rt",
474-
"universal-libc",
475-
},
476452
},
477453
.{
478454
.target = std.Target.Query.parse(.{
@@ -481,62 +457,29 @@ const test_targets = blk: {
481457
}) catch unreachable,
482458
.link_libc = true,
483459
.pic = false, // Long calls don't work with PIC.
484-
.skip_modules = &.{
485-
"behavior",
486-
"c-import",
487-
"compiler-rt",
488-
"universal-libc",
489-
},
490460
},
491461

492462
.{
493-
.target = .{
494-
.cpu_arch = .thumbeb,
495-
.os_tag = .linux,
496-
.abi = .eabi,
497-
},
498-
},
499-
.{
500-
.target = .{
501-
.cpu_arch = .thumbeb,
502-
.os_tag = .linux,
503-
.abi = .eabihf,
504-
},
505-
},
506-
.{
507-
.target = .{
508-
.cpu_arch = .thumbeb,
509-
.os_tag = .linux,
510-
.abi = .musleabi,
511-
},
512-
.link_libc = true,
513-
.skip_modules = &.{"std"},
463+
.target = std.Target.Query.parse(.{
464+
.arch_os_abi = "thumbeb-linux-eabi",
465+
.cpu_features = "baseline+long_calls",
466+
}) catch unreachable,
467+
.pic = false, // Long calls don't work with PIC.
514468
},
515469
.{
516-
.target = .{
517-
.cpu_arch = .thumbeb,
518-
.os_tag = .linux,
519-
.abi = .musleabihf,
520-
},
521-
.link_libc = true,
522-
.skip_modules = &.{"std"},
470+
.target = std.Target.Query.parse(.{
471+
.arch_os_abi = "thumbeb-linux-eabihf",
472+
.cpu_features = "baseline+long_calls",
473+
}) catch unreachable,
474+
.pic = false, // Long calls don't work with PIC.
523475
},
524-
// Calls are normally lowered to branch instructions that only support +/- 16 MB range when
525-
// targeting Thumb. This is not sufficient for the std test binary linked statically with
526-
// musl, so use long calls to avoid out-of-range relocations.
527476
.{
528477
.target = std.Target.Query.parse(.{
529478
.arch_os_abi = "thumbeb-linux-musleabi",
530479
.cpu_features = "baseline+long_calls",
531480
}) catch unreachable,
532481
.link_libc = true,
533482
.pic = false, // Long calls don't work with PIC.
534-
.skip_modules = &.{
535-
"behavior",
536-
"c-import",
537-
"compiler-rt",
538-
"universal-libc",
539-
},
540483
},
541484
.{
542485
.target = std.Target.Query.parse(.{
@@ -545,12 +488,6 @@ const test_targets = blk: {
545488
}) catch unreachable,
546489
.link_libc = true,
547490
.pic = false, // Long calls don't work with PIC.
548-
.skip_modules = &.{
549-
"behavior",
550-
"c-import",
551-
"compiler-rt",
552-
"universal-libc",
553-
},
554491
},
555492

556493
.{

0 commit comments

Comments
 (0)