[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 7 of 7 v2] x86: explicitly mark __initdata variables as used when building with clang


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Tim Deegan <tim@xxxxxxx>
  • Date: Thu, 5 Apr 2012 16:51:56 +0100
  • Delivery-date: Thu, 05 Apr 2012 16:09:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

# HG changeset patch
# User Tim Deegan <tim@xxxxxxx>
# Date 1333640955 -3600
# Node ID 51174f350092962ad36e406adf7ae1f173330a37
# Parent  fba1917c638768c0a4e45c507c29f1020e08dfc1
x86: explicitly mark __initdata variables as used when building with clang.

This stops LLVM from replacing it with a different, auto-generated
variable as part of an optimization.  (The auto-generated variable
ends up in the normal data section.)

Remove stray __read_mostly annotations on declarations that this unmasked.

Signed-off-by: Tim Deegan <tim@xxxxxxx>

diff -r fba1917c6387 -r 51174f350092 xen/arch/x86/oprofile/op_x86_model.h
--- a/xen/arch/x86/oprofile/op_x86_model.h      Thu Apr 05 16:49:15 2012 +0100
+++ b/xen/arch/x86/oprofile/op_x86_model.h      Thu Apr 05 16:49:15 2012 +0100
@@ -53,6 +53,6 @@ extern struct op_x86_model_spec const op
 void arch_perfmon_setup_counters(void);
 
 extern int ppro_has_global_ctrl;
-extern struct op_x86_model_spec const *__read_mostly model;
+extern struct op_x86_model_spec const *model;
 
 #endif /* OP_X86_MODEL_H */
diff -r fba1917c6387 -r 51174f350092 xen/include/acpi/cpufreq/cpufreq.h
--- a/xen/include/acpi/cpufreq/cpufreq.h        Thu Apr 05 16:49:15 2012 +0100
+++ b/xen/include/acpi/cpufreq/cpufreq.h        Thu Apr 05 16:49:15 2012 +0100
@@ -22,7 +22,7 @@
 
 DECLARE_PER_CPU(spinlock_t, cpufreq_statistic_lock);
 
-extern bool_t __read_mostly cpufreq_verbose;
+extern bool_t cpufreq_verbose;
 
 struct cpufreq_governor;
 
diff -r fba1917c6387 -r 51174f350092 xen/include/xen/compiler.h
--- a/xen/include/xen/compiler.h        Thu Apr 05 16:49:15 2012 +0100
+++ b/xen/include/xen/compiler.h        Thu Apr 05 16:49:15 2012 +0100
@@ -14,7 +14,13 @@
 #define always_inline __inline__ __attribute__ ((always_inline))
 #define noinline      __attribute__((noinline))
 
+#ifdef __clang__
+/* Clang can replace some vars with new automatic ones that go in .data;
+ * mark all explicit-segment vars 'used' to prevent that. */
+#define __section(s)      __attribute_used__ __attribute__((__section__(s)))
+#else
 #define __section(s)      __attribute__((__section__(s)))
+#endif
 #define __used_section(s) __attribute_used__ __attribute__((__section__(s)))
 #define __text_section(s) __attribute__((__section__(s)))
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.