[llvm-bugs] [Bug 42531] New: clang-cl /Gv __vectorcall failed to link Windows API

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jul 7 17:02:24 PDT 2019


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

            Bug ID: 42531
           Summary: clang-cl /Gv __vectorcall failed to link Windows API
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zufuliu at 163.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

The sample code failed to link when build with /Gv (LLVM 9.0.0-r363781).

// test.cpp
#include <windows.h>

int main(int argc, char* argv[]) {
    return lstrcmpA(argv[0], argv[1]);
}

clang-cl /Gv test.cpp
test-d27210.obj : error LNK2019: unresolved external symbol __imp_lstrcmpA@@16
referenced in function main
test.exe : fatal error LNK1120: 1 unresolved externals
clang-cl: error: linker command failed with exit code 1120 (use -v to see
invocation)

but build succeeded with /Gd (__cdecl), /Gr (__fastcall), /Gz (__stdcall) or
without any option.

prototype for lstrcmpA() is at Windows
Kits\10\Include\10.0.17763.0\um\WinBase.h line 2676:
WINBASEAPI
int
WINAPI
lstrcmpA(
    _In_ LPCSTR lpString1,
    _In_ LPCSTR lpString2
    );

-- 
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/20190708/2628f746/attachment.html>


More information about the llvm-bugs mailing list