Is it expected that compiling C stubs with ocamlc
and ocamlopt
yields two different C invocations ?
> ocamlopt '-verbose' '-c' '-g' src/zstd/bytesrw_zstd_stubs.c
+ gcc -O2 -fno-strict-aliasing -fwrapv -pthread -D_FILE_OFFSET_BITS=64 -c -g -I'/home/debian/.opam/default/lib/ocaml' 'src/zstd/bytesrw_zstd_stubs.c'
> ocamlc '-verbose' '-c' '-g' src/zstd/bytesrw_zstd_stubs.c
+ gcc -O2 -fno-strict-aliasing -fwrapv -fPIC -pthread -D_FILE_OFFSET_BITS=64 -c -g -I'/home/debian/.opam/default/lib/ocaml' 'src/zstd/bytesrw_zstd_stubs.c'
The lack of -fPIC
in the first case makes ocamlmklib
fail.
> ocaml --version
The OCaml toplevel, version 5.3.0
> gcc --version
gcc (Debian 12.2.0-14) 12.2.0