llvm / llvm/llvm-project

[LLVMSupport] module static link zstd error.

Open
#223,320 2 comments 0 reactions 0 assignees View on GitHub
build-problem cmake llvm:support
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

In the released precompiled file “clang+llvm-23.1.1-x86_64-pc-windows-msvc.tar.zst,” the “LLVMSupport” module statically links the zstd library, but it still requires the user to provide the zstd library, which must be statically linked. This results in duplicate symbol definitions, and when using the MSVC compiler, the following error messages is displayed:
```bash
LINK: warning LNK4098: The default library “MSVCRT” conflicts with other libraries; please use /NODEFAULTLIB:library [E:\test\test_clang_ast\build\my_tool.vcxproj]
LINK : warning LNK4217: The symbol “calloc” (defined in “LLVMSupport.lib(rpmalloc.c.obj)”) has already been defined by “zstd_static.lib(zstd_compress.obj)” (in the function “ZSTD_createCCtxParams”
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the link failure with clang+llvm-23.1.1-x86_64-pc-windows-msvc.tar.zst, LLVMSupport.lib, and zstd_static.lib under MSVC. Read the LLVMSupport packaging and static-link configuration to determine why zstd is both included and required from the user. Done means the duplicate-symbol and MSVCRT warnings no longer occur for this usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.