obazl / rules_ocaml

A Bazel Language Support Package for OCaml
https://obazl.github.io/docs_obazl
Apache License 2.0
32 stars 7 forks source link

ocaml-generated cc command wierdness #32

Open mobileink opened 3 years ago

mobileink commented 3 years ago

The cc command generated by the ocamlopt native compiler sometimes includes stuff that causes ld warnings. An example is the demo demos/cli/sys.argv:kitty in https://github.com/obazl/dev_obazl, which adds -Lcore for reasons unknown.

Task: eliminate such stuff

INFO: From native compiling ocaml_executable: demos//cli/sys.argv:kitty:
+ clang -arch x86_64 -Wno-trigraphs -c  -o '/var/folders/wz/dx0cgvqx5qn802qmc3d4hcfr0000gq/T/camlstartupf4518a.o' '/var/folders/wz/dx0cgvqx5qn802qmc3d4hcf
r0000gq/T/camlstartupd2d4d9.s'
+ cc -O2 -fno-strict-aliasing -fwrapv -Wall -fno-common -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE   -Wl,-no_compact_unwind -o 'bazel-out/darwi
n-fastbuild/bin/cli/sys.argv/kitty'  '-L/Users/gar/.opam/4.10/lib/ocaml/../ocamlgraph' '-L/Users/gar/.opam/4.10/lib/ocaml/../ocaml' '-L/Users/gar/.opam/4.
10/lib/ocaml/../re' '-L/Users/gar/.opam/4.10/lib/ocaml/../re/str' '-L/Users/gar/.opam/4.10/lib/ocaml/../uutf' '-L/Users/gar/.opam/4.10/lib/ocaml/../jsonm'
 '-L/Users/gar/.opam/4.10/lib/ocaml/../opam-lib' '-L/Users/gar/.opam/4.10/lib/ocaml/threads' '-L/Users/gar/.opam/4.10/lib/ocaml' -Lcore/ '/var/folders/wz/
dx0cgvqx5qn802qmc3d4hcfr0000gq/T/camlstartupf4518a.o' '/Users/gar/.opam/4.10/lib/ocaml/../ocaml/std_exit.o' 'bazel-out/darwin-fastbuild/bin/cli/sys.argv/K
itty.o' '/Users/gar/.opam/4.10/lib/ocaml/../opam-lib/opam-core.a' '/Users/gar/.opam/4.10/lib/ocaml/../jsonm/jsonm.a' '/Users/gar/.opam/4.10/lib/ocaml/../u
utf/uutf.a' '/Users/gar/.opam/4.10/lib/ocaml/../re/str/re_str.a' '/Users/gar/.opam/4.10/lib/ocaml/../re/re.a' '/Users/gar/.opam/4.10/lib/ocaml/../ocaml/un
ix.a' '/Users/gar/.opam/4.10/lib/ocaml/../ocamlgraph/graph.a' '/Users/gar/.opam/4.10/lib/ocaml/../ocaml/stdlib.a' '-lunix' '/Users/gar/.opam/4.10/lib/ocam
l/../ocaml/libasmrun.a' -lm
ld: warning: directory not found for option '-Lcore/'