From 77b8d3f73624ee0c5f3f24929d910a32e598c80c Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Fri, 7 Mar 2014 19:33:07 -0700 Subject: [PATCH] lttng2: apply toolchain workarounds from pwoegere's meta-tracing Signed-off-by: Christopher Larson --- .../lttng/babeltrace_1.1.1.bbappend | 1 + .../blacklist-arm-gcc-4.8.0-4.8.1-4.8.2.patch | 43 +++++++++++++++++++ ...telist-sourcery-codebench-2013.11-32.patch | 25 +++++++++++ .../lttng/liburcu_0.8.1.bbappend | 6 +++ ...telist-sourcery-codebench-2013.11-32.patch | 25 +++++++++++ .../lttng/lttng-modules_2.4.0.bbappend | 2 + .../compile-consumers-with-o1.patch | 30 +++++++++++++ .../lttng/lttng-tools_2.4.0.bbappend | 2 + 8 files changed, 134 insertions(+) create mode 100644 core/recipes-kernel/lttng/babeltrace_1.1.1.bbappend create mode 100644 core/recipes-kernel/lttng/liburcu/blacklist-arm-gcc-4.8.0-4.8.1-4.8.2.patch create mode 100644 core/recipes-kernel/lttng/liburcu/whitelist-sourcery-codebench-2013.11-32.patch create mode 100644 core/recipes-kernel/lttng/liburcu_0.8.1.bbappend create mode 100644 core/recipes-kernel/lttng/lttng-modules/whitelist-sourcery-codebench-2013.11-32.patch create mode 100644 core/recipes-kernel/lttng/lttng-modules_2.4.0.bbappend create mode 100644 core/recipes-kernel/lttng/lttng-tools/compile-consumers-with-o1.patch create mode 100644 core/recipes-kernel/lttng/lttng-tools_2.4.0.bbappend diff --git a/core/recipes-kernel/lttng/babeltrace_1.1.1.bbappend b/core/recipes-kernel/lttng/babeltrace_1.1.1.bbappend new file mode 100644 index 0000000..e278105 --- /dev/null +++ b/core/recipes-kernel/lttng/babeltrace_1.1.1.bbappend @@ -0,0 +1 @@ +CFLAGS_append_arm = " -g -O0" diff --git a/core/recipes-kernel/lttng/liburcu/blacklist-arm-gcc-4.8.0-4.8.1-4.8.2.patch b/core/recipes-kernel/lttng/liburcu/blacklist-arm-gcc-4.8.0-4.8.1-4.8.2.patch new file mode 100644 index 0000000..39357af --- /dev/null +++ b/core/recipes-kernel/lttng/liburcu/blacklist-arm-gcc-4.8.0-4.8.1-4.8.2.patch @@ -0,0 +1,43 @@ +From 26cb9d81e0dff472f3da338ab8b2de1cd77676a7 Mon Sep 17 00:00:00 2001 +From: Mathieu Desnoyers +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 +--- + 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 diff --git a/core/recipes-kernel/lttng/liburcu/whitelist-sourcery-codebench-2013.11-32.patch b/core/recipes-kernel/lttng/liburcu/whitelist-sourcery-codebench-2013.11-32.patch new file mode 100644 index 0000000..9c831b8 --- /dev/null +++ b/core/recipes-kernel/lttng/liburcu/whitelist-sourcery-codebench-2013.11-32.patch @@ -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 diff --git a/core/recipes-kernel/lttng/liburcu_0.8.1.bbappend b/core/recipes-kernel/lttng/liburcu_0.8.1.bbappend new file mode 100644 index 0000000..8799162 --- /dev/null +++ b/core/recipes-kernel/lttng/liburcu_0.8.1.bbappend @@ -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" diff --git a/core/recipes-kernel/lttng/lttng-modules/whitelist-sourcery-codebench-2013.11-32.patch b/core/recipes-kernel/lttng/lttng-modules/whitelist-sourcery-codebench-2013.11-32.patch new file mode 100644 index 0000000..9d27da1 --- /dev/null +++ b/core/recipes-kernel/lttng/lttng-modules/whitelist-sourcery-codebench-2013.11-32.patch @@ -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 diff --git a/core/recipes-kernel/lttng/lttng-modules_2.4.0.bbappend b/core/recipes-kernel/lttng/lttng-modules_2.4.0.bbappend new file mode 100644 index 0000000..1e0168b --- /dev/null +++ b/core/recipes-kernel/lttng/lttng-modules_2.4.0.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +SRC_URI_append_arm = " file://whitelist-sourcery-codebench-2013.11-32.patch" diff --git a/core/recipes-kernel/lttng/lttng-tools/compile-consumers-with-o1.patch b/core/recipes-kernel/lttng/lttng-tools/compile-consumers-with-o1.patch new file mode 100644 index 0000000..110f653 --- /dev/null +++ b/core/recipes-kernel/lttng/lttng-tools/compile-consumers-with-o1.patch @@ -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 + * Mathieu Desnoyers +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 + * Mathieu Desnoyers +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 + * Mathieu Desnoyers diff --git a/core/recipes-kernel/lttng/lttng-tools_2.4.0.bbappend b/core/recipes-kernel/lttng/lttng-tools_2.4.0.bbappend new file mode 100644 index 0000000..d7581b6 --- /dev/null +++ b/core/recipes-kernel/lttng/lttng-tools_2.4.0.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +SRC_URI_append_arm = " file://compile-consumers-with-o1.patch"