]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Fix MIPS N64 and N32 LIB_ARCH_TUPLE (#5469)
authorYunQiang Su <wzssyqa@gmail.com>
Tue, 28 Feb 2017 10:35:40 +0000 (18:35 +0800)
committerLennart Poettering <lennart@poettering.net>
Tue, 28 Feb 2017 10:35:40 +0000 (11:35 +0100)
* Fix MIPS N64 and N32 LIB_ARCH_TUPLE

For mips, we have 3 major ABIs, they are N64, N32 and O32.
Both N32 and N64 defined __mips64__, and only N64 defined __LP64__.

src/basic/architecture.h

index b0a7de5dc92e36b8d7e210790df23ee0c6193005..46883719d16c3314ccb6e4e508a8d25467637951 100644 (file)
@@ -124,13 +124,21 @@ int uname_architecture(void);
 #elif defined(__sparc__)
 #  define native_architecture() ARCHITECTURE_SPARC
 #  define LIB_ARCH_TUPLE "sparc-linux-gnu"
-#elif defined(__mips64__)
+#elif defined(__mips64) && defined(__LP64__)
 #  if __BYTE_ORDER == __BIG_ENDIAN
 #    define native_architecture() ARCHITECTURE_MIPS64
-#    error "Missing LIB_ARCH_TUPLE for MIPS64"
+#    define LIB_ARCH_TUPLE "mips64-linux-gnuabi64"
 #  else
 #    define native_architecture() ARCHITECTURE_MIPS64_LE
-#    error "Missing LIB_ARCH_TUPLE for MIPS64_LE"
+#    define LIB_ARCH_TUPLE "mips64el-linux-gnuabi64"
+#  endif
+#elif defined(__mips64)
+#  if __BYTE_ORDER == __BIG_ENDIAN
+#    define native_architecture() ARCHITECTURE_MIPS64
+#    define LIB_ARCH_TUPLE "mips64-linux-gnuabin32"
+#  else
+#    define native_architecture() ARCHITECTURE_MIPS64_LE
+#    define LIB_ARCH_TUPLE "mips64el-linux-gnuabin32"
 #  endif
 #elif defined(__mips__)
 #  if __BYTE_ORDER == __BIG_ENDIAN