-
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
Don't disable dynlink in -static switches #14664
Conversation
🌤️ opam-lint warnings 124dc1f
☀️ Installability check (+6)
|
Thanks for this, and apologies for not taking a look sooner.
Also, thanks for the explanation. I had been confused a bit about musl's dynamic loading support. I didn't notice that musl has two
For some reason, I understood that musl did not support dynamic loading at all. But I was obviously wrong. In summary, these changes are perfectly fine. But they raise a different question. Since these variants now allow for both dynamic and static linking against musl libc, shouldn't we remove the |
Is this switch intended for distributions that ship with GCC by default? I've been successfully using Also, this switch does not build on Alpine Linux as it is, since Alpine does not have a |
For what it's worth, the original ocaml-variants package included both with +static and without +static: #2025 |
@kit-ty-kate good point. Plus the |
@osener That's correct, these switches are intended for static compilation on platforms that use glibc by default, but allow you to install a musl toolchain separately (Debian, Arch Linux, …). On Alpine, you can continue using a regular switch. The size difference might have been due to the
I'm a bit wary about removing switches that people might be using. I'll leave the old switches with the fix and add new +musl switches. The last remaining difference (from the original MR) between the +musl+static and the +musl switches is then that in the former, the OCaml compiler itself is compiled statically. |
These switches can be still be used to statically link, but don't statically link on the OCaml compiler itself.
Something else I found: Starting in 4.09, you will be able to create a musl switch simply by setting Previously this didn't work unless you had X11 header files in your musl toolchain to compile graphslib. graphs was moved out of the compiler recently, fixing this issue. |
This should be good to merge from my point of view. Any objections/questions? |
No objection. I think the |
I think this cleans up confusion, I am going to merge |
This removes the
-no-shared-libs
flag from the configuration of static switches. Note that this switch doesn't produce static binaries by default, only when-ccopt -static
is passed toocamlopt
.This fixes #14663 and backtracking/ocamlgraph#80 (verified by running
opam install ppx_deriving ocamlgraph
). It's also related to #3608.One downside of this change is that it replace a compile-time error (
Dynlink
isn't built when-no-shared-libs
is configured) with a run-time error (Failure "Dynamic loading not supported"
). This only affects executables compiled with-ccopt -static
.cc @etanol