As we now support LDFLAGS in NATIVECCLINKOPTS it can happen that -Wl,--foo,--bar option is in that variable As ocaml happens to call ld with NATIVECCLINKOPTS we have to "translate" it so that ld doesn't bail out with unrecognized option Initial patch from Julien Cristau : http://caml.inria.fr/mantis/view.php?id=4142 Modified a bit to catch comma separated options Index: ocaml-3.10.0/Makefile =================================================================== --- ocaml-3.10.0.orig/Makefile +++ ocaml-3.10.0/Makefile @@ -316,6 +316,8 @@ partialclean:: rm -f ocaml toplevel/toplevellib.cma # The configuration file +comma = , +Wl = -Wl, utils/config.ml: utils/config.mlp config/Makefile @rm -f utils/config.ml @@ -326,8 +328,8 @@ utils/config.ml: utils/config.mlp config -e 's|%%BYTELINK%%|$(BYTECC) $(BYTECCLINKOPTS)|' \ -e 's|%%NATIVECC%%|$(NATIVECC) $(NATIVECCCOMPOPTS)|' \ -e 's|%%NATIVELINK%%|$(NATIVECC) $(NATIVECCLINKOPTS)|' \ - -e 's|%%PARTIALLD%%|$(PARTIALLD) $(NATIVECCLINKOPTS)|' \ - -e 's|%%PACKLD%%|$(PARTIALLD) $(NATIVECCLINKOPTS) -o |' \ + -e 's|%%PARTIALLD%%|$(PARTIALLD) $(subst $(comma), ,$(subst $(Wl),,$(NATIVECCLINKOPTS)))|' \ + -e 's|%%PACKLD%%|$(PARTIALLD) $(subst $(comma), ,$(subst $(Wl),,$(NATIVECCLINKOPTS))) -o |' \ -e 's|%%BYTECCLIBS%%|$(BYTECCLIBS)|' \ -e 's|%%NATIVECCLIBS%%|$(NATIVECCLIBS)|' \ -e 's|%%RANLIBCMD%%|$(RANLIBCMD)|' \