Skip to content

Turn on response files in cmake toolchain file - #2359

Closed
mhenschel wants to merge 3 commits into
emscripten-core:incomingfrom
mhenschel:master
Closed

mhenschel wants to merge 3 commits into
emscripten-core:incomingfrom
mhenschel:master

Conversation

@mhenschel

Copy link
Copy Markdown
Contributor

This fixes issue #2295

I think the individual CMAKE_C/CXX_ARCHIVE_CREATE and CMAKE_C/CXX_ARCHIVE_APPEND directives are not necessary anymore. I think they used to be necessary because CMAKE_AR was not set correctly as a cache variable before.
The CMAKE_C/CXX_CREATE_STATIC_LIBRARY calls are required to force cmake to use response files for objects. This is necessary because cmake has a hard coded limit for the command line which does not work well for windows because emscripten uses bat files to call the compiler and bat files have a maximum command line length that is smaller than the general limit for windows executables.

I was thinking about turning on response files for windows only but I didn't see a reason not to enable them for the other platforms emscripten runs on.

I ran the tests but had 12 failures. But I think if something in the cmake toolchain file would be wrong there would have been more of them right?

I think the individual CMAKE_*_ARCHIVE_CREATE and CMAKE_*_ARCHIVE_APPEND directives are not necessary anymore. I think they used to be necessary because CMAKE_AR was not set correctly as a cache variable before. 
The CMAKE_*_CREATE_STATIC_LIBRARY calls are required to force cmake to use response files for objects. This is necessary because cmake has a hard coded limit for the command line which will not work well for windows because emscripten uses bat files to call the compiler  and bat files have a maximum command line length that is smaller than the general limit for windows executables.
@juj

juj commented May 16, 2014

Copy link
Copy Markdown
Collaborator

Thanks! I think the existing CMake test does not test archives, what did you use for test setup? Would you be able to extend the existing test_cmake test to confirm that this functionality works?

Try checking out the incoming/master branch before your commit and rerun the test suite to cross-reference that there are no new failures that you see. In particular the test other.test_cmake is important here.

@mhenschel

Copy link
Copy Markdown
Contributor Author

Back from vacation. I tried to run other.test_cmake on incoming but I have a hard time getting everything to work even without my patch. I tried using emsdk but I could only get the 1.16 release running. My change doesn't seem to break other.test_cmake there. But if I try to use emscripten-incoming I get an error message that there is a mismatch between emscripten 1.18 and llvm,clang. I think this means I will have to build everything from source right?

@kripken

kripken commented May 27, 2014

Copy link
Copy Markdown
Member

Yes, see https://github.com/kripken/emscripten/wiki/LLVM-Backend - we need a custom LLVM+clang build currently. If it's hard for you to set up though then we can merge this and see the test results on the bots, assuming @juj is confident things will pass?

@juj

juj commented May 27, 2014

Copy link
Copy Markdown
Collaborator

I think we need an extended test for cmake with static linking and generation of archives, since even if this succeeds or fails, I'm sure the current tests will not catch this. I can give a look at adding a test for this next week earliest, or if you have one prepared @mhenschel , that'd be great too.

@mhenschel

Copy link
Copy Markdown
Contributor Author

I want to try to get the incoming branch working and I will also try to create a test for archives with cmake. I'll report back if I run into any issues I cannot resolve myself.

@mhenschel

Copy link
Copy Markdown
Contributor Author

I think I fucked up with this pull request. I'll recreate it with a dedicated branch so things don't get fucked up so easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants