From 565ff99c31d4f89376b20bd7e3c9cf0bfb8c7810 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Tue, 21 Apr 2020 15:20:10 +0200 Subject: [PATCH] gba: always use ARM mode instead of Thumb mode This results in bigger code size, but it works around a bug in the linker. The issue starts with the problem that libraries (picolibc, compiler-rt) were compiled as ARM and the rest as Thumb. This causes some blx instructions to be inserted by the linker to call into these libraries. Ideally we should fix the libraries to use Thumb mode instead, but that requires some more extensive changes (including fixes to compiler-rt) and it's just way easier to use ARM mode everywhere. --- targets/gameboy-advance.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/gameboy-advance.json b/targets/gameboy-advance.json index 711f9a8375..4bf1247482 100644 --- a/targets/gameboy-advance.json +++ b/targets/gameboy-advance.json @@ -1,5 +1,5 @@ { - "llvm-target": "thumb4-none-eabi", + "llvm-target": "arm4-none-eabi", "cpu": "arm7tdmi", "build-tags": ["gameboyadvance", "arm7tdmi", "baremetal", "linux", "arm"], "goos": "linux", @@ -10,7 +10,7 @@ "libc": "picolibc", "cflags": [ "-g", - "--target=thumb4-none-eabi", + "--target=arm4-none-eabi", "-mcpu=arm7tdmi", "-Oz", "-Werror",