Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add project that produces a static library version of ChakraCore #279

Open
ninlar opened this issue Feb 8, 2016 · 5 comments
Open

Add project that produces a static library version of ChakraCore #279

ninlar opened this issue Feb 8, 2016 · 5 comments

Comments

@ninlar
Copy link
Contributor

ninlar commented Feb 8, 2016

When creating projects that target PaaS offerings in Azure such as Service Fabric or Classic Worker Roles, it is more desirable to have a version of ChakraCore that can be statically linked.
In addition it would be nice if the static library also statically linked its dependencies such as the MSVC runtime. This prevents users from having to create VM Extensions that deploy these dependencies.

@EdMaurer
Copy link
Contributor

This is not the only time we've heard interest in this.

@jianchun
Copy link

One problem is that we have initialization/termination code attached to DLL_Process/Thread _Attach/Detach. To offer a static lib, we may need new explicit initialize/terminate hosting APIs.

@curtisman
Copy link
Contributor

You can build ChakraCore with MSVC dependency statically linked with the msbuild build flag /p:RuntimeLib=static_library.

As for ChakraCore as a static library, we can convert the attach/detach initialization into global object ctor initialization (or __declspec(thread) object with ctor/dtor for thread attach/detach)

@curtisman curtisman removed the Bug label Feb 10, 2016
@ninlar
Copy link
Contributor Author

ninlar commented Feb 11, 2016

Ah I see. That's why using lib.exe to combine all the dependencies into single lib didn't work. I assume the static library could also leave out the test hooks.

@yihonglyu
Copy link

yihonglyu commented Oct 29, 2016

Is there any way to use runtests.cmd with static built ch.exe? I build ch.exe by command 'msbuild /p:Platform=x64 /p:Configuration=Test /p:BuildJIT=False /p:RuntimeLib=static_library /p:AdditionalPreprocessorDefinitions=CHAKRA_STATIC_LIBRARY=1 .\Build\Chakra.Core.sln' and have no idea how to run the regression test. It seems that command line handling mechanism is commented under static build.

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

No branches or pull requests

7 participants