Skip to content

Commit

Permalink
Fix dynlink build
Browse files Browse the repository at this point in the history
  • Loading branch information
mshinwell committed Dec 13, 2022
1 parent 3e46daf commit a6d5796
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions otherlibs/dynlink/Makefile
Expand Up @@ -193,20 +193,22 @@ $(LOCAL_SRC)/%.cmx: $(LOCAL_SRC)/%.ml

# Rules for building the [Dynlink_compilerlibs] bytecode and native packs
# from their components.

# The dynlink_compilerlibs.cmi file is unfortunately written by both the ocamlc
# and ocamlopt invocations. The resulting files are different, probably because
# of sharing differences. Writing an .mli file would be problematic. Instead
# we allow the compiler to generate the inferred .cmi upon the ocamlc
# invocation, then trick it (by touching dynlink_compilerlibs.cmi) upon the
# ocamlopt invocation, which causes it to use the ocamlc-generated .cmi.
dynlink_compilerlibs.cmi: $(COMPILERLIBS_CMO)
rm -f dynlink_compilerlibs.mli
$(OCAMLC) $(COMPFLAGS) -pack -o dynlink_compilerlibs.cmo $(COMPILERLIBS_CMO)

dynlink_compilerlibs.cmo: dynlink_compilerlibs.cmi

dynlink_compilerlibs.cmx: $(COMPILERLIBS_CMX)
dynlink_compilerlibs.cmx: $(COMPILERLIBS_CMX) dynlink_compilerlibs.cmi
touch dynlink_compilerlibs.mli
$(OCAMLOPT) $(COMPFLAGS) $(OPTCOMPFLAGS) -pack -o $@ $(COMPILERLIBS_CMX)

# Rules for building the interface of the [Dynlink_compilerlibs] packs.
# To avoid falling foul of the problem described below, the .cmo and .cmx
# files for the dynlink-specific compilerlibs packs generated here---and in
# particular the corresponding .cmi files -- are kept in separate directories.

# The main dynlink rules start here.

extract_crc := extract_crc$(EXE)
Expand Down

0 comments on commit a6d5796

Please sign in to comment.