[llvm-bugs] [Bug 35476] New: LLD cannot find library file linked via #pragma comment(lib)

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 29 20:40:11 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35476

            Bug ID: 35476
           Summary: LLD cannot find library file linked via #pragma
                    comment(lib)
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: zturner at google.com
                CC: llvm-bugs at lists.llvm.org, llvm at inglorion.net,
                    rnk at google.com, ruiu at google.com

I found this when trying to configure a self-host build of LLVM which includes
the LLDB subproject, and when forces the use of lld via CMake.

It should be easy to create a trivial repro, but for now this is what I have.

1. Build clang and lld into some folder called foo.

2. Configure another build of LLVM with the following CMake arguments.

cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lld;lldb"
-DLLVM_TARGETS_TO_BUILD=X86 -DPYTHON_HOME=C:\Python35
-DCMAKE_C_COMPILER=foo/clang-cl.exe -DCMAKE_CXX_COMPILER=foo/clang-cl.exe
-DCMAKE_LINKER=foo/lld-link.exe <source-path>

When you build this, at the link step we can see it trying to run this command:

[1/1] Linking CXX shared library bin\liblldb.dll
FAILED: bin/liblldb.dll lib/liblldb.lib
cmd.exe /C "cd . && "C:\Program Files (x86)\CMake\bin\cmake.exe" -E vs_link_dll
--intdir=tools\lldb\source\API\CMakeFiles\liblldb.dir --manifests  --
E:\src\llvmbuild\ninja-release-x64\bin\lld-link.exe /nologo
@CMakeFiles/liblldb.rsp  /out:bin\liblldb.dll /implib:lib\liblldb.lib
/pdb:bin\liblldb.pdb /dll /version:6.0 /machine:X86 /MANIFEST:NO /debug
/INCREMENTAL   && cd ."
E:\src\llvmbuild\ninja-release-x64\bin\lld-link.exe: error: could not open
python35_d.lib: no such file or directory
LINK failed. with 1
ninja: build stopped: subcommand failed.


If we run that exact same command, replacing lld-link.exe with the path to the
Microsoft linker, it works.

python is special as the library is not specified on the command line, but in
one of the python header files via a #pragma comment.  

As mentioned, it should be easy to create a simple repro, but I'm just
recording the full steps I went through so this issue doesn't get lost.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171130/68f46ccf/attachment.html>


More information about the llvm-bugs mailing list