find_library: Construct paths by removing 'unknown' from library arch
The compiler used for a build sometimes disagrees with
the remainder of the toolchain wrt. to the architecture
triple. Specifically, Clang will typically put its
libraries in <arch>-unknown-<os>-<env>
but it uses
the GCC toolchain on many targets (which often has
its libraries in <arch>-<os>-<env>
). In such cases
CMake will acquire the triple from Clang and use it
in library search paths for libraries that are provided
by the GCC toolchain. This of course fails due to the
mismatch.
This patch augments the list of search paths with ones that include the architecture triple with any occurrences of 'unknown' removed.
Fixes: #24175 (closed)
Topic-rename: find_library-arch-unknown
Edited by Brad King