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

Use compilerlibs instead of explicit lists of modules from the compiler #6195

Closed
vicuna opened this issue Sep 26, 2013 · 13 comments
Closed

Use compilerlibs instead of explicit lists of modules from the compiler #6195

vicuna opened this issue Sep 26, 2013 · 13 comments

Comments

@vicuna
Copy link

vicuna commented Sep 26, 2013

Original bug ID: 6195
Reporter: @alainfrisch
Status: confirmed (set by @xavierleroy on 2013-10-03T12:26:00Z)
Resolution: open
Priority: normal
Severity: feature
Target version: later
Category: configure and build/install

Bug description

Some tools which are part of the standard distribution (ocamldoc, ocamldebug, read_cmt, objinfo) embed some modules from the compiler. Instead of listing required modules explicitly, we could link against ocamlcommon.cma (and ocamlbytecomp.cma, if needed). This would simplify the Makefiles and make them more robust w.r.t. modifications of dependencies within compiler modules.

@vicuna
Copy link
Author

vicuna commented Oct 3, 2013

Comment author: @xavierleroy

Good idea. Any takers?

@vicuna
Copy link
Author

vicuna commented Oct 3, 2013

Comment author: @alainfrisch

ocamldoc: done. Note that it is compiled with -linkall (not sure why), so linking against ocamlcommon.cma includes some unused modules (mostly, the type-checker). I think we don't care.

@vicuna
Copy link
Author

vicuna commented Oct 3, 2013

Comment author: @xavierleroy

Note that it is compiled with -linkall (not sure why)

Because ocamldoc can dynamically load plugins, I think. (Hence all stdlib modules and all ocamldoc modules must be linked in.)

@vicuna
Copy link
Author

vicuna commented Oct 3, 2013

Comment author: @zoggy

Exactly.

@vicuna
Copy link
Author

vicuna commented Oct 3, 2013

Comment author: @alainfrisch

Note that ocamldoc modules are explicitly included (as opposed to linking odoc_info.cma + other modules). Point taken for the stdlib. This makes me wonder whether we should have a way to force including an entire library (i.e. -linkall restricted to a single library).

@vicuna
Copy link
Author

vicuna commented Sep 11, 2015

Comment author: @alainfrisch

read_cmt: done in commit 16417.

@vicuna
Copy link
Author

vicuna commented Nov 27, 2015

Comment author: @alainfrisch

This is about ongoing internal cleanup, not something blocking for 4.03.

@xavierleroy
Copy link
Contributor

If I'm not mistaken, only ocamldebug remains to be cleaned up?

@nojb
Copy link
Contributor

nojb commented Mar 17, 2019

I think ocamlobjinfo also remains to be treated.

@xavierleroy
Copy link
Contributor

Looking at tools/Makefile it seems like ocamlobjinfo links with compilerlibs. Am I missing something?

@nojb
Copy link
Contributor

nojb commented Mar 17, 2019

  • ocamlobjinfo still links against some individual modules of ocamloptcomp:

    ocaml/tools/Makefile

    Lines 327 to 335 in 798dc35

    OBJINFO=$(ROOTDIR)/compilerlibs/ocamlcommon.cma \
    $(ROOTDIR)/compilerlibs/ocamlbytecomp.cma \
    $(ROOTDIR)/compilerlibs/ocamlmiddleend.cma \
    $(ROOTDIR)/asmcomp/backend_var.cmo \
    $(ROOTDIR)/asmcomp/printclambda.cmo \
    $(ROOTDIR)/asmcomp/export_info.cmo \
    objinfo.cmo
    $(call byte_and_opt,ocamlobjinfo,$(OBJINFO),objinfo_helper$(EXE))

  • ocamlmktop also does not link against compiler-libs:

    ocaml/tools/Makefile

    Lines 167 to 172 in 798dc35

    OCAMLMKTOP=ocamlmktop.cmo
    OCAMLMKTOP_IMPORTS=config.cmo build_path_prefix_map.cmo misc.cmo \
    identifiable.cmo numbers.cmo arg_helper.cmo clflags.cmo \
    load_path.cmo ccomp.cmo
    $(call byte_and_opt,ocamlmktop,$(OCAMLMKTOP_IMPORTS) $(OCAMLMKTOP),)

  • ocamlprof:

    ocaml/tools/Makefile

    Lines 112 to 121 in 798dc35

    CSLPROF=ocamlprof.cmo
    CSLPROF_IMPORTS=config.cmo build_path_prefix_map.cmo misc.cmo identifiable.cmo \
    numbers.cmo arg_helper.cmo clflags.cmo terminfo.cmo \
    warnings.cmo location.cmo longident.cmo docstrings.cmo \
    syntaxerr.cmo ast_helper.cmo \
    camlinternalMenhirLib.cmo parser.cmo \
    pprintast.cmo \
    lexer.cmo parse.cmo
    $(call byte_and_opt,ocamlprof,$(CSLPROF_IMPORTS) profiling.cmo $(CSLPROF),)

  • and ocamlcp:

    ocaml/tools/Makefile

    Lines 123 to 127 in 798dc35

    ocamlcp_cmos = config.cmo build_path_prefix_map.cmo misc.cmo profile.cmo \
    warnings.cmo identifiable.cmo numbers.cmo arg_helper.cmo \
    clflags.cmo main_args.cmo
    $(call byte_and_opt,ocamlcp,$(ocamlcp_cmos) ocamlcp.cmo,)

@mshinwell
Copy link
Contributor

The ocamlobjinfo part of this will be fixed by my middle-end rearrangements (#2281 / #2288).

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants