From ac546f56eb2b9fd50a69f1d0bda3d0d070b76f52 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Thu, 6 May 2021 19:03:42 +0200 Subject: stage2: Allow building musl/glibc in thumb mode --- src/Compilation.zig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index 46fb5e575d..87d4c4c41e 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2903,7 +2903,17 @@ fn detectLibCIncludeDirs( if (target_util.canBuildLibC(target)) { const generic_name = target_util.libCGenericName(target); // Some architectures are handled by the same set of headers. - const arch_name = if (target.abi.isMusl()) target_util.archMuslName(target.cpu.arch) else @tagName(target.cpu.arch); + const arch_name = if (target.abi.isMusl()) + target_util.archMuslName(target.cpu.arch) + else if (target.cpu.arch.isThumb()) + // ARM headers are valid for Thumb too. + switch (target.cpu.arch) { + .thumb => "arm", + .thumbeb => "armeb", + else => unreachable, + } + else + @tagName(target.cpu.arch); const os_name = @tagName(target.os.tag); // Musl's headers are ABI-agnostic and so they all have the "musl" ABI name. const abi_name = if (target.abi.isMusl()) "musl" else @tagName(target.abi); -- cgit v1.2.3