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
Fix some globally-visible names, and add a tool for them #973
Conversation
That Spacetime variable was to ensure that a particular object file wasn't dropped by the linker, but I will have to remind myself of the details. (It's just possible that it's redundant now.) I'm not sure I agree with the comment on Mantis about the macros etc. not causing a problem; there's been at least one report of names clashing there (presumably because people want to use the OCaml headers and another library together, which isn't unreasonable). |
tools/check-symbol-names
Outdated
|
||
nm -A -P "$@" | awk ' | ||
# ignore caml_foo, camlFoo_bar, and linker-internal _foo | ||
$2 ~ /^(caml[_A-Z]|_)/ { next } |
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.
It would be nice if this script worked on the Mac as well.
At the moment I don't think it will, since all of the symbols on such platform start with an underscore...
For the moment I suggest prefixing the Spacetime variable as well. |
bbefdd6
to
ad11c79
Compare
Namespaced spacetime variable as well. The tool now supports OS X as well. |
ad11c79
to
3e65a3f
Compare
This is OK, I don't know why Travis failed. |
I restarted Travis and it passed. |
* Cleanup Map Functor Applications - Remove unused modules - Replace local strings maps with globally defined one * Put string map inside project String * Formatting --------- Co-authored-by: Cuihtlauac ALVARADO <cuihtmlauac@tarides.com>
PR#1956 is about externally-linked names not prefixed with
caml_
, which can break other software. Since that issue was created, a couple more have snuck in (e.g.invert_root
incompare.c
).This commit fixes those names, and adds
tools/check-symbol-names
to check for others. It may be a good idea to add:as a step in the build, but I'll leave that step for someone else.
(The only remaining offending symbol (i.e. externally visible, not prefixed with "caml", and not "main") is
ensure_spacetime_dot_o_is_included
, whose function I don't really understand (despite the descriptive name). Does anyone know why this is necessary? @mshinwell?)