Skip to content

Commit

Permalink
Add support for Linux/riscv64 with musl libc.
Browse files Browse the repository at this point in the history
* trampoline/trampoline.c (__riscv_flush_icache): New declaration.
* callback/trampoline_r/trampoline.c: Likewise.
* NEWS: Mention the new port.
  • Loading branch information
bhaible committed Aug 21, 2024
1 parent d06fa5e commit c3a95f5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2024-08-21 Bruno Haible <[email protected]>

Add support for Linux/riscv64 with musl libc.
* trampoline/trampoline.c (__riscv_flush_icache): New declaration.
* callback/trampoline_r/trampoline.c: Likewise.
* NEWS: Mention the new port.

2024-08-20 Bruno Haible <[email protected]>

Fix support for older Linux versions (regression 2024-08-18).
Expand Down
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ New in 2.5:
* Added support for the following platforms:
(Previously, a build on these platforms failed.)
- loongarch64: Linux with lp64d ABI.
- riscv64: Linux with musl libc.
- arm: Android.
* Simplified the environmental requirements (the library no longer allocates
a temporary file in /tmp) on the following platforms:
Expand Down
4 changes: 4 additions & 0 deletions callback/trampoline_r/trampoline.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ kern_return_t mach_vm_remap (vm_map_t target_task,
#if defined(__mips__) || defined(__mipsn32__) || defined(__mips64__) || defined(__riscv32__) || defined(__riscv64__)
#ifdef HAVE_SYS_CACHECTL_H /* IRIX, Linux */
#include <sys/cachectl.h>
#if defined(__riscv64__) && !defined(__GLIBC__)
/* musl libc lacks a declaration of this function. */
extern int __riscv_flush_icache (void *start, void *end, unsigned long flags);
#endif
#else
#ifdef __OpenBSD__
#include <machine/sysarch.h>
Expand Down
4 changes: 4 additions & 0 deletions trampoline/trampoline.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ kern_return_t mach_vm_remap (vm_map_t target_task,
#if defined(__mips__) || defined(__mipsn32__) || defined(__mips64__) || defined(__riscv32__) || defined(__riscv64__)
#ifdef HAVE_SYS_CACHECTL_H /* IRIX, Linux */
#include <sys/cachectl.h>
#if defined(__riscv64__) && !defined(__GLIBC__)
/* musl libc lacks a declaration of this function. */
extern int __riscv_flush_icache (void *start, void *end, unsigned long flags);
#endif
#else
#ifdef __OpenBSD__
#include <machine/sysarch.h>
Expand Down

0 comments on commit c3a95f5

Please sign in to comment.