Skip to content

mips: Build system is not aligned with other platforms #6588

@jnohlgard

Description

@jnohlgard

There are some issues with the current Makefile.include for the recently added mips CPU family.

  • USEMODULE += newlib is 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.
  1. 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_NEWLIB within the C code.

  2. 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.

  3. 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.

  4. 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.

Metadata

Metadata

Assignees

Labels

Platform: MIPSPlatform: This PR/issue effects MIPS-based platformsType: cleanupThe issue proposes a clean-up / The PR cleans-up parts of the codebase / documentationType: new featureThe issue requests / The PR implemements a new feature for RIOT

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions