summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiaotian Wu <wuxiaotian@loongson.cn>2022-03-08 04:15:25 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-03-25 16:29:38 +0100
commit017228934833d8618774353dcccbc5ec9f78ce98 (patch)
treec98d5675380c3f4e8058bde044b51d29b9987d6b
parentMerge pull request #22861 from poettering/journald-sigterm (diff)
downloadsystemd-017228934833d8618774353dcccbc5ec9f78ce98.tar.xz
systemd-017228934833d8618774353dcccbc5ec9f78ce98.zip
basic: update the Arch tuples for LoongArch
-rw-r--r--src/basic/architecture.h13
-rw-r--r--src/shared/base-filesystem.c14
2 files changed, 24 insertions, 3 deletions
diff --git a/src/basic/architecture.h b/src/basic/architecture.h
index 0b91c69c0b..cb4c79b84e 100644
--- a/src/basic/architecture.h
+++ b/src/basic/architecture.h
@@ -199,9 +199,16 @@ int uname_architecture(void);
# define LIB_ARCH_TUPLE "sh4a-linux-gnu"
# endif
#elif defined(__loongarch64)
-# pragma message "Please update the Arch tuple of loongarch64 after psABI is stable"
-# define native_architecture() ARCHITECTURE_LOONGARCH64
-# define LIB_ARCH_TUPLE "loongarch64-linux-gnu"
+# define native_architecture() ARCHITECTURE_LOONGARCH64
+# 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
#elif defined(__m68k__)
# define native_architecture() ARCHITECTURE_M68K
# define LIB_ARCH_TUPLE "m68k-linux-gnu"
diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
index 3a77f37a69..6dacc1d20a 100644
--- a/src/shared/base-filesystem.c
+++ b/src/shared/base-filesystem.c
@@ -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