lttng2: apply toolchain workarounds from pwoegere's meta-tracing

Signed-off-by: Christopher Larson <kergoth@gmail.com>
This commit is contained in:
Christopher Larson
2014-03-07 19:33:07 -07:00
parent bea0c577c8
commit 77b8d3f736
8 changed files with 134 additions and 0 deletions

View File

@@ -0,0 +1 @@
CFLAGS_append_arm = " -g -O0"

View File

@@ -0,0 +1,43 @@
From 26cb9d81e0dff472f3da338ab8b2de1cd77676a7 Mon Sep 17 00:00:00 2001
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Sun, 24 Nov 2013 03:31:44 -0500
Subject: [PATCH] Blacklist ARM gcc 4.8.0, 4.8.1, 4.8.2
It produces clobbered frame accesses, which can lead to stack corruption
when racing with signal handlers nested on stack.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
urcu/compiler.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/urcu/compiler.h b/urcu/compiler.h
index 19534f0..1e30903 100644
--- a/urcu/compiler.h
+++ b/urcu/compiler.h
@@ -108,4 +108,23 @@
#define CAA_ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+/*
+ * Don't allow compiling with buggy compiler.
+ */
+
+#ifdef __GNUC__
+# define URCU_GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+
+/*
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854
+ */
+# ifdef __ARMEL__
+# if URCU_GCC_VERSION >= 40800 && URCU_GCC_VERSION <= 40802
+# error Your gcc version produces clobbered frame accesses
+# endif
+# endif
+#endif
+
#endif /* _URCU_COMPILER_H */
--
1.8.3.4

View File

@@ -0,0 +1,25 @@
diff --git a/urcu/compiler.h b/urcu/compiler.h
index 1e30903..f38e49c 100644
--- a/urcu/compiler.h
+++ b/urcu/compiler.h
@@ -122,7 +122,19 @@
*/
# ifdef __ARMEL__
# if URCU_GCC_VERSION >= 40800 && URCU_GCC_VERSION <= 40802
-# error Your gcc version produces clobbered frame accesses
+# ifdef __CS_SOURCERYGXX_MAJ__
+# if __CS_SOURCERYGXX_MAJ__ < 2013
+# error Sourcery CodeBench 2013.11-32 or higher is required
+# endif
+# if __CS_SOURCERYGXX_MAJ__ == 2013 && __CS_SOURCERYGXX_MIN__ < 11
+# error Sourcery CodeBench 2013.11-32 or higher is required
+# endif
+# if __CS_SOURCERYGXX_MAJ__ == 2013 && __CS_SOURCERYGXX_MIN__ == 11 && __CS_SOURCERYGXX_REV__ < 32
+# error Sourcery CodeBench 2013.11-32 or higher is required
+# endif
+# else
+# error Your gcc version produces clobbered frame accesses
+# endif
# endif
# endif
#endif

View File

@@ -0,0 +1,6 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
SRC_URI_append_arm = "\
file://blacklist-arm-gcc-4.8.0-4.8.1-4.8.2.patch \
file://whitelist-sourcery-codebench-2013.11-32.patch \
"
EXTRA_OECONF_append_arm = " --disable-compiler-tls"

View File

@@ -0,0 +1,25 @@
Index: git/wrapper/compiler.h
===================================================================
--- git.orig/wrapper/compiler.h 2014-02-17 17:49:58.336081938 +0500
+++ git/wrapper/compiler.h 2014-02-17 18:13:37.632079922 +0500
@@ -34,7 +34,19 @@
*/
# ifdef __ARMEL__
# if GCC_VERSION >= 40800 && GCC_VERSION <= 40802
-# error Your gcc version produces clobbered frame accesses
+# ifdef __CS_SOURCERYGXX_MAJ__
+# if __CS_SOURCERYGXX_MAJ__ < 2013
+# error Sourcery CodeBench 2013.11-32 or higher is required
+# endif
+# if __CS_SOURCERYGXX_MAJ__ == 2013 && __CS_SOURCERYGXX_MIN__ < 11
+# error Sourcery CodeBench 2013.11-32 or higher is required
+# endif
+# if __CS_SOURCERYGXX_MAJ__ == 2013 && __CS_SOURCERYGXX_MIN__ == 11 && __CS_SOURCERYGXX_REV__ < 32
+# error Sourcery CodeBench 2013.11-32 or higher is required
+# endif
+# else
+# error Your gcc version produces clobbered frame accesses
+# endif
# endif
# endif
#endif

View File

@@ -0,0 +1,2 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
SRC_URI_append_arm = " file://whitelist-sourcery-codebench-2013.11-32.patch"

View File

@@ -0,0 +1,30 @@
diff --git a/src/common/consumer.c b/src/common/consumer.c
index ede214c..b10988b 100644
--- a/src/common/consumer.c
+++ b/src/common/consumer.c
@@ -1,3 +1,5 @@
+#pragma GCC optimize ("O1")
+
/*
* Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca>
* Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c
index d15329f..78c7725 100644
--- a/src/common/kernel-consumer/kernel-consumer.c
+++ b/src/common/kernel-consumer/kernel-consumer.c
@@ -1,3 +1,5 @@
+#pragma GCC optimize ("O1")
+
/*
* Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca>
* Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c
index 0955e66..0f8f75a 100644
--- a/src/common/ust-consumer/ust-consumer.c
+++ b/src/common/ust-consumer/ust-consumer.c
@@ -1,3 +1,5 @@
+#pragma GCC optimize ("O1")
+
/*
* Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca>
* Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

View File

@@ -0,0 +1,2 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
SRC_URI_append_arm = " file://compile-consumers-with-o1.patch"