idealvin / coost

A tiny boost library in C++11.
Other
3.91k stars 558 forks source link

Fix compilation errors under riscv64 architecture #358

Open Zeno-sole opened 4 months ago

Zeno-sole commented 4 months ago

Using riscv64 gcc13 compile prompt error unknown arch Refer to the definition in the latest gcc and fix it to __riscv_xlen The macro definition of riscv also exists in riscv32, so riscv_xlen is used as the CPU bit width judgment from: https://github.com/gcc-mirror/gcc/blob/master/gcc/config/riscv/riscv.h

loongarch64: Delete useless macro judgments

Macro definitions in loongarch64 environment in gcc and clang

#define __loongarch64 1
#define __loongarch__ 1
#define __loongarch_double_float 1
#define __loongarch_frlen 64
#define __loongarch_grlen 64
#define __loongarch_hard_float 1
#define __loongarch_lp64 1

Macro definitions in riscv64 environment in gcc and clang

#define __riscv 1
#define __riscv_a 2000000
#define __riscv_arch_test 1
#define __riscv_atomic 1
#define __riscv_c 2000000
#define __riscv_cmodel_medlow 1
#define __riscv_compressed 1
#define __riscv_d 2000000
#define __riscv_div 1
#define __riscv_f 2000000
#define __riscv_fdiv 1
#define __riscv_flen 64
#define __riscv_float_abi_double 1
#define __riscv_fsqrt 1
#define __riscv_i 2000000
#define __riscv_m 2000000
#define __riscv_mul 1
#define __riscv_muldiv 1
#define __riscv_xlen 64