-
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
Make official ChakraCore Linux binaries that work on all currently maintained versions of Linux #3494
Comments
@cosinusoidally cool! cc @obastemur since he's our xplat build expert @cosinusoidally do you have a stack trace for your crash? |
I understand making ChakraCore binaries available to older distros could be beneficial to some. Reminder; ChakraCore can be build from source code on older distros. (AFAIK) Concerns;
|
@digitalinfinity stack trace for official Linux x86_64 binary from here: https://github.com/Microsoft/ChakraCore/releases/tag/v1.7.0 This is running on a T5300 Core 2 Duo, see below flags from /proc/cpuinfo:
gdb session:
The crash above is on the pinsrq instruction, which is a SSE 4.1 instruction according to https://en.wikipedia.org/wiki/SSE4 Similarly my binary also crashes, but with my binary you actually need to run some js code first (I think it is because the version of
The |
Were you creating this binary on |
We could add a feature detection for given instruction yet if you were compiling on another machine with support to SSE 4.1, the result wouldn't be different. Optionally, we may add a build time argument for target arch compatibility level. i.e |
Yep, though the resultant binary works fine on machines with SSE 4.1 and 4.2 support, it will not work on the
I'll try and build a SSE2 copy of ChakraCore next week and let you know how I get on. If possible I will try and create a PR. |
@cosinusoidally any update on this? |
@obastemur proof of concept for the 1.7.x series is here https://github.com/cosinusoidally/ChakraCore-experiments/tree/master/build-chakracore . In that version I disable the |
@obastemur See commit cosinusoidally@055784b . I think the inline assembler will need some review by someone more knowledgeable than me. It seems to work and passes the test suite on a SSE4.2 based system and my old SSE2 only based system (but I am not 100% confident that my asm constraints are correct). I created inline assembly versions of all the required intrinsics (called There is also the question as to where the implemented intrisics should go. In my patch I simply put them in the files where they are required. In theory they should be inline functions insider a header somewhere. I'm not sure where the best place would be. |
This is is a follow on from #2278 . The currently available Linux ChakraCore binaries only work on some Linux distros. Ideally they would work on all (currently maintained) Linux distros.
I've put together a rough build system that is capable of generating such binaries (https://github.com/cosinusoidally/ChakraCore-experiments/tree/master/build-chakracore). It does this by generating a CentOS 6 based root filesystem, and building a copy of CMake 3.5.2 and Clang 3.8. It then uses CMake and Clang to build ChakraCore. Unfortunately there are still one or two manual steps since ChakraCore's CMakeFiles do not instruct the compiler to link to librt. I'm sure that would be easy to patch, but my knowledge of CMake is quite limited. My current work around is to manually invoke the compiler with "-lrt" appended to the command line (only 3 or 4 build steps error out, so this isn't too tedious to do).
I also noticed that the binary I built would crash on my Core 2 Duo based system. I was running a simple "Hello World" JavaScript script. The same binary did not crash on a Haswell based system. Any idea why that would be? I am guessing that you may be using SSE 4 instructions? If so, is it possible to build ChakraCore to target only SSE 2?
The text was updated successfully, but these errors were encountered: