-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Xplat static library improvement v3 #2138
Xplat static library improvement v3 #2138
Conversation
This forces all symbols of each of the static libraries to load into libChakraCore.dylib. This will increase runtime size a little, but should hopefully prevent linker errors.
This will greatly reduce time required to rebuild and switch between static and shared libraries. Note: for Xcode/IOS, the force_load parameter is only good for the next library mentioned. This patch forces all of the existing libraries to get loaded into a single library libChakraCoreStatic, and hopefully also will make it to where libChakraCore has all the required symbols too.
Cmake currently does not allow for merging of multiple static libraries together unless someone uses objects. This should greatly improve
Not all platforms work well with case insensitive file paths. This fixes runtime on Linux partitions.
Hi @kphillisjr, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
A minor typo lead to the compile error. This should resolve the issue.
This should fix the Native linker targets for xplat.
@obastemur - Just as a heads up, Even though OSX failed this time, the current status has great improvement. The logs show that this is failing at the runtime tests. |
This should help prevent errors by ensuring that the complete static library is loaded and that no typos exist in the arguments.
There was an extra parenthisis in one of the cmake files that lead to build failure on OSX.
In future versions of CMake the leading/trailing whitespace will cause errors since the behavior is deprecated.
This merges Chakra.Jsrt into libChakraCoreStatic, and adds a new static library for GCStress called Chakra.Jsrt.Singular. This new library is simply the old method for linking Chakra.Jsrt under a new name.
The next couple of pushes will merge the various static libraries into the core libChakraCoreStatic library. |
This object is Consumed by the various other static libraries, and reduces the number of overall libraries lying around the build directory.
This gets rid of the Chakra.Pal object all together.
@kphillisjr We could use So basically we could merge them without making these changes. (but we shouldn't until we are in a better shape with global cons etc.) Second; this PR tries to combine the interfaces for shared and static libs under ChakraCore folder / project. This possibly improves the compile times for when someone compiles shared after static lib vice versa ? Please point me out if I'm missing other improvements and why this particular scenario is so important? Could you please share how this approach would help with our shared lib initialization problem ? As I mentioned many times; I really appreciate the effort but as long as there is no really good reason, I would go with |
This is a Definite yes, it greatly reduces the build time to switch between static and shared libraries... Actually right now due to the changes I made here, the total compile time to change from static build to shared build and back in a single go is under 30 seconds because the only item that gets rebuilt is the ch utility. Actually, with the build time being this small, it is possible to generate both a static ch utility ( say, ch.static ) and the regular ch utility, and have runtests.sh test both utilities one after another.
The other improvement by this approach is that there is less chance of bugs sneaking in by switching between static and shared libraries on xplat. Also, this fixes issue #1811 all together since the static symbol used internally by the static library is not defined out on xplat.
The new file Edit: I I went ahead and ran a few tests to see how the resulting files looked under this system and here is a short table showing how things fared on Ubuntu 16.04 LTS.
The build commands for these where... #Note: All of these are ran on Ubuntu 16.04 LTS (amd64)
./build.sh -n
./build.sh -n --static
./build.sh -n --debug
./build.sh -n --debug --static Edit 2: After some testing, it appears that using |
I would like to get this Integrated into the 2.0 release window for pull #2170. What changes would be needed to merge these changes. The biggest Improvements this offers is as follows...
|
@obastemur, I went ahead and rebased all of my changes on a new branch located at kphillisjr/ChakraCore at xplat_improvements_for_v2. These Changes are to address most of the problems designated in issue #1616. |
I've been using the work done which integrates this merge (along with those in #1616 ) and can verify this is working for me in a 3rd party static library capacity on linux x64 debug. (And is a little more idiomatic than the current cmake targets defined for a/the static library/libraries) |
This should greatly improve the static library handling/generation on Ubuntu 16.04 LTS, and OS X. I believe that the Force_Load option should help reduce the symbol issues on with OS X regardless of version.
Note: I have not tested these changes on OS X where ChakraCore is stored in a path with spaces, but the fix for this should be fairly easy.
V2: changes: attempt to fix compile/runtime errors with MSVC/OSX, and errors on native tests.
V3: Dropped conversion of existing static libraries to objects.