Missing path separators in llvm-ar on Windows

141 views
Skip to first unread message

Floh

unread,
Jan 20, 2017, 6:09:47 AM1/20/17
to emscripten-discuss
Hi,

I'm having a build problem with the following setup:

- compiling on Windows7 (OSX and Linux works fine)
- emscripten incoming
- cmake to generate ninja files (since I didn't get make to work properly on Windows)
- ninja to build

The problem happens both in PowerShell and the normal DOS shell when creating the static library files, it looks like path separators are lost in llvm-ar, e.g.:

[122/332] Linking CXX static library code\foundation\libfoundation.a
C:/n3h5/fips-sdks/win/emsdk_portable/clang/fastcomp/build_incoming_vs2013_64/RelWithDebInfo/bin\llvm-ar: codefoundationCMakeFilesfoundation.dirappapplication.cc.o: no such file or directory.
[325/332] Linking CXX static library code\render\librender.a
C:/n3h5/fips-sdks/win/emsdk_portable/clang/fastcomp/build_incoming_vs2013_64/RelWithDebInfo/bin\llvm-ar: coderenderCMakeFilesrender.dirapprenderrenderapplication.cc.o: no such file or directory.

Note how the path before the "no such file of directory" has no path separators. 

Has anybody seen this problem on Windows?

Thanks!
-Floh.




Floh

unread,
Jan 20, 2017, 6:56:14 AM1/20/17
to emscripten-discuss
I'm suspecting the problem is in the Windows version of ninja or cmake's ninja generator. Using make from a cygwin bash works for creating the library fails, but than fails later with "command line too long" when trying to build library files from a couple hundred source files.

 (╯°□°)╯︵ ┻━┻

If I happen to find a solution I'll report back :)
-Floh.

キャロウ マーク

unread,
Jan 20, 2017, 9:58:07 AM1/20/17
to emscripten-discuss
I think the problem is that a Windows style path (back slashes) is being passed to a program expecting Unix style paths (forward slashes). In cygwin the classic solution to this is to use cygpath to change the style of the path.

Regards

-Mark

Floh

unread,
Jan 23, 2017, 3:20:20 AM1/23/17
to emscripten-discuss
Ok, I worked around the ninja problem by compiling with make on Windows, make however required linker/archiver "response files" to get around the command line length limit on Windows. 

The cmake toolchain file in the emscripten SDK (under cmake/Modules/Platform) has all the necessary cmake settings to use response files with make, the details are outlined in this old ticket: https://github.com/kripken/emscripten/issues/2295

Cheers!
-Floh.

Charles Vaughn

unread,
Jan 24, 2017, 2:17:18 PM1/24/17
to emscripten-discuss
Sounds like you may have run into a problem I've hit as well. We've got some internal changes that work around this, but we were hesitant about upstreaming them since it didn't seem to be impacting anyone else. Our local emar looks like this, if it finds an rsp file, it then reformats the path escapes

Reply all
Reply to author
Forward
0 new messages