diff --git a/libc/config/linux/app.h b/libc/config/linux/app.h --- a/libc/config/linux/app.h +++ b/libc/config/linux/app.h @@ -35,7 +35,9 @@ uintptr_t align; }; -#if defined(LIBC_TARGET_ARCH_IS_X86_64) || defined(LIBC_TARGET_ARCH_IS_AARCH64) +#if defined(LIBC_TARGET_ARCH_IS_X86_64) || \ + defined(LIBC_TARGET_ARCH_IS_AARCH64) || \ + defined(LIBC_TARGET_ARCH_IS_RISCV64) // At the language level, argc is an int. But we use uint64_t as the x86_64 // ABI specifies it as an 8 byte value. Likewise, in the ARM64 ABI, arguments // are usually passed in registers. x0 is a doubleword register, so this is diff --git a/libc/include/llvm-libc-macros/linux/signal-macros.h b/libc/include/llvm-libc-macros/linux/signal-macros.h --- a/libc/include/llvm-libc-macros/linux/signal-macros.h +++ b/libc/include/llvm-libc-macros/linux/signal-macros.h @@ -82,6 +82,9 @@ #elif defined(__aarch64__) #define MINSIGSTKSZ 5120 #define SIGSTKSZ 16384 +#elif defined(__riscv) +#define MINSIGSTKSZ 2048 +#define SIGSTKSZ 8192 #else #error "Signal stack sizes not defined for your platform." #endif diff --git a/libc/include/llvm-libc-types/fenv_t.h b/libc/include/llvm-libc-types/fenv_t.h --- a/libc/include/llvm-libc-types/fenv_t.h +++ b/libc/include/llvm-libc-types/fenv_t.h @@ -26,5 +26,8 @@ #else #error "fenv_t not defined for your platform" #endif +#ifdef __riscv +typedef unsigned int fenv_t; +#endif #endif // __LLVM_LIBC_TYPES_FENV_T_H__ diff --git a/libc/src/__support/FPUtil/FEnvImpl.h b/libc/src/__support/FPUtil/FEnvImpl.h --- a/libc/src/__support/FPUtil/FEnvImpl.h +++ b/libc/src/__support/FPUtil/FEnvImpl.h @@ -46,6 +46,10 @@ LIBC_INLINE int raise_except(int) { return 0; } +LIBC_INLINE int enable_except(int) { return 0; } + +LIBC_INLINE int disable_except(int) { return 0; } + LIBC_INLINE int get_round() { return FE_TONEAREST; } LIBC_INLINE int set_round(int) { return 0; }