> On 25 Oct 2023, at 14:52, Edwin Török <edvin.to...@citrix.com> wrote:
>
> From: Edwin Török <edwin.to...@cloud.com>
>
> The code currently uses GCC to compile OCaml C stubs directly,
> and although in most cases this works, it is not entirely correct.
>
> This will fail if the OCaml runtime has been recompiled to use and link with
> ASAN for example
> (or other situations where a flag needs to be used consistently in everything
> that is linked into the same binary).
>
> Use the OCaml compiler instead, which knows how to invoke the correct C
> compiler with the correct flags,
> and append the Xen specific CFLAGS to that instead.
>
> Drop the explicit -fPIC and -I$(ocamlc -where): these will now be provided by
> the compiler as needed.
>
> Use -verbose so we see the actuall full C compiler command line invocation
> done by the OCaml compiler.
>
> Signed-off-by: Edwin Török <edwin.to...@cloud.com>
Acked-by: Christian Lindig <christian.lin...@cloud.com>
I like using the OCaml compiler to compile stubs as it knows how to handle C
files and will invoke the C compiler with the correct flags. However, this is
the kind of change that would be good to have tested on all supported
platforms. I therefore invite comments from those who maintain the build
process.
— C