Skip to content

Commit e9de116

Browse files
committed
base-filesystem: do not attempt to create a /lib64 -> /usr/lib/<tuple> symlink
In multi-arch distributions (debian and derivatives) multiarch tuples under /usr/lib are used, such as /usr/lib/x86_64-linux-gnu/ but the /lib64 symlink should never point there, it should always point to /usr/lib64, as that's how they are set up by distribution-specific tools. https://packages.debian.org/bookworm/amd64/libc6-i386/filelist https://packages.debian.org/bookworm/mipsel/libc6-mips64/filelist https://salsa.debian.org/md/usrmerge/-/blob/master/convert-usrmerge?ref_type=heads#L295 https://salsa.debian.org/md/usrmerge/-/blob/master/convert-usrmerge?ref_type=heads#L517 http://bugs.debian.org/1076491 Fixes systemd/systemd#33919 (cherry picked from commit b75c137) (cherry picked from commit 38caeac) (cherry picked from commit b2738ee) (cherry picked from commit 3b1f76d) (cherry picked from commit d62a0aa)
1 parent d2aeb31 commit e9de116

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/shared/base-filesystem.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,25 @@ static const BaseFilesystem table[] = {
5050
/* aarch64 ELF ABI actually says dynamic loader is in /lib/, but Fedora puts it in /lib64/ anyway and
5151
* just symlinks /lib/ld-linux-aarch64.so.1 to ../lib64/ld-linux-aarch64.so.1. For this to work
5252
* correctly, /lib64/ must be symlinked to /usr/lib64/. */
53-
{ "lib64", 0, "usr/lib/"LIB_ARCH_TUPLE"\0"
54-
"usr/lib64\0", "ld-linux-aarch64.so.1" },
53+
{ "lib64", 0, "usr/lib64\0", "ld-linux-aarch64.so.1" },
5554
# define KNOW_LIB64_DIRS 1
5655
#elif defined(__alpha__)
5756
#elif defined(__arc__) || defined(__tilegx__)
5857
#elif defined(__arm__)
5958
/* No /lib64 on arm. The linker is /lib/ld-linux-armhf.so.3. */
6059
# define KNOW_LIB64_DIRS 1
6160
#elif defined(__i386__) || defined(__x86_64__)
62-
{ "lib64", 0, "usr/lib/"LIB_ARCH_TUPLE"\0"
63-
"usr/lib64\0", "ld-linux-x86-64.so.2" },
61+
{ "lib64", 0, "usr/lib64\0", "ld-linux-x86-64.so.2" },
6462
# define KNOW_LIB64_DIRS 1
6563
#elif defined(__ia64__)
6664
#elif defined(__loongarch_lp64)
6765
# define KNOW_LIB64_DIRS 1
6866
# if defined(__loongarch_double_float)
69-
{ "lib64", 0, "usr/lib/"LIB_ARCH_TUPLE"\0"
70-
"usr/lib64\0", "ld-linux-loongarch-lp64d.so.1" },
67+
{ "lib64", 0, "usr/lib64\0", "ld-linux-loongarch-lp64d.so.1" },
7168
# elif defined(__loongarch_single_float)
72-
{ "lib64", 0, "usr/lib/"LIB_ARCH_TUPLE"\0"
73-
"usr/lib64\0", "ld-linux-loongarch-lp64f.so.1" },
69+
{ "lib64", 0, "usr/lib64\0", "ld-linux-loongarch-lp64f.so.1" },
7470
# elif defined(__loongarch_soft_float)
75-
{ "lib64", 0, "usr/lib/"LIB_ARCH_TUPLE"\0"
76-
"usr/lib64\0", "ld-linux-loongarch-lp64s.so.1" },
71+
{ "lib64", 0, "usr/lib64\0", "ld-linux-loongarch-lp64s.so.1" },
7772
# else
7873
# error "Unknown LoongArch ABI"
7974
# endif
@@ -89,8 +84,7 @@ static const BaseFilesystem table[] = {
8984
# endif
9085
#elif defined(__powerpc__)
9186
# if defined(__PPC64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
92-
{ "lib64", 0, "usr/lib/"LIB_ARCH_TUPLE"\0"
93-
"usr/lib64\0", "ld64.so.2" },
87+
{ "lib64", 0, "usr/lib64\0", "ld64.so.2" },
9488
# define KNOW_LIB64_DIRS 1
9589
# elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
9690
/* powerpc64-linux-gnu */
@@ -101,15 +95,13 @@ static const BaseFilesystem table[] = {
10195
# if __riscv_xlen == 32
10296
# elif __riscv_xlen == 64
10397
/* Same situation as for aarch64 */
104-
{ "lib64", 0, "usr/lib/"LIB_ARCH_TUPLE"\0"
105-
"usr/lib64\0", "ld-linux-riscv64-lp64d.so.1" },
98+
{ "lib64", 0, "usr/lib64\0", "ld-linux-riscv64-lp64d.so.1" },
10699
# define KNOW_LIB64_DIRS 1
107100
# else
108101
# error "Unknown RISC-V ABI"
109102
# endif
110103
#elif defined(__s390x__)
111-
{ "lib64", 0, "usr/lib/"LIB_ARCH_TUPLE"\0"
112-
"usr/lib64\0", "ld-lsb-s390x.so.3" },
104+
{ "lib64", 0, "usr/lib64\0", "ld-lsb-s390x.so.3" },
113105
# define KNOW_LIB64_DIRS 1
114106
#elif defined(__s390__)
115107
/* s390-linux-gnu */

0 commit comments

Comments
 (0)