Skip to content

Commit 565ff99

Browse files
aykevldeadprogram
authored andcommitted
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.
1 parent ceeba52 commit 565ff99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

targets/gameboy-advance.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"llvm-target": "thumb4-none-eabi",
2+
"llvm-target": "arm4-none-eabi",
33
"cpu": "arm7tdmi",
44
"build-tags": ["gameboyadvance", "arm7tdmi", "baremetal", "linux", "arm"],
55
"goos": "linux",
@@ -10,7 +10,7 @@
1010
"libc": "picolibc",
1111
"cflags": [
1212
"-g",
13-
"--target=thumb4-none-eabi",
13+
"--target=arm4-none-eabi",
1414
"-mcpu=arm7tdmi",
1515
"-Oz",
1616
"-Werror",

0 commit comments

Comments
 (0)