Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 521

Dune compilation with -output-obj

$
0
0

Here is my dune file:

(executable
 (name binding)
 (modules binding)
 (libraries xxx)
 (modes
  (native object))
 ;(ocamlopt_flags (-output-obj))
 (promote
  (until-clean)
  (into .)))

This compiles, but doesn’t work later in my process.

The problem is that line

Running[3]: (cd _build/default && /home/xo/.opam/5.1.1/bin/ocamlopt.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62@67@69-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -o binding.exe.o -output-complete-obj /home/xo/.opam/5.1.1/lib/xxx/xxx.cmxa .binding.eobjs/native/dune__exe__Binding.cmx)

I need to change the -output-complete-obj into -output-obj for it to work.
(I build the .so later in my process)

About my attempts:

  • The commented line doesn’t work as the .cmx compilation needs the flag out
  • Just in case, the -output-complete-obj version fails on next step because I need a -fPIC version (which I link with libasmrun_pic.a as a matter of fact) Maybe there’s another workaround considering that…

Also, for reference, my working compilation line I want to reproduce in dune is:

opam exec -- ocamlfind ocamlopt -package xxx -linkpkg -output-obj -o binding.o binding.ml

5 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 521

Trending Articles