Description: compile the bin_prot.xen C stubs with the standard C flags
 The xen/dune foreign_stubs stanza replaces the default flags with the
 flags coming from xen/cflags.sh (pkg-config mirage-xen --cflags). Using
 (:include cflags.sexp) on its own drops the :standard set provided by
 dune (ocamlc_cflags/ocamlc_cppflags, which contain -fPIC), so
 xen/blit_stubs.o was compiled as non position independent code. Linking
 the shared stub library then fails on architectures with strict
 relocations (e.g. arm64/riscv64) with
   relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol
   `__stack_chk_guard' ... can not be used when making a shared object;
   recompile with -fPIC
 Keep :standard so that these stubs are compiled with the same standard
 flags (including -fPIC) as the src/ stubs already are; the cflags coming
 from the mirage-xen pkg-config file are still passed through.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Origin: vendor
Forwarded: no
Last-Update: 2026-10-19
--- bin-prot-0.17.0.orig/xen/dune
+++ bin-prot-0.17.0/xen/dune
@@ -9,7 +9,8 @@
  (foreign_stubs
   (language c)
   (flags
-   (:include cflags.sexp)))
+   (:standard
+    (:include cflags.sexp))))
  (name bin_prot_xen)
  (public_name bin_prot.xen)
  (optional)
