]> xenbits.xensource.com Git - xen.git/commitdiff
tools/ocaml: Fix OCaml libs rules
authorAndrii Sultanov <andrii.sultanov@cloud.com>
Mon, 25 Nov 2024 11:13:18 +0000 (12:13 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 25 Nov 2024 11:13:18 +0000 (12:13 +0100)
This has been sat in the XenServer patchqueue for more than a decade.

Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
Acked-by: Christian Lindig <christian.lindig@cloud.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 8ffcf184affbc2ff1860dabe1757388509d5ed67
master date: 2024-08-23 10:48:52 +0100

tools/ocaml/Makefile.rules

index 0d3c6ac8394f8da06cf4b429c3bd6b0b62807c6f..5638193edf8a60e3a95cca609351940d021b04ab 100644 (file)
@@ -61,18 +61,18 @@ mk-caml-lib-bytecode = $(call quiet-command, $(OCAMLC) $(OCAMLCFLAGS) -a -o $1 $
 
 mk-caml-stubs = $(call quiet-command, $(OCAMLMKLIB) -o `basename $1 .a` $2,MKLIB,$1)
 mk-caml-lib-stubs = \
-       $(call quiet-command, $(AR) rcs $1 $2 && $(OCAMLMKLIB) -o `basename $1 .a | sed -e 's/^lib//'` $2,MKLIB,$1)
+       $(call quiet-command, $(OCAMLMKLIB) -o `basename $1 .a | sed -e 's/^lib//'` $2 $3,MKLIB,$1)
 
 # define a library target <name>.cmxa and <name>.cma
 define OCAML_LIBRARY_template
  $(1).cmxa: lib$(1)_stubs.a $(foreach obj,$($(1)_OBJS),$(obj).cmx)
        $(call mk-caml-lib-native,$$@, -cclib -l$(1)_stubs $(foreach lib,$(LIBS_$(1)),-cclib $(lib)), $(foreach obj,$($(1)_OBJS),$(obj).cmx))
  $(1).cma: $(foreach obj,$($(1)_OBJS),$(obj).cmo)
-       $(call mk-caml-lib-bytecode,$$@, -dllib dll$(1)_stubs.so -cclib -l$(1)_stubs, $$+)
+       $(call mk-caml-lib-bytecode,$$@, -dllib dll$(1)_stubs.so -cclib -l$(1)_stubs $(foreach lib,$(LIBS_$(1)),-cclib $(lib)), $$+)
  $(1)_stubs.a: $(foreach obj,$$($(1)_C_OBJS),$(obj).o)
        $(call mk-caml-stubs,$$@, $$+)
  lib$(1)_stubs.a: $(foreach obj,$($(1)_C_OBJS),$(obj).o)
-       $(call mk-caml-lib-stubs,$$@, $$+)
+       $(call mk-caml-lib-stubs,$$@, $$+, $(foreach lib,$(LIBS_$(1)),$(lib)))
 endef
 
 define OCAML_NOC_LIBRARY_template