$LIB` is the directory name of the shared library directory. It is usually used as a relative directory from a prefix. That is, typically "/usr/$DIR" should point to the library directory. However in multiarch directory the relative path from prefix contains two components, e.g. lib/x86_64-linux-gnu. The way DL_DST_LIB is calculated strips the previous components of the path and only keeps x86_64-linux-gnu. $(notdir $(slibdir)) should be replaced by something like $$(realpath $(slibdir) --relative-to=$(prefix)) or $(patsubst $(prefix)/%,%,$(slibdir))
(In reply to Valentin David from comment #0) > $LIB` is the directory name of the shared library directory. It is usually > used as a relative directory from a prefix. That is, typically "/usr/$DIR" > should point to the library directory. However in multiarch directory the > relative path from prefix contains two components, e.g. > lib/x86_64-linux-gnu. The way DL_DST_LIB is calculated strips the previous > components of the path and only keeps x86_64-linux-gnu. Agreed. > $(notdir $(slibdir)) should be replaced by something like $$(realpath > $(slibdir) --relative-to=$(prefix)) or $(patsubst $(prefix)/%,%,$(slibdir)) Valentin, Could you please prototype a patch for this and send it to libc-alpha? TO: me for review.
Since apparently there has not been continuation, I'd note that we're currently carrying this patch https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/master/patches/glibc/fix-dl-dst-lib.patch which seems to fix the issue.