find_library: include get_linker_always_args in link args
The linker always args, as the name implies, should always be included. For
example, the AIX get_allow_undefined_link_args are a syntax error unless
the AIX get_linker_always_args are also used.
@@ -1033,7 +1033,7 @@ class CLikeCompiler:
if ((not extra_dirs and libtype is LibType.PREFER_SHARED) or
libname in self.internal_libs):
cargs = ['-l' + libname]
- largs = self.get_allow_undefined_link_args()
+ largs = self.get_linker_always_args() + self.get_allow_undefined_link_args()
extra_args = cargs + self.linker_to_compiler_args(largs)
if self.links(code, env, extra_args=extra_args, disable_cache=True)[0]:
