This includes atleast the native multiarch path in the paths to search.
(Maybe also other multiarch paths should also be searched? But atleast
this is a first step.)
Before this change (on Debian):
$ whereis libc
libc: /usr/share/man/man7/libc.7.gz
After this change:
$ whereis libc
libc: /usr/lib/x86_64-linux-gnu/libc.so /usr/lib/x86_64-linux-gnu/libc.a /usr/share/man/man7/libc.7.gz
Addresses: https://bugs.debian.org/856968
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
UL_BUILD_INIT([namei], [yes])
AM_CONDITIONAL([BUILD_NAMEI], [test "x$build_namei" = xyes])
+matriplet="$($CC -print-multiarch 2>/dev/null || true)"
+if test "x$matriplet" != "x"; then
+ AC_DEFINE_UNQUOTED([MULTIARCHTRIPLET], ["$matriplet"],
+ ["Multi-arch triplet for whereis library search path"])
+fi
UL_BUILD_INIT([whereis], [yes])
AM_CONDITIONAL([BUILD_WHEREIS], [test "x$build_whereis" = xyes])
static const char *bindirs[] = {
"/usr/bin",
"/usr/sbin",
+#if defined(MULTIARCHTRIPLET)
+ "/lib/" MULTIARCHTRIPLET,
+ "/usr/lib/" MULTIARCHTRIPLET,
+ "/usr/local/lib/" MULTIARCHTRIPLET,
+#endif
"/usr/lib",
"/usr/lib64",
"/bin",