-
Notifications
You must be signed in to change notification settings - Fork 6
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
Static vs. dynamic linkage of packaged executable #42
Comments
A note "just in case" The patch:
bigdecimal-patch.h
|
Is the bigdecimal patch the only patch needed for static complication? Thanks. |
Then comes the issue with native extensions referencing symbols in core Ruby and those symbols are not exported in case of static compilation. We observe it here: #41 Then there is an issue with extensions that link dynamically the libraries that we link statically. For example, pthread. A project with such extension would compile, link and start but may crash. I think we observe it here: #38 |
The notion of "static/dynamic" here is a little obscure because we can actually carry libraries in the tebako image? For example, an extension that links dynamically to an optional system library, we could carry that system library in the tebako image. |
The Apple situation may mean that the best approach is a custom compiled/patched Ruby, not dissimilar to how Linux distros all have their own compiled versions. |
The issue with sassc (metanorma/packed-mn#147) shows that it is even more complex
|
Original requirement for tebako was to have it statically linked in order to make packaged executable portable.
After several attempts to implement this requirement and some research thi issue summarizes related findings.
Obstacles
Enforcing -fvisibility=default does not help, presumably due to some conditional defines in C code.
(these are live warning from ld building tebako static executable)
Other implementations
Ruby-packer and ocra(??) create dynamically linked applications.
Ruby-packer links statically libraries and objects that are likely to be missing or require upgrade or downgrade (for example, squashfs, ncurses, openssl, ...) but links dynamically to widely used system modules (pthread, dl or glibc)
According to @ronaldtse
Proposed/implemented solution
When packaged solution is linked selection of static libraries is enforced in ruby-packer style - for the libraries that are likely to be missing or require upgrade or downgrade at end-user environment.
System libraries are linked dynamically:
The list above is managable and can be reduced further if more time is inveseted in experiments. Now the list allows to eliminated known issues with native extensions that were observed with static linking.
The text was updated successfully, but these errors were encountered: