CreateProcess failing when compiling with Clang on Windows

226 views
Skip to first unread message

Alex Humphrey

unread,
Feb 25, 2021, 3:38:39 PM2/25/21
to skia-discuss
I am unable to compile & build Skia on Windows anymore using Clang. When attempting to compile dynamically I get the error:

FAILED: pathkit.lib
"C:/dev/tools/llvm-project/llvm/build/Debug/bin/lld-link.exe" /lib /nologo /ignore:4221  /OUT:pathkit.lib @pathkit.lib.rsp
CreateProcess failed: The system cannot find the file specified.
ninja: fatal: ReadFile: The handle is invalid.

When compiling statically I get the error:

FAILED: expat.lib
"C:/dev/tools/llvm-project/llvm/build/Debug/bin/lld-link.exe" /lib /nologo /ignore:4221  /OUT:expat.lib @expat.lib.rsp
CreateProcess failed: The system cannot find the file specified.
ninja: fatal: ReadFile: The handle is invalid.

The gn gen command I have used is:

bin/gn gen out/debug --args='is_official_build=true skia_use_system_expat=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_system_icu=false skia_use_system_harfbuzz=false win_vc="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC" target_cpu="x64" cc="clang" cxx="clang++" clang_win="C:/dev/tools/llvm-project/llvm/build/Debug" extra_cflags=["/MTd"]' --ide="vs"

What I do not understand is that on a different PC I have used Clang to build without issue. I have rebuilt Clang multiple times as well as started from scratch multiple times too and I can not find any reason that anything would be different. Any help is much appreciated as I'm at my wit's end.

K. Moon

unread,
Feb 25, 2021, 4:49:17 PM2/25/21
to skia-d...@googlegroups.com
The error message is telling you that "C:/dev/tools/llvm-project/llvm/build/Debug/bin/lld-link.exe" can't be found. First thing would be to check that the file actually exists, and is executable.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/f1c1a397-9c5e-4817-8176-fa9af34ec898n%40googlegroups.com.

Alex Humphrey

unread,
Feb 25, 2021, 5:42:05 PM2/25/21
to skia-discuss
I should have clarified, the file is not there, however when checking the clang build dir on the PC that I previously used to make a build the file is not present there either. I was able to make a build on that PC and have redownloaded & built Clang multiple times and that file still isn't showing. I have followed the exact same process on both PCs.

K. Moon

unread,
Feb 25, 2021, 6:07:55 PM2/25/21
to skia-d...@googlegroups.com
If it's not using the tool as part of the build, maybe there's something slightly different about the two build configurations?

I think you should be able to do a diff between the generated build.ninja and toolchain.ninja files, and maybe there'll be an obvious difference.

Another thing you can try is that Ninja has a debug tool for dumping the command lines it tries to run. Maybe check those as well.

Reply all
Reply to author
Forward
0 new messages