-
Notifications
You must be signed in to change notification settings - Fork 0
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
new workflow: static linux binary #2
Comments
No ODE/Csound/OpenAL/SdlMixer on Alpine packages. But there is Bullet. Likely not for this project then. Although, I might try compiling it for it. |
Wondering if libstd would need to be build statically too.
|
Alpine packages https://pkgs.alpinelinux.org/packages |
https://gitlab.alpinelinux.org/alpine/aports/-/issues/12893
|
8 years ago Question about if it will be possible statically compile SDL with musl but dload() OpenGL compiled with glibc Answer was no (I think) https://musl.openwall.narkive.com/ODEqT9jH/dlopen-ing-glibc-linked-libraries |
https://blog.gibson.sh/2017/11/26/creating-portable-linux-binaries/ In general
About SDL2
About libstc++ and libc
Uses Debian 7. Which (GCC 4.7) can cause issues due being unable to compile newer c++ code. |
Trying this on azimut/water. Current problem both with SDL and ImageMagick is on the "step 3" when using the static-sbcl and the .core. SBCL tries to load again the libraries. This might be a problem with CFFI.
| Merged | github.com/cffi/cffi/pull/160 | EDIT: sidestepped the issue. Forking the lisp libraries (sdl,magickwand) and wrapping it with a (eval-when) and now it seems to work as long as STEP 1 (dumping .core) compiles these libraries for the first time. Only reason it works now is due actions/cache (lol) |
Error now is the same they have here, SDL can't initialize. utdemir/ghc-musl#14 (comment) Which leads back the alpine gitlab issue linked above (lol) where they tried compiling a C++ app too. I wonder if the issue is MUSL and not SDL (see musl.openwall.narkive.com link above) |
gdb'ing into this. I have 2 binaries:
Both SIGSEGV a lot:
Which is part of SBCL (!)
And finally this is how the callstack looks more or less...Initializes mouse/keyboard/main thread...but when it comes time to setup video...it knows it is X11...it tries to call dlopen("libX11.so.6") (the correct name for my system) but it fails
Which if we look at the source code...https://git.musl-libc.org/cgit/musl/tree/src/ldso/dlopen.c #include <dlfcn.h>
#include "dynlink.h"
static void *stub_dlopen(const char *file, int mode)
{
__dl_seterr("Dynamic loading not supported");
return 0;
}
weak_alias(stub_dlopen, dlopen); LMAO |
Due above. I will move to Ubuntu for now, later to an older ubuntu that 18 on a container. Something related I found is that SDL supports an override variable when is compiled statically. That is to dynamically load a different version of itself. |
Ubuntu (18/20) have some missing static .a of some libraries (seems like Alpine was more generous that I though). Confirmed lcms2 and lqr. So is on Fedora for lcms2. And also on Arch.
🙃 I don't want to be a OS mantainer. But...I might try Gentoo(kubler) which would also reduce the size of the binary/compilation time? Edit: another bad idea is using alpine for a DYNAMIC compiled binary. Raises 2 problems:
|
What a wild ride! I still need to learn more about daewok patch and linking in general. But there is already support for what I want from this in sbcl already https://gitlab.com/ralt/static-program-op I know less about what dark magic they use for it (they don't seem to use the .a version of the libraries!) Ultimately you end up with a binary that is only dynamically linked against LIBC and a few more libraries
While embedding (?) other .so libraries, which is good enough for me. If I build in in ubuntu 18.04 (it has glibc 2.27, circa 2018). |
https://github.com/daewok/sbcl/blob/static-executable-v2/README.static-executable
https://github.com/daewok/sbcl/blob/static-executable-v2/tools-for-build/Dockerfile.static-executable-example
Depends on #1
The text was updated successfully, but these errors were encountered: