| Issue |
162879
|
| Summary |
Running the libc++ Benchmarks on Windows with MinGW
|
| Labels |
libc++
|
| Assignees |
|
| Reporter |
c8ef
|
I'm attempting to run a libc++ benchmark on Windows MinGW using the latest `mstorsjo/llvm-mingw` toolchain.
Initially, executing `./bin/llvm-lit.py a.bench` resulted in an ld.lld error:
```
ld.lld: error: undefined symbol: __declspec(dllimport) benchmark::internal::InitializeStreams()
>>> referenced by C:/Users/xxx/AppData/Local/Temp/sort_heap-a87419.o:(__cxx_global_var_init)
NOTE: a relevant symbol '_ZN9benchmark8internal17InitializeStreamsEv' is available in C:/Users/xxx/Desktop/llvm-project/build/libcxx/test/benchmarks/google-benchmark/lib/libbenchmark.a but cannot be used because it is not an import library.
```
After some searching, I added the `-DBENCHMARK_STATIC_DEFINE` flag. However, a new error occurred:
```
ld.lld: error: undefined symbol: __declspec(dllimport) SHGetValueA
>>> referenced by libbenchmark.a(sysinfo.cc.obj):(benchmark::CPUInfo::CPUInfo())
clang-21: error: linker command failed with exit code 1 (use -v to see invocation)
```
Adding `-lShlwapi` finally resolved the issue.
Since I'm not a Windows/MinGW expert, I was wondering if there's a way to make running the benchmark work out of the box.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs