https://wiki.debian.org/ArchitectureSpecificsMemo shows the triplet, but no the
linker paths. I used the linker path from Fedora.
$ ls -l /lib /lib64
lrwxrwxrwx. 1 root root 7 Aug 13 2020 /lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Aug 13 2020 /lib64 -> usr/lib64
$ ldd /bin/sh|grep ld
/lib/ld-linux-riscv64-lp64d.so.1 (0x0000003fb8185000)
$ ls -l /lib/ld-linux-riscv64-lp64d.so.1
lrwxrwxrwx 1 root root 19 Aug 4 19:28 /lib/ld-linux-riscv64-lp64d.so.1 -> ../lib64/ld-2.32.so
$ uname -r
5.10.6+
So even though the canonical linker path uses /lib/, we need the /lib64 symlink
to be present.
#elif defined(__riscv)
# if __riscv_xlen == 32
# elif __riscv_xlen == 64
+ /* Same situation as for aarch64 */
+ { "lib64", 0, "usr/lib/riscv64-linux-gnu\0"
+ "usr/lib64\0", "ld-linux-riscv64-lp64d.so.1" },
+# define KNOW_LIB64_DIRS 1
# else
# error "Unknown RISC-V ABI"
# endif