]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/base-filesystem: add define for ppc64el
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 17 Nov 2021 14:01:18 +0000 (15:01 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Nov 2021 14:30:08 +0000 (15:30 +0100)
https://wiki.debian.org/ArchitectureSpecificsMemo shows the triplet, but no the
linker paths. I used the linker path from Fedora, but I can't look up the
linker paths for BE and 32 bit. At least the ifdef scaffolding is provided, so
it should be trivial to fill in if somebody has access to such a system.

$ ls -l /lib /lib64
lrwxrwxrwx. 1 root root 7 Jan 26  2021 /lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Jan 26  2021 /lib64 -> usr/lib64
$ ldd /bin/sh|grep ld
/lib64/ld64.so.2 (0x00007fffa0a90000)
$ uname -r
5.14.9-200.fc34.ppc64le

Note that the macro defines listed in the wiki page don't match what I get
on Fedora: __PPC64__ vs. __ppc64__.

$ cpp -dM < /dev/null |grep -iE '__(powerpc|ppc)'|sort
 #define __powerpc__ 1
 #define __powerpc64__ 1
 #define __PPC__ 1
 #define __PPC64__ 1

First half of the fix for #14311.

src/shared/base-filesystem.c

index a07cd22e7ed40b682cae85f5a8bb1896e930bb42..422e4d6618842e15699fdb6d7f3c0dab153bd19d 100644 (file)
@@ -69,6 +69,15 @@ static const BaseFilesystem table[] = {
 #    error "Unknown MIPS ABI"
 #  endif
 #elif defined(__powerpc__)
+#  if defined(__PPC64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+        { "lib64",    0, "usr/lib/powerpc64le-linux-gnu\0"
+                         "usr/lib64\0",                "ld64.so.2" },
+#    define KNOW_LIB64_DIRS 1
+#  elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+        /* powerpc64-linux-gnu */
+#  else
+        /* powerpc-linux-gnu */
+#  endif
 #elif defined(__riscv)
 #  if __riscv_xlen == 32
 #  elif __riscv_xlen == 64