Skip to content

Commit

Permalink
Revert ocaml#124
Browse files Browse the repository at this point in the history
`-L/path/to/gmp/lib` must be passed as is to `ocamlmklib`, not behind a `-ldopt` flag, otherwise it is ignored in static linking situations.
  • Loading branch information
xavierleroy committed Jul 19, 2023
1 parent 94f674e commit 9a7e053
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions project.mak
Original file line number Diff line number Diff line change
@@ -62,8 +62,6 @@ TOINSTALL += $(CMIDOC)
OCAMLFLAGS += -bin-annot
endif

MKLIBLDFLAGS = $(foreach flag, $(LDFLAGS), -ldopt $(flag))

# build targets
###############

@@ -73,16 +71,16 @@ tests:
make -C tests test

zarith.cma: $(MLSRC:%.ml=%.cmo)
$(OCAMLMKLIB) $(DEBUG) -failsafe -o zarith $+ $(LIBS) $(MKLIBLDFLAGS)
$(OCAMLMKLIB) $(DEBUG) -failsafe -o zarith $+ $(LIBS) $(LDFLAGS)

zarith.cmxa: $(MLSRC:%.ml=%.cmx)
$(OCAMLMKLIB) $(DEBUG) -failsafe -o zarith $+ $(LIBS) $(MKLIBLDFLAGS)
$(OCAMLMKLIB) $(DEBUG) -failsafe -o zarith $+ $(LIBS) $(LDFLAGS)

zarith.cmxs: zarith.cmxa libzarith.$(LIBSUFFIX)
$(OCAMLOPT) -shared -o $@ -I . zarith.cmxa -linkall

libzarith.$(LIBSUFFIX): $(CSRC:%.c=%.$(OBJSUFFIX))
$(OCAMLMKLIB) $(DEBUG) -failsafe -o zarith $+ $(LIBS) $(MKLIBLDFLAGS)
$(OCAMLMKLIB) $(DEBUG) -failsafe -o zarith $+ $(LIBS) $(LDFLAGS)

zarith_top.cma: zarith_top.cmo
$(OCAMLC) $(DEBUG) -o $@ -a $<

0 comments on commit 9a7e053

Please sign in to comment.