Add compilation support for loongarch64 arch

This commit is contained in:
Dandan Zhang
2021-12-13 11:36:53 +08:00
parent fc876f2517
commit 8a3bf17b4b
3 changed files with 13 additions and 0 deletions

View File

@@ -736,6 +736,13 @@ sub vms_info {
shared_ldflag => add("-mabi=64"),
multilib => "64",
},
"linux64-loongarch64" => {
inherit_from => [ "linux-generic64" ],
cflags => add("-mabi=lp64"),
perlasm_scheme => "64",
shared_ldflag => add("-mabi=lp64"),
multilib => "64",
},
#### IA-32 targets...
#### These two targets are a bit aged and are to be used on older Linux

1
config
View File

@@ -565,6 +565,7 @@ case "$GUESSOS" in
OUT="linux-mips64"
;;
mips*-*-linux2) OUT="linux-mips32" ;;
loongarch64-*-linux2) OUT="linux64-loongarch64" ;;
ppc60x-*-vxworks*) OUT="vxworks-ppc60x" ;;
ppcgen-*-vxworks*) OUT="vxworks-ppcgen" ;;
pentium-*-vxworks*) OUT="vxworks-pentium" ;;

View File

@@ -105,9 +105,14 @@ static ossl_inline int io_setup(unsigned n, aio_context_t *ctx)
return syscall(__NR_io_setup, n, ctx);
}
/* Add __NR_eventfd2 syscall for loongarch64 architecture */
static ossl_inline int eventfd(int n)
{
#ifdef __loongarch64
return syscall(__NR_eventfd2, n);
#else
return syscall(__NR_eventfd, n);
#endif
}
static ossl_inline int io_destroy(aio_context_t ctx)