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
Add -config option to ocamlrun #9284
Conversation
Exposes the logic for parsing OCAMLLIB, etc. in dynlink.c
Renamed to caml_parse_ld_conf
Similar to ocamlc/ocamlopt -config, displays the information pertinent to the bytecode runtime only. Also displays the search path for shared stub libraries, which means the entire command line is parsed in order to include any -I flags.
13150f4
to
e7ddac3
Compare
The AFL bit looks good to me! |
cec137f
to
3ad11ff
Compare
3ad11ff
to
eaab3b2
Compare
I've broken this PR up into parts in a bid to get it merged. This PR also includes #10098 and #10101 which need merging first. Note that this PR works without #10103 (since if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More nitpicking on the parts that have not been sliced off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, once all the various PRs are put back together.
Rebased, squashed, extra bits removed and ready for a CI-approving merge, thanks! |
The main purpose of this PR is to add a
-config
option toocamlrun
similar to the one already inocamlc
/ocamlopt
. This is loosely related to the work I'm doing with relocating the compiler, but independent enough to push it now - it's obviously non-urgent.ocamlrun -config
gives output like:Options are exactly the same as
ocamlc -config
, with four exceptions:supports_afl
indicates that the runtime has the shared memory support for execution with AFL, which is independent of using a compiler which had AFL instrumentation turned on for a particular build. cc @stedolan to ensure I got the detail of that correctshared_libs_path
which contains the contents ofcaml_shared_libs_path
after parsingld.conf
and any-I
parameters on the command line (this is the feature I particularly wanted).no_naked_pointers
andprofinfo
/profinfo_width
There's also a little shopping list of other things related to
ocamlrun
's argument parsing:--
so you can now have bytecode programs which begin with-
if you, um, want-Ifoo
as-I foo
(previously, this was interpreted as-I
puts
instead ofprintf("%s\n", …)
in a few places instartup_byt.c
-backtrace
was equivalent to-b
--backtrace
is now an error).ocamlrun -I
(indicate that-I
expects a<dir>
rather than that no bytecode file was specified).-help
/--help