-
Notifications
You must be signed in to change notification settings - Fork 2.1k
mips: Build system is not aligned with other platforms #6588
Description
There are some issues with the current Makefile.include for the recently added mips CPU family.
-
USEMODULE += newlibis missing/commented out - Makefile requires
$(MIPS_ELF_ROOT)/share/mips/rules/mipshal.mk - Doesn't build with BUILD_IN_DOCKER=1 unless the host system also has the tool chain installed, effectively eliminating the benefit of using a Docker image with all tools.
- Does not use the shared TOOLCHAIN= and Makefile.gnu settings files.
-
There are parts of the code, especially in vfs: file system abstraction #5616, where we need to take a particular path if newlib is used as the C library (as opposed to msp-libc or avr-libc). It requires that we can test
#if MODULE_NEWLIBwithin the C code. -
I didn't get the mipshal.mk file when I installed a mips bare-metal toolchain from scratch on my system (GCC+Newlib). Looking at the file in the riot/riotbuild Docker image I can see that we could just copy parts of it into cpu/mips_common and use it from there.
-
The Docker issues would be resolved if the makefile did not have the ifeq/error clause at the top and did not depend on the mipshal.mk file being found on the system.
-
Using the shared toolchain Makefiles makes it easier to support other toolchains in the future, for example LLVM/Clang, as alternatives to the standard GCC toolchain. It also takes care of setting all relevant tool command names so that we don't have to repeat the commands for every CPU family which uses GCC.