Skip to content

Support LLVM Toolchain #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Support LLVM Toolchain #14

wants to merge 1 commit into from

Conversation

G36maid
Copy link

@G36maid G36maid commented Jul 7, 2025

This PR adds experimental support for building Linmo with the LLVM toolchain.
related to #2 , #12

Changes

  • Introduces initial support for compiling the RISC-V target
    using the LLVM toolchain.
  • Fixes build errors for LLVM:
    • Removes unused coalesced variable in malloc.c
    • Replaces __maybe_unused with portable __attribute__((__unused__))

Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always write complete English sentences in Git commit messages.

@jserv jserv changed the title Add LLVM Toolchain Support to RISC-V Build System Support LLVM Toolchain Jul 7, 2025
@G36maid G36maid force-pushed the llvm branch 2 times, most recently from d096b17 to 1f54ad2 Compare July 7, 2025 06:37
This commit introduces initial support for compiling the RISC-V target
using the LLVM toolchain.
@@ -34,15 +34,15 @@ static inline uint16_t pipe_free_space_internal(const pipe_t *p)
return (p->mask + 1) - p->used;
}

static inline char pipe_get_byte(pipe_t *p)
static inline __attribute__((__unused__)) char pipe_get_byte(pipe_t *p)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply do #include "private/utils.h" and use pre-defined UNUSED macro.

@@ -17,27 +17,49 @@ DEFINES := -DF_CPU=$(F_CLK) \
-DF_TIMER=$(F_TICK) \
-include config.h

ASFLAGS = -march=rv32imzicsr -mabi=ilp32
CFLAGS += -Wall -Wextra -Wshadow -Wno-unused-parameter -Werror
CROSS_COMPILE ?= riscv32-unknown-elf-
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set the default value to riscv-none-elf- as xPack GNU RISC-V Embedded GCC is suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants