[riot-notifications] [RIOT-OS/RIOT] fe310: Support compilation with clang (#15176)

nmeum notifications at github.com
Thu Nov 5 13:15:36 CET 2020

> File a bug there ;-) From https://clang.llvm.org/docs/CrossCompilation.html#target-triple

Could you briefly explain what you mean by that? I started using the Alpine packed `gcc-riscv-none-elf` now (which was also created by you I believe :wink:), instead of building my own cross-compilers and with `gcc-riscv-none-elf` I can indeed also reproduce the issue described by @aabadie.

If I make the following changes to the buildsystem compilation with clang works fine again:

diff --git a/makefiles/toolchain/llvm.inc.mk b/makefiles/toolchain/llvm.inc.mk
index 9898f10f8..182d71ee6 100644
--- a/makefiles/toolchain/llvm.inc.mk
+++ b/makefiles/toolchain/llvm.inc.mk
@@ -56,8 +56,8 @@ ifneq (,$(TARGET_ARCH))
   # Tell clang to cross compile
-  CFLAGS     += -target $(TARGET_ARCH)
-  CXXFLAGS   += -target $(TARGET_ARCH)
+  CFLAGS     += -target riscv32-unknown-elf
+  CXXFLAGS   += -target riscv32-unknown-elf
   # We currently don't use LLVM for linking (see comment above).
   # LINKFLAGS  += -target $(TARGET_ARCH)

So why does the RIOT docker image and the Alpine package use a triplet which is not supported by clang?

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201105/af61f261/attachment-0001.htm>

More information about the notifications mailing list