Skip to content
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

[Relocatable] 7: Implement --enable-relative #162

Open
wants to merge 10 commits into
base: installation-tests
Choose a base branch
from

Conversation

dra27
Copy link
Owner

@dra27 dra27 commented Sep 24, 2024

PR sits on #158

@dra27 dra27 added the relocatable PRs related to the Relocatable Compiler project label Sep 24, 2024
@dra27 dra27 closed this Sep 25, 2024
@dra27 dra27 reopened this Sep 25, 2024
@dra27 dra27 force-pushed the enable-relative branch 2 times, most recently from 6e500a1 to 13d88d6 Compare September 25, 2024 12:28
@dra27 dra27 force-pushed the installation-tests branch 3 times, most recently from ca4085f to 27bb7a4 Compare September 29, 2024 10:28
@dra27 dra27 force-pushed the enable-relative branch 4 times, most recently from 9491cb7 to fd5eb89 Compare September 29, 2024 13:25
@dra27 dra27 force-pushed the installation-tests branch 2 times, most recently from 50b5af3 to 3f264c8 Compare September 29, 2024 20:27
@dra27 dra27 force-pushed the enable-relative branch 2 times, most recently from 8f9dc09 to a157b8b Compare September 29, 2024 21:07
@dra27 dra27 force-pushed the enable-relative branch 3 times, most recently from b1e4a3b to 10198ac Compare September 30, 2024 18:08
@dra27 dra27 force-pushed the installation-tests branch 2 times, most recently from 9ae7dfd to 3680fcf Compare October 3, 2024 20:13
@dra27 dra27 force-pushed the installation-tests branch 4 times, most recently from 4cf9c3f to 027d320 Compare October 18, 2024 12:32
@dra27 dra27 force-pushed the enable-relative branch 2 times, most recently from 4714b67 to 4fe33c5 Compare October 18, 2024 15:36
@dra27 dra27 force-pushed the enable-relative branch 2 times, most recently from e68b26a to ccc4851 Compare October 18, 2024 21:45
@dra27 dra27 force-pushed the installation-tests branch 2 times, most recently from ea49c99 to b236eec Compare October 19, 2024 09:01
@dra27 dra27 force-pushed the installation-tests branch 4 times, most recently from 510992a to 8491e08 Compare October 22, 2024 10:46
The Windows implementation caml_stat_strdup_to_utf16 returned NULL on
OOM, where caml_stat_strdup raises Out_of_memory. Windows implementation
fixed to raise Out_of_memory.

caml_stat_strdup_noexc_to_os to be used in the one place in the runtime
where NULL should in fact be returned.
Allows conversion of arbitrary char/wchar_t sequences by allowing the
number of characters copied to be specified. The output length of the
encoding can also be returned by these functions.
Computes the relative directory from --bindir to --libdir.
Returns an OCaml string as a char_os C string literal.
Converts an OCaml string in UTF-8 to a bytes consisting of the char_os
representation of that string.
When linking an executable, allows extra global string values to be
specified. In particular, this provides the ability to override
caml_standard_library_default.
When configured with --enable-relative, the runtime uses the directory
of the executable to determine the location of the Standard Library.
Thus, ocamlrun and the compilers look for ../lib/ocaml by default.

This is implemented by changing caml_standard_library_default to be a
relative path, and then computing the actual value at startup (for
bytecode) and when queried (for native, since it is only ever used if
Dynlink is being used).

Executables (and objects) produced by the compiler always have an
absolute value of caml_standard_library_default. ocamlc.opt and
ocamlopt.opt are built using -set-global-string to force
caml_standard_library_default to stay a relative value.
In native code, Sys.interpreter is simply Sys.executable_name, but in
bytecode it is the path to the actual interpreter (which will only be
Sys.executable_name for -custom or -output-complete-* programs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relocatable PRs related to the Relocatable Compiler project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant