You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 282 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Hello,
there seems to be a problem with the order in which C-flags are passed
when linking against libraries that store them implicitly. E.g.:
This indicates that "../../lib" should be used as library-path before
any other paths. However, "pcre.cma" contains implicit C-options that
add "/raid/user/markus/local/lib/ocaml/contrib" to the library-path.
Unfortunately, "ocamlc" passes these implicit arguments to gcc before
the paths specified on the command line (verbose output):
As you see, "-L../../lib" comes after "-L*/contrib", which shouldn't
happen. The problem here is that the "contrib"-directory also contains
a (different) implementation of "lacaml" against "gcc" will mistakenly
link now, possibly causing a link error or (even worse) creating a binary
that can behave in unpredictable ways.
Maybe I don't really understand the way in which things work, but I think
that "ocamlc" should pass C-options implicitly stored in libraries in a
different order (respecting the order of command line flags) to prevent
the problem above.
there seems to be a problem with the order in which C-flags are passed
when linking against libraries that store them implicitly. E.g.:
Maybe I don't really understand the way in which things work, but I think
that "ocamlc" should pass C-options implicitly stored in libraries in a
different order (respecting the order of command line flags) to prevent
the problem above.
I agree with that. This is fixed in the working sources. Thanks for
the bug report.
Original bug ID: 282
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Hello,
there seems to be a problem with the order in which C-flags are passed
when linking against libraries that store them implicitly. E.g.:
ocamlc -verbose
-I ../../lib
-ccopt -L../../lib
bigarray.cma lacaml.cma
-I /raid/user/markus/local/lib/ocaml/contrib pcre.cma
-o lin_reg
lin_reg.cmo
This indicates that "../../lib" should be used as library-path before
any other paths. However, "pcre.cma" contains implicit C-options that
add "/raid/user/markus/local/lib/ocaml/contrib" to the library-path.
Unfortunately, "ocamlc" passes these implicit arguments to gcc before
the paths specified on the command line (verbose output):
gcc -o lin_reg
-I/raid/user/markus/local/lib/ocaml
-L/raid/user/markus/local/lib/ocaml/contrib
-L../../lib
/tmp/camlprim0.c
-L../../lib
-L/raid/user/markus/local/lib/ocaml/contrib
-L/raid/user/markus/local/lib/ocaml
-lpcre -llacaml -llapack_myXerbla
-lblas_myXerbla -lf2c_noMain -lbigarray -lcamlrun -lm -lcurses
As you see, "-L../../lib" comes after "-L*/contrib", which shouldn't
happen. The problem here is that the "contrib"-directory also contains
a (different) implementation of "lacaml" against "gcc" will mistakenly
link now, possibly causing a link error or (even worse) creating a binary
that can behave in unpredictable ways.
Maybe I don't really understand the way in which things work, but I think
that "ocamlc" should pass C-options implicitly stored in libraries in a
different order (respecting the order of command line flags) to prevent
the problem above.
Best regards,
Markus Mottl
--
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl
The text was updated successfully, but these errors were encountered: