Dune: adding -custom flag when linking only the byte executable

dune

#1

I’m have successfully moved a big project that I work with to Dune. The only thing I haven’t figure out how to do is how to pass the “-custom” flag when linking bytecode.

I have an executable, and I want to be able of producing both: native and bytecode (for debugging purposes).
I tried adding “(link_flags -custom)” which works, but the native fails to link since it does not accept the “-custom” flag.

Is there any way of passing linking flags to the bytecode build only?


#2

This combination is not supported at the moment. Could you open a ticket on github.com/ocaml/dune to track this issue?

BTW, why do you need to always build the byte-code in custom mode? This is usually not recommended.


#3

Thanks! I’ll create the issue.

We had to use “-custom” to workaround other possible bug. I’m not sure if it’s dune or ocaml. The project we are building has a bunch of external (static and dynamic) libraries. Not passing -custom produces lots of linking errors. I’ll have to dig deeper into that to find the cause.