Skip to content

Commit

Permalink
[Support] Fix WS2_32 casing
Browse files Browse the repository at this point in the history
The file name is WS2_32.Lib in all the Windows SDK versions I looked at.
You can get away with the incorrect casing on a case-insensitive file
system but it can matter for cross-compilation.
  • Loading branch information
smeenai committed Dec 14, 2023
1 parent c60663d commit 042a2e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/Support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ endif()
if( MSVC OR MINGW )
# libuuid required for FOLDERID_Profile usage in lib/Support/Windows/Path.inc.
# advapi32 required for CryptAcquireContextW in lib/Support/Windows/Path.inc.
set(system_libs ${system_libs} psapi shell32 ole32 uuid advapi32 Ws2_32)
set(system_libs ${system_libs} psapi shell32 ole32 uuid advapi32 WS2_32)
elseif( CMAKE_HOST_UNIX )
if( HAVE_LIBRT )
set(system_libs ${system_libs} rt)
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/tools/llvm-config/system-libs.windows.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ RUN: llvm-config --link-static --system-libs Support 2>&1 | FileCheck %s
REQUIRES: static-libs
REQUIRES: host={{.*-windows-msvc}}
CHECK-NOT: -l
CHECK: psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib Ws2_32.lib{{$}}
CHECK: psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib WS2_32.lib{{$}}
CHECK-NOT: error
CHECK-NOT: warning

2 comments on commit 042a2e8

@mstorsjo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this fix probably fixed cross compilation with WinSDK, it still is broken with mingw, which consistently uses lowercase only. (Also note that lowercase is used consistently everywhere in the codebase as is; e.g. advapi32.lib is actually spelled AdvAPI32.Lib in the WinSDK.) I pushed a fix with a longer commit message about the situation, in 554e4df.

@smeenai
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.