Compilation error
I followed the guide from https://devkitpro.org/wiki/devkitPro_pacman to set up the build environment. Then I cloned the repo and tried to compile romsel_aktheme, but got these errors. I tested on both Arch Linux and Windows MSYS2, the errors are exact the same.
meow@ZWWDESK MSYS /g/TWiLightMenu/romsel_aktheme
$ make dist
make[1]: Entering directory '/g/TWiLightMenu/universal/bootloader_menu'
make[2]: Entering directory '/g/TWiLightMenu/universal/bootloader_menu/build'
boot.c
In file included from C:/devkitPro/libnds/include/nds/ndstypes.h:36,
from G:/TWiLightMenu/universal/bootloader_menu/source/boot.c:36:
C:/devkitPro/libnds/include/nds/arm9/video.h: In function 'vramSetBankA':
C:/devkitPro/calico/include/calico/nds/arm9/vram.h:19:34: error: 'IO_VRAMCNT_A' undeclared (first use in this function); did you mean 'REG_VRAMCNT_A'?
19 | #define REG_VRAMCNT_A MK_REG(u8, IO_VRAMCNT_A)
| ^~~~~~~~~~~~
C:/devkitPro/calico/include/calico/types.h:137:57: note: in definition of macro 'MK_REG'
137 | #define MK_REG(_type,_off) (*(_type volatile*)(MM_IO + (_off)))
| ^~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:146:33: note: in expansion of macro 'REG_VRAMCNT_A'
146 | #define VRAM_A_CR REG_VRAMCNT_A
| ^~~~~~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:372:36: note: in expansion of macro 'VRAM_A_CR'
372 | void vramSetBankA(VRAM_A_TYPE a) { VRAM_A_CR = VRAM_ENABLE | a; }
| ^~~~~~~~~
C:/devkitPro/calico/include/calico/nds/arm9/vram.h:19:34: note: each undeclared identifier is reported only once for each function it appears in
19 | #define REG_VRAMCNT_A MK_REG(u8, IO_VRAMCNT_A)
| ^~~~~~~~~~~~
C:/devkitPro/calico/include/calico/types.h:137:57: note: in definition of macro 'MK_REG'
137 | #define MK_REG(_type,_off) (*(_type volatile*)(MM_IO + (_off)))
| ^~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:146:33: note: in expansion of macro 'REG_VRAMCNT_A'
146 | #define VRAM_A_CR REG_VRAMCNT_A
| ^~~~~~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:372:36: note: in expansion of macro 'VRAM_A_CR'
372 | void vramSetBankA(VRAM_A_TYPE a) { VRAM_A_CR = VRAM_ENABLE | a; }
| ^~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h: In function 'vramSetBankB':
C:/devkitPro/calico/include/calico/nds/arm9/vram.h:20:34: error: 'IO_VRAMCNT_B' undeclared (first use in this function); did you mean 'REG_VRAMCNT_B'?
20 | #define REG_VRAMCNT_B MK_REG(u8, IO_VRAMCNT_B)
| ^~~~~~~~~~~~
C:/devkitPro/calico/include/calico/types.h:137:57: note: in definition of macro 'MK_REG'
137 | #define MK_REG(_type,_off) (*(_type volatile*)(MM_IO + (_off)))
| ^~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:147:33: note: in expansion of macro 'REG_VRAMCNT_B'
147 | #define VRAM_B_CR REG_VRAMCNT_B
| ^~~~~~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:378:36: note: in expansion of macro 'VRAM_B_CR'
378 | void vramSetBankB(VRAM_B_TYPE b) { VRAM_B_CR = VRAM_ENABLE | b; }
| ^~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h: In function 'vramSetBankC':
C:/devkitPro/calico/include/calico/nds/arm9/vram.h:21:34: error: 'IO_VRAMCNT_C' undeclared (first use in this function); did you mean 'REG_VRAMCNT_C'?
21 | #define REG_VRAMCNT_C MK_REG(u8, IO_VRAMCNT_C)
| ^~~~~~~~~~~~
C:/devkitPro/calico/include/calico/types.h:137:57: note: in definition of macro 'MK_REG'
137 | #define MK_REG(_type,_off) (*(_type volatile*)(MM_IO + (_off)))
| ^~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:148:33: note: in expansion of macro 'REG_VRAMCNT_C'
148 | #define VRAM_C_CR REG_VRAMCNT_C
| ^~~~~~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:384:36: note: in expansion of macro 'VRAM_C_CR'
384 | void vramSetBankC(VRAM_C_TYPE c) { VRAM_C_CR = VRAM_ENABLE | c; }
| ^~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h: In function 'vramSetBankD':
C:/devkitPro/calico/include/calico/nds/arm9/vram.h:22:34: error: 'IO_VRAMCNT_D' undeclared (first use in this function); did you mean 'REG_VRAMCNT_D'?
22 | #define REG_VRAMCNT_D MK_REG(u8, IO_VRAMCNT_D)
| ^~~~~~~~~~~~
C:/devkitPro/calico/include/calico/types.h:137:57: note: in definition of macro 'MK_REG'
137 | #define MK_REG(_type,_off) (*(_type volatile*)(MM_IO + (_off)))
| ^~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:149:33: note: in expansion of macro 'REG_VRAMCNT_D'
149 | #define VRAM_D_CR REG_VRAMCNT_D
| ^~~~~~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:390:36: note: in expansion of macro 'VRAM_D_CR'
390 | void vramSetBankD(VRAM_D_TYPE d) { VRAM_D_CR = VRAM_ENABLE | d; }
| ^~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h: In function 'vramSetBankE':
C:/devkitPro/calico/include/calico/nds/arm9/vram.h:23:34: error: 'IO_VRAMCNT_E' undeclared (first use in this function); did you mean 'REG_VRAMCNT_E'?
23 | #define REG_VRAMCNT_E MK_REG(u8, IO_VRAMCNT_E)
| ^~~~~~~~~~~~
C:/devkitPro/calico/include/calico/types.h:137:57: note: in definition of macro 'MK_REG'
137 | #define MK_REG(_type,_off) (*(_type volatile*)(MM_IO + (_off)))
| ^~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:151:33: note: in expansion of macro 'REG_VRAMCNT_E'
151 | #define VRAM_E_CR REG_VRAMCNT_E
| ^~~~~~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:396:36: note: in expansion of macro 'VRAM_E_CR'
396 | void vramSetBankE(VRAM_E_TYPE e) { VRAM_E_CR = VRAM_ENABLE | e; }
| ^~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h: In function 'vramSetBankF':
C:/devkitPro/calico/include/calico/nds/arm9/vram.h:24:34: error: 'IO_VRAMCNT_F' undeclared (first use in this function); did you mean 'REG_VRAMCNT_F'?
24 | #define REG_VRAMCNT_F MK_REG(u8, IO_VRAMCNT_F)
| ^~~~~~~~~~~~
C:/devkitPro/calico/include/calico/types.h:137:57: note: in definition of macro 'MK_REG'
137 | #define MK_REG(_type,_off) (*(_type volatile*)(MM_IO + (_off)))
| ^~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:152:33: note: in expansion of macro 'REG_VRAMCNT_F'
152 | #define VRAM_F_CR REG_VRAMCNT_F
| ^~~~~~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:402:36: note: in expansion of macro 'VRAM_F_CR'
402 | void vramSetBankF(VRAM_F_TYPE f) { VRAM_F_CR = VRAM_ENABLE | f; }
| ^~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h: In function 'vramSetBankG':
C:/devkitPro/calico/include/calico/nds/arm9/vram.h:25:34: error: 'IO_VRAMCNT_G' undeclared (first use in this function); did you mean 'REG_VRAMCNT_G'?
25 | #define REG_VRAMCNT_G MK_REG(u8, IO_VRAMCNT_G)
| ^~~~~~~~~~~~
C:/devkitPro/calico/include/calico/types.h:137:57: note: in definition of macro 'MK_REG'
137 | #define MK_REG(_type,_off) (*(_type volatile*)(MM_IO + (_off)))
| ^~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:153:33: note: in expansion of macro 'REG_VRAMCNT_G'
153 | #define VRAM_G_CR REG_VRAMCNT_G
| ^~~~~~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:408:36: note: in expansion of macro 'VRAM_G_CR'
408 | void vramSetBankG(VRAM_G_TYPE g) { VRAM_G_CR = VRAM_ENABLE | g; }
| ^~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h: In function 'vramSetBankH':
C:/devkitPro/calico/include/calico/nds/arm9/vram.h:26:34: error: 'IO_VRAMCNT_H' undeclared (first use in this function); did you mean 'REG_VRAMCNT_H'?
26 | #define REG_VRAMCNT_H MK_REG(u8, IO_VRAMCNT_H)
| ^~~~~~~~~~~~
C:/devkitPro/calico/include/calico/types.h:137:57: note: in definition of macro 'MK_REG'
137 | #define MK_REG(_type,_off) (*(_type volatile*)(MM_IO + (_off)))
| ^~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:155:33: note: in expansion of macro 'REG_VRAMCNT_H'
155 | #define VRAM_H_CR REG_VRAMCNT_H
| ^~~~~~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:414:36: note: in expansion of macro 'VRAM_H_CR'
414 | void vramSetBankH(VRAM_H_TYPE h) { VRAM_H_CR = VRAM_ENABLE | h; }
| ^~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h: In function 'vramSetBankI':
C:/devkitPro/calico/include/calico/nds/arm9/vram.h:27:34: error: 'IO_VRAMCNT_I' undeclared (first use in this function); did you mean 'REG_VRAMCNT_I'?
27 | #define REG_VRAMCNT_I MK_REG(u8, IO_VRAMCNT_I)
| ^~~~~~~~~~~~
C:/devkitPro/calico/include/calico/types.h:137:57: note: in definition of macro 'MK_REG'
137 | #define MK_REG(_type,_off) (*(_type volatile*)(MM_IO + (_off)))
| ^~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:156:33: note: in expansion of macro 'REG_VRAMCNT_I'
156 | #define VRAM_I_CR REG_VRAMCNT_I
| ^~~~~~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:420:36: note: in expansion of macro 'VRAM_I_CR'
420 | void vramSetBankI(VRAM_I_TYPE i) { VRAM_I_CR = VRAM_ENABLE | i; }
| ^~~~~~~~~
In file included from G:/TWiLightMenu/universal/bootloader_menu/source/boot.c:45:
C:/devkitPro/libnds/include/nds/arm9/video.h: In function 'setBackdropColor':
C:/devkitPro/libnds/include/nds/arm9/video.h:103:33: error: 'MM_PALRAM' undeclared (first use in this function); did you mean 'MM_CARTRAM'?
103 | #define BG_PALETTE ((u16*)MM_PALRAM) /**< \brief background palette memory*/
| ^~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:603:5: note: in expansion of macro 'BG_PALETTE'
603 | BG_PALETTE[0] = color;
| ^~~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h: In function 'setBackdropColorSub':
C:/devkitPro/libnds/include/nds/arm9/video.h:104:34: error: 'MM_PALRAM' undeclared (first use in this function); did you mean 'MM_CARTRAM'?
104 | #define BG_PALETTE_SUB ((u16*)(MM_PALRAM+0x400)) /**< \brief background palette memory (sub engine)*/
| ^~~~~~~~~
C:/devkitPro/libnds/include/nds/arm9/video.h:617:5: note: in expansion of macro 'BG_PALETTE_SUB'
617 | BG_PALETTE_SUB[0] = color;
| ^~~~~~~~~~~~~~
G:/TWiLightMenu/universal/bootloader_menu/source/boot.c: At top level:
G:/TWiLightMenu/universal/bootloader_menu/source/boot.c:93:1: warning: 'uint32' is deprecated [-Wdeprecated-declarations]
93 | void boot_readFirmware (uint32 address, uint8 * buffer, uint32 size) {
| ^~~~
G:/TWiLightMenu/universal/bootloader_menu/source/boot.c:93:1: warning: 'uint8' is deprecated [-Wdeprecated-declarations]
G:/TWiLightMenu/universal/bootloader_menu/source/boot.c:93:1: warning: 'uint32' is deprecated [-Wdeprecated-declarations]
G:/TWiLightMenu/universal/bootloader_menu/source/boot.c: In function 'boot_readFirmware':
G:/TWiLightMenu/universal/bootloader_menu/source/boot.c:94:9: warning: 'uint32' is deprecated [-Wdeprecated-declarations]
94 | uint32 index;
| ^~~~~~
G:/TWiLightMenu/universal/bootloader_menu/source/boot.c: In function 'passArgs_ARM7':
G:/TWiLightMenu/universal/bootloader_menu/source/boot.c:165:9: error: '__system_argv' undeclared (first use in this function)
165 | __system_argv->argvMagic = ARGV_MAGIC;
| ^~~~~~~~~~~~~
G:/TWiLightMenu/universal/bootloader_menu/source/boot.c:165:36: error: 'ARGV_MAGIC' undeclared (first use in this function)
165 | __system_argv->argvMagic = ARGV_MAGIC;
| ^~~~~~~~~~
G:/TWiLightMenu/universal/bootloader_menu/source/boot.c: In function 'NDSTouchscreenMode':
G:/TWiLightMenu/universal/bootloader_menu/source/boot.c:548:30: error: 'PM_READ_REGISTER' undeclared (first use in this function)
548 | writePowerManagement(PM_READ_REGISTER, 0x00); //*(unsigned char*)0x40001C2 = 0x80, 0x00; // read PWR[0] ;<-- also part of TSC !
| ^~~~~~~~~~~~~~~~
make[2]: *** [/opt/devkitpro/devkitARM/base_rules:40: boot.o] Error 1
make[2]: Leaving directory '/g/TWiLightMenu/universal/bootloader_menu/build'
make[1]: *** [Makefile:89: build] Error 2
make[1]: Leaving directory '/g/TWiLightMenu/universal/bootloader_menu'
make: *** [Makefile:54: bootloader] Error 2
One of the errors was complaining IO_VRAMCNT_A is missing, but it is in io.h and io.h is included by vram.h. So I don't think the headers are actually missing.
meow@ZWWDESK MSYS /g/TWiLightMenu/romsel_aktheme
$ grep -C5 -nR '\sIO_VRAMCNT_A\s' /opt/devkitpro/calico/include
/opt/devkitpro/calico/include/calico/nds/io.h-109-#define IO_IF2 0x21C
/opt/devkitpro/calico/include/calico/nds/io.h-110-#endif
/opt/devkitpro/calico/include/calico/nds/io.h-111-
/opt/devkitpro/calico/include/calico/nds/io.h-112-// Memory control
/opt/devkitpro/calico/include/calico/nds/io.h-113-#ifdef ARM9
/opt/devkitpro/calico/include/calico/nds/io.h:114:#define IO_VRAMCNT_A 0x240
/opt/devkitpro/calico/include/calico/nds/io.h-115-#define IO_VRAMCNT_B 0x241
/opt/devkitpro/calico/include/calico/nds/io.h-116-#define IO_VRAMCNT_C 0x242
/opt/devkitpro/calico/include/calico/nds/io.h-117-#define IO_VRAMCNT_D 0x243
/opt/devkitpro/calico/include/calico/nds/io.h-118-#define IO_VRAMCNT_E 0x244
/opt/devkitpro/calico/include/calico/nds/io.h-119-#define IO_VRAMCNT_F 0x245
What did I miss? Should I set EXTRA_CFLAGS or something to assign more include paths for compiler to be able to find the headers?
TWLMenu++ is not compatible with libnds v2 and calico. You need to downgrade libnds to a version before 2.
TWLMenu++ is not compatible with libnds v2 and calico. You need to downgrade libnds to a version before 2.
Thank you very much for promptly pointing out the issue.
So I uninstalled libnds 2.0.1 and also libfat-nds 2.0.2 and maxmod-nds 2.1.0, both of which depend on libnds, so they have to be uninstalled as well. THen I compiled libnds 1.8.3, libfat 1.2.0 (only nds libs) and maxmod 1.0.15 (only nds libs). Now my files under /opt/devkitpro/libnds looks like this
/opt/devkitpro/libnds
├── dswifi_license.txt
├── icon.bmp
├── include
│ ├── arpa
│ │ └── inet.h
│ ├── dswifi9.h
│ ├── fat.h
│ ├── gbfs.h
│ ├── gl2d.h
│ ├── libfatversion.h
│ ├── maxmod7.h
│ ├── maxmod9.h
│ ├── mm_types.h
│ ├── nds
│ │ ├── arm7
│ │ │ ├── aes.h
│ │ │ ├── audio.h
│ │ │ ├── clock.h
│ │ │ ├── codec.h
│ │ │ ├── i2c.h
│ │ │ ├── input.h
│ │ │ ├── sdmmc.h
│ │ │ ├── serial.h
│ │ │ └── touch.h
│ │ ├── arm9
│ │ │ ├── background.h
│ │ │ ├── boxtest.h
│ │ │ ├── cache_asm.h
│ │ │ ├── cache.h
│ │ │ ├── console.h
│ │ │ ├── decompress.h
│ │ │ ├── dldi_asm.h
│ │ │ ├── dldi.h
│ │ │ ├── dynamicArray.h
│ │ │ ├── exceptions.h
│ │ │ ├── guitarGrip.h
│ │ │ ├── image.h
│ │ │ ├── input.h
│ │ │ ├── keyboard.h
│ │ │ ├── linkedlist.h
│ │ │ ├── math.h
│ │ │ ├── nand.h
│ │ │ ├── ndsmotion.h
│ │ │ ├── paddle.h
│ │ │ ├── pcx.h
│ │ │ ├── piano.h
│ │ │ ├── postest.h
│ │ │ ├── rumble.h
│ │ │ ├── sassert.h
│ │ │ ├── sound.h
│ │ │ ├── sprite.h
│ │ │ ├── trig_lut.h
│ │ │ ├── videoGL.h
│ │ │ ├── video.h
│ │ │ └── window.h
│ │ ├── asminc.h
│ │ ├── bios.h
│ │ ├── card.h
│ │ ├── debug.h
│ │ ├── disc_io.h
│ │ ├── dma.h
│ │ ├── fifocommon.h
│ │ ├── fifomessages.h
│ │ ├── input.h
│ │ ├── interrupts.h
│ │ ├── ipc.h
│ │ ├── jtypes.h
│ │ ├── libversion.h
│ │ ├── memory.h
│ │ ├── ndstypes.h
│ │ ├── registers_alt.h
│ │ ├── rsa.h
│ │ ├── sha1.h
│ │ ├── system.h
│ │ ├── timers.h
│ │ └── touch.h
│ ├── nds.h
│ ├── netdb.h
│ ├── netinet
│ │ ├── in.h
│ │ └── tcp.h
│ ├── sys
│ │ ├── ioctl.h
│ │ └── socket.h
│ └── wfc.h
├── lib
│ ├── libdswifi9.a
│ ├── libfat.a
│ ├── libmm7.a
│ ├── libmm9.a
│ ├── libnds7.a
│ ├── libnds7d.a
│ ├── libnds9.a
│ └── libnds9d.a
├── libnds_license.txt
└── maxmod_license.txt
9 directories, 88 files
Then I tried to compile romsel_aktheme again. Unfortunately, there are still errors
$ make dist
make[1]: Entering directory '/media/data/DEVELOPMENT/GIT/TWiLightMenu/universal/bootloader_menu'
make[2]: Entering directory '/media/data/DEVELOPMENT/GIT/TWiLightMenu/universal/bootloader_menu/build'
make[2]: '/media/data/DEVELOPMENT/GIT/TWiLightMenu/romsel_aktheme/data/load.bin' is up to date.
make[2]: Leaving directory '/media/data/DEVELOPMENT/GIT/TWiLightMenu/universal/bootloader_menu/build'
make[1]: Leaving directory '/media/data/DEVELOPMENT/GIT/TWiLightMenu/universal/bootloader_menu'
make[1]: Entering directory '/media/data/DEVELOPMENT/GIT/TWiLightMenu/universal/bootstub'
make[1]: '/media/data/DEVELOPMENT/GIT/TWiLightMenu/romsel_aktheme/data/bootstub.bin' is up to date.
make[1]: Leaving directory '/media/data/DEVELOPMENT/GIT/TWiLightMenu/universal/bootstub'
make -C arm7
make[1]: Entering directory '/media/data/DEVELOPMENT/GIT/TWiLightMenu/romsel_aktheme/arm7'
make[2]: Entering directory '/media/data/DEVELOPMENT/GIT/TWiLightMenu/romsel_aktheme/arm7/build'
linking romsel_aktheme.elf
/opt/devkitpro/devkitARM/bin/../lib/gcc/arm-none-eabi/15.1.0/../../../../arm-none-eabi/bin/ld: /opt/devkitpro/libnds/lib/libnds7.a(interruptDispatcher.o): in function `IntrRet':
/media/data/DEVELOPMENT/GIT/libnds-1.8.3/arm7/../source/common/interruptDispatcher.s:63:(.text+0xe4): undefined reference to `__irq_flagsaux'
collect2: error: ld returned 1 exit status
make[2]: *** [/opt/devkitpro/devkitARM/ds_rules:61: /media/data/DEVELOPMENT/GIT/TWiLightMenu/romsel_aktheme/arm7/romsel_aktheme.elf] Error 1
make[2]: Leaving directory '/media/data/DEVELOPMENT/GIT/TWiLightMenu/romsel_aktheme/arm7/build'
make[1]: *** [Makefile:102: build] Error 2
make[1]: Leaving directory '/media/data/DEVELOPMENT/GIT/TWiLightMenu/romsel_aktheme/arm7'
make: *** [Makefile:22: makearm7] Error 2
I search around, it seemed a thread also reported this issue https://devkitpro.org/viewtopic.php?t=2005, but about 15 years ago. I don't quite understand the solution though, as the tool-chain is suppoedly up-to-date, except libnds, libfat and maxmod. It looks like the __irq_flagsaux is in the linkscripts, but I don't know how to solve this.
$ grep -R __irq_flagsaux /opt/devkitpro/
/opt/devkitpro/devkitARM/arm-none-eabi/lib/ds_arm7_iwram.ld:__irq_flagsaux =0x04000000 - 0x40;
/opt/devkitpro/devkitARM/arm-none-eabi/lib/ds_arm7_vram.ld:__irq_flagsaux =0x04000000 - 0x40;
/opt/devkitpro/devkitARM/arm-none-eabi/lib/ds_arm7.ld:__irq_flagsaux = 0x04000000 - 0x40;
/opt/devkitpro/libnds/include/nds/interrupts.h:extern vuint32 __irq_flagsaux[];
/opt/devkitpro/libnds/include/nds/interrupts.h:#define INTR_WAIT_FLAGSAUX *(__irq_flagsaux)
Could you help identify the issue and how to fix?
I'm not familiar with the error, but devkitARM may also need to be downgraded to a version before libnds v2. Try running make clean first and then run make again before downgrading devkitARM.
If the issue persists, then idk how to fix it.
Surprisingly, I actually managed to complete the compilation by using this solution:
I replaced ldr r0, =__irq_flagsaux in libnds-1.8.3/source/common/interruptDispatcher.s with ldr r0, =0x04000000 - 0x40, so the symbol of __irq_flagsaux no longer exists.
Then I further downgraded libfat from 1.2.0 to 1.1.5, as I found out the source code is checking libfat's version to be exact 1.1.5.
After that, no errors again.
the compiled romsel_aktheme.nds doesn't work on NDSi, it freezes on white screen. Anyway, I give up.
This is everything that upgraded on the day libnds 2.0 was pushed, and the versions I use for building this. It's probably not necessary to downgrade everything back to pre-2.0, but I don't build anything newer anyway so it's probably 'safer' to revert the environment to before 2.0 entirely just to rule out potential compatibility issues.
default-arm7 0.7.4-7 devkitarm-rules 1.5.1-1 dswifi 0.4.201 libfat-nds 1.1.5-1 libfilesystem 0.9.14-2 libnds 1.8.3-1 maxmod-nds 1.0.15-1 nds-cmake 1.2.1-1 nds-examples 20200727-1
~~I'm also on devkitARM r65-1 if it matters~~ r66 works
Find what you need here if the old package versions aren't already in your paccache from before. Use pacman -U [filename] to manually install from .tar.xz or .tar.zst packages
You can also use docker which will use the correct version of the toolchain, but if you were trying to build your own changes I don't necessarily know how easy or not it would be to do that using docker. I can't imagine it wouldn't be possible though, so it's worth looking into.