]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
xsm: add bodge when compiling with llvm coverage support
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 13 Feb 2018 16:55:43 +0000 (17:55 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 13 Feb 2018 16:55:43 +0000 (17:55 +0100)
llvm coverage support seems to disable some of the optimizations
needed in order to compile xsm, and the end result is that references
to __xsm_action_mismatch_detected are left in the object files.

Since coverage support cannot be used in production, introduce
__xsm_action_mismatch_detected for llvm coverage builds.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
xen/include/xsm/dummy.h

index d6ddadcafdc09240760c2a5dd40677a31c879da8..466bbcbde8d5e814e08896cbac39814c14411dd2 100644 (file)
  * if references remain at link time.
  */
 #define LINKER_BUG_ON(x) do { if (x) __xsm_action_mismatch_detected(); } while (0)
+
+#if defined(CONFIG_COVERAGE) && defined(__clang__)
+/*
+ * LLVM coverage support seems to disable some of the optimizations needed in
+ * order for XSM to compile. Since coverage should not be used in production
+ * provide an implementation of __xsm_action_mismatch_detected to satisfy the
+ * linker.
+ */
+static inline void __xsm_action_mismatch_detected(void)
+{
+    ASSERT_UNREACHABLE();
+}
+#else
 /* DO NOT implement this function; it is supposed to trigger link errors */
 void __xsm_action_mismatch_detected(void);
+#endif
 
 #ifdef CONFIG_XSM