Skip to content

Commit caf49b9

Browse files
wzssyqapoettering
authored andcommitted
Fix MIPS N64 and N32 LIB_ARCH_TUPLE (systemd#5469)
* 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__.
1 parent 8999954 commit caf49b9

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/basic/architecture.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,21 @@ int uname_architecture(void);
124124
#elif defined(__sparc__)
125125
# define native_architecture() ARCHITECTURE_SPARC
126126
# define LIB_ARCH_TUPLE "sparc-linux-gnu"
127-
#elif defined(__mips64__)
127+
#elif defined(__mips64) && defined(__LP64__)
128128
# if __BYTE_ORDER == __BIG_ENDIAN
129129
# define native_architecture() ARCHITECTURE_MIPS64
130-
# error "Missing LIB_ARCH_TUPLE for MIPS64"
130+
# define LIB_ARCH_TUPLE "mips64-linux-gnuabi64"
131131
# else
132132
# define native_architecture() ARCHITECTURE_MIPS64_LE
133-
# error "Missing LIB_ARCH_TUPLE for MIPS64_LE"
133+
# define LIB_ARCH_TUPLE "mips64el-linux-gnuabi64"
134+
# endif
135+
#elif defined(__mips64)
136+
# if __BYTE_ORDER == __BIG_ENDIAN
137+
# define native_architecture() ARCHITECTURE_MIPS64
138+
# define LIB_ARCH_TUPLE "mips64-linux-gnuabin32"
139+
# else
140+
# define native_architecture() ARCHITECTURE_MIPS64_LE
141+
# define LIB_ARCH_TUPLE "mips64el-linux-gnuabin32"
134142
# endif
135143
#elif defined(__mips__)
136144
# if __BYTE_ORDER == __BIG_ENDIAN

0 commit comments

Comments
 (0)