Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Commit

Permalink
basic: update the Arch tuples for LoongArch
Browse files Browse the repository at this point in the history
  • Loading branch information
yetist committed Mar 11, 2022
1 parent 999fc88 commit 350489a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
29 changes: 26 additions & 3 deletions src/basic/architecture.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ typedef enum {
ARCHITECTURE_ARM_BE,
ARCHITECTURE_CRIS,
ARCHITECTURE_IA64,
ARCHITECTURE_LOONGARCH32,
ARCHITECTURE_LOONGARCH64,
ARCHITECTURE_M68K,
ARCHITECTURE_MIPS,
Expand Down Expand Up @@ -198,10 +199,32 @@ int uname_architecture(void);
# elif defined(__SH4A__)
# define LIB_ARCH_TUPLE "sh4a-linux-gnu"
# endif
#elif defined(__loongarch64)
# pragma message "Please update the Arch tuple of loongarch64 after psABI is stable"
#elif defined(__loongarch__)
# if defined(__loongarch32)
# define native_architecture() ARCHITECTURE_LOONGARCH32
# if defined(__loongarch_double_float)
# define LIB_ARCH_TUPLE "loongarch32-linux-gnuf64"
# elif defined(__loongarch_single_float)
# define LIB_ARCH_TUPLE "loongarch32-linux-gnuf32"
# elif defined(__loongarch_soft_float)
# define LIB_ARCH_TUPLE "loongarch32-linux-gnusf"
# else
# error "Unrecognized loongarch architecture variant"
# endif
# elif defined(__loongarch64)
# define native_architecture() ARCHITECTURE_LOONGARCH64
# define LIB_ARCH_TUPLE "loongarch64-linux-gnu"
# if defined(__loongarch_double_float)
# define LIB_ARCH_TUPLE "loongarch64-linux-gnuf64"
# elif defined(__loongarch_single_float)
# define LIB_ARCH_TUPLE "loongarch64-linux-gnuf32"
# elif defined(__loongarch_soft_float)
# define LIB_ARCH_TUPLE "loongarch64-linux-gnusf"
# else
# error "Unrecognized loongarch architecture variant"
# endif
# else
# error "Unrecognized loongarch architecture variant"
# endif
#elif defined(__m68k__)
# define native_architecture() ARCHITECTURE_M68K
# define LIB_ARCH_TUPLE "m68k-linux-gnu"
Expand Down
14 changes: 14 additions & 0 deletions src/shared/base-filesystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ static const BaseFilesystem table[] = {
"usr/lib64\0", "ld-linux-x86-64.so.2" },
# define KNOW_LIB64_DIRS 1
#elif defined(__ia64__)
#elif defined(__loongarch64)
# define KNOW_LIB64_DIRS 1
# if defined(__loongarch_double_float)
{ "lib64", 0, "usr/lib/"LIB_ARCH_TUPLE"\0"
"usr/lib64\0", "ld-linux-loongarch-lp64d.so.1" },
# elif defined(__loongarch_single_float)
{ "lib64", 0, "usr/lib/"LIB_ARCH_TUPLE"\0"
"usr/lib64\0", "ld-linux-loongarch-lp64f.so.1" },
# elif defined(__loongarch_soft_float)
{ "lib64", 0, "usr/lib/"LIB_ARCH_TUPLE"\0"
"usr/lib64\0", "ld-linux-loongarch-lp64s.so.1" },
# else
# error "Unknown LoongArch ABI"
# endif
#elif defined(__m68k__)
/* No link needed. */
# define KNOW_LIB64_DIRS 1
Expand Down

0 comments on commit 350489a

Please sign in to comment.