The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Reduce the dependencies of native-code Dynlink

Currently, both the bytecode version and the native-code version of
Dynlink drag in many modules from the compiler, including some that
use compressed marshaling. This causes users of dynlink.cmxa to
depend on -lzstd systematically.

Actually, the native-code version of Dynlink needs much fewer compiler
modules, none of which require compressed marshaling.

This commit just shrinks the list of compiler modules included in
dynlink.cmxa, thus cutting the dependency on -lzstd.

(cherry picked from commit c6d6e8b426d3bbd8a8ccf3eb6f5d9aa6a2a56b7f)

+17 -2
+17 -2
otherlibs/dynlink/Makefile
··· 35 35 OPTCOMPFLAGS += -O3 36 36 endif 37 37 38 - COMPFLAGS += -I byte 38 + %.cmo: COMPFLAGS += -I byte 39 + %.cmi: COMPFLAGS += -I byte 39 40 OPTCOMPFLAGS += -I native 40 41 41 42 LOCAL_SRC=dynlink_compilerlibs ··· 126 127 bytecomp/meta.ml \ 127 128 bytecomp/symtable.ml 128 129 130 + # For the native-code version of this library, we need much fewer modules 131 + MINI_COMPILERLIBS_INTFS=\ 132 + file_formats/cmxs_format.mli 133 + 134 + MINI_COMPILERLIBS_SOURCES=\ 135 + utils/binutils.ml \ 136 + utils/config.ml \ 137 + utils/build_path_prefix_map.ml \ 138 + utils/misc.ml 139 + 129 140 # Rules to make a local copy of the .ml and .mli files required. We also 130 141 # provide .ml files for .mli-only modules---without this, such modules do 131 142 # not seem to be located by the type checker inside bytecode packs. ··· 171 182 COMPILERLIBS_COPIED_SOURCES_INTFS=\ 172 183 $(addsuffix i, $(COMPILERLIBS_COPIED_SOURCES)) 173 184 185 + MINI_COMPILERLIBS_COPIED_SOURCES=\ 186 + $(addprefix $(LOCAL_SRC)/, $(notdir $(MINI_COMPILERLIBS_SOURCES))) \ 187 + $(addprefix $(LOCAL_SRC)/, $(notdir $(MINI_COMPILERLIBS_INTFS))) 188 + 174 189 # $(LOCAL_SRC)/Makefile uses the variables above in dependencies, so must be 175 190 # include'd after they've been defined. 176 191 -include $(LOCAL_SRC)/Makefile ··· 179 194 # that the resulting .cm{o,x} files can be packed. 180 195 181 196 COMPILERLIBS_CMO=$(COMPILERLIBS_COPIED_SOURCES:.ml=.cmo) 182 - COMPILERLIBS_CMX=$(COMPILERLIBS_COPIED_SOURCES:.ml=.cmx) 197 + COMPILERLIBS_CMX=$(MINI_COMPILERLIBS_COPIED_SOURCES:.ml=.cmx) 183 198 184 199 $(LOCAL_SRC)/%.cmi: $(LOCAL_SRC)/%.mli 185 200 $(V_OCAMLC)$(OCAMLC) -c -for-pack Dynlink_compilerlibs $(COMPFLAGS) \