Skip to contentSkip to conversation

tools: ocaml: do not try to link dynamic objects into .a libraries

PATCH In review Ian Campbell 2 participants 2 messages Mar 24, 2011 – Mar 31, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: ocaml: do not try to link dynamic objects into .a libraries

# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1300976665 0
# Node ID 32f2fffe8e2e0e2722d00a116adb28bdaa1aaabe
# Parent ca75b204dca4339dcdca4124bd010abe6604f616
tools: ocaml: do not try to link dynamic objects into .a libraries

lib<foo>_stubs.a was linking against $(LIBS_<foo>) which only includes dynamic linkage information which is not useful for a static library.

$(LIBS_<foo>) is still used when linking <foo>.cmxa

tools/ocaml/Makefile.rules +2 -2
diff -r ca75b204dca4 -r 32f2fffe8e2e tools/ocaml/Makefile.rules
@@ -54,7 +54,7 @@ mk-caml-lib-bytecode = $(call quiet-comm
 
 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//'` $3 $2,MKLIB,$1)
+	$(call quiet-command, $(AR) rcs $1 $2 && $(OCAMLMKLIB) -o `basename $1 .a | sed -e 's/^lib//'` $2,MKLIB,$1)
 
 # define a library target <name>.cmxa and <name>.cma
 define OCAML_LIBRARY_template
@@ -65,7 +65,7 @@ define OCAML_LIBRARY_template
  $(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,$$@, $$+, $(LIBS_$(1)))
+	$(call mk-caml-lib-stubs,$$@, $$+)
 endef
 
 define OCAML_NOC_LIBRARY_template