<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"><span style="font-size:0.75em;">I use the LIBRARY_PATH variable since the actual path contains spaces which break the make files</span></p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Below I try to supply paths A (via ENV) and B (via -L) to the linker, but only B (-L) is considered for the following '/usr/bin/lld-link' call</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">LIBRARY_PATH='A' /usr/bin/clang -fuse-ld=lld -target x86_64-pc-win32  -v -Wl,-machine:x64 -Wno-msvc-not-found -DNO_FSEEKO -DNO_STRERROR -DNO_vsnprintf -o example example.o -L. libz.a -L B                    </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">clang version 14.0.0 (/mnt/ssd/pikaur/build/llvm-git/llvm-project 75b08cce47df0a405bfb052f51d70b8e8067d705)</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Target: x86_64-pc-windows-msvc</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Thread model: posix</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">InstalledDir: /usr/bin</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"> "/usr/bin/lld-link" -out:example -defaultlib:libcmt -defaultlib:oldnames -libpath:lib/amd64 -libpath:atlmfc/lib/amd64 -libpath:. -libpath:B -nologo -machine:x64 example.o libz.a</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">lld-link: error: could not open 'libcmt.lib': No such file or directory</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">lld-link: error: could not open 'oldnames.lib': No such file or directory</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">clang-14: error: linker command failed with exit code 1 (use -v to see invocation)</p>
</body>
</html>