[arch-commits] Commit in kernel26-lts/trunk (4 files)

andyrtr at archlinux.org andyrtr at archlinux.org
Sun May 9 17:46:28 UTC 2010


    Date: Sunday, May 9, 2010 @ 13:46:27
  Author: andyrtr
Revision: 79942

upgpkg: kernel26-lts 2.6.32.12-2
fix gcc45 issue making the kernel failing to boot; fix CONFIG_LOCALVERSION

Added:
  kernel26-lts/trunk/gcc45.patch
Modified:
  kernel26-lts/trunk/PKGBUILD
  kernel26-lts/trunk/config
  kernel26-lts/trunk/config.x86_64

---------------+
 PKGBUILD      |   17 +++++++----
 config        |    2 -
 config.x86_64 |    2 -
 gcc45.patch   |   85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 99 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-05-09 17:28:19 UTC (rev 79941)
+++ PKGBUILD	2010-05-09 17:46:27 UTC (rev 79942)
@@ -6,7 +6,7 @@
 _kernelname=${pkgname#kernel26}
 _basekernel=2.6.32
 pkgver=${_basekernel}.12
-pkgrel=1
+pkgrel=2
 arch=('i686' 'x86_64')
 license=('GPL2')
 url="http://www.kernel.org"
@@ -15,12 +15,16 @@
 	# the main kernel config files
         config config.x86_64
         # standard config files for mkinitcpio ramdisk
-        ${pkgname}.preset)
+        ${pkgname}.preset
+	# fix for gcc4.5 - Without this patch, the kernel fails to boot very early when built with gcc 4.5.
+	# upstream fix: http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.33.y.git;a=commit;h=89a724c83c09eb2d28df4dc150b6d17954f25d7b
+	gcc45.patch)
 md5sums=('260551284ac224c3a43c4adac7df4879'
          '9d097d34648a1734b1a7f97c5d000f03'
-         '65ef30a48b0dbb44c0ab5be142aae967'
-         'aa1bfd047735e8e817e0b357f99ea9e2'
-         'a13338958d1b241f8dfd4c6014cad3d4')
+         '8b8f963b6d9634045ed68dd3b67f056e'
+         '829f67374361f03635bf4ad2dc0a1db0'
+         'a13338958d1b241f8dfd4c6014cad3d4'
+         '657794e12367265505997bd29816eb54')
 
 build() {
   cd ${srcdir}/linux-$_basekernel
@@ -29,6 +33,9 @@
      patch -Np1 -i ${srcdir}/patch-$pkgver
    fi
 
+  # fix booting not possible when built with gcc4.5
+  patch  -Np1 -i ${srcdir}/gcc45.patch || return 1
+
   if [ "$CARCH" = "x86_64" ]; then
     cat ../config.x86_64 >./.config
   else

Modified: config
===================================================================
--- config	2010-05-09 17:28:19 UTC (rev 79941)
+++ config	2010-05-09 17:46:27 UTC (rev 79942)
@@ -63,7 +63,7 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-CONFIG_LOCALVERSION="-ARCH"
+CONFIG_LOCALVERSION="-lts"
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_HAVE_KERNEL_GZIP=y
 CONFIG_HAVE_KERNEL_BZIP2=y

Modified: config.x86_64
===================================================================
--- config.x86_64	2010-05-09 17:28:19 UTC (rev 79941)
+++ config.x86_64	2010-05-09 17:46:27 UTC (rev 79942)
@@ -64,7 +64,7 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-CONFIG_LOCALVERSION="-ARCH"
+CONFIG_LOCALVERSION="-lts"
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_HAVE_KERNEL_GZIP=y
 CONFIG_HAVE_KERNEL_BZIP2=y

Added: gcc45.patch
===================================================================
--- gcc45.patch	                        (rev 0)
+++ gcc45.patch	2010-05-09 17:46:27 UTC (rev 79942)
@@ -0,0 +1,85 @@
+From 89a724c83c09eb2d28df4dc150b6d17954f25d7b Mon Sep 17 00:00:00 2001
+From: Jeff Mahoney <jeffm at suse.com>
+Date: Wed, 24 Feb 2010 13:59:23 -0500
+Subject: [PATCH] tracing: Fix ftrace_event_call alignment for use with gcc 4.5
+
+commit 86c38a31aa7f2dd6e74a262710bf8ebf7455acc5 upstream.
+
+GCC 4.5 introduces behavior that forces the alignment of structures to
+ use the largest possible value. The default value is 32 bytes, so if
+ some structures are defined with a 4-byte alignment and others aren't
+ declared with an alignment constraint at all - it will align at 32-bytes.
+
+ For things like the ftrace events, this results in a non-standard array.
+ When initializing the ftrace subsystem, we traverse the _ftrace_events
+ section and call the initialization callback for each event. When the
+ structures are misaligned, we could be treating another part of the
+ structure (or the zeroed out space between them) as a function pointer.
+
+ This patch forces the alignment for all the ftrace_event_call structures
+ to 4 bytes.
+
+ Without this patch, the kernel fails to boot very early when built with
+ gcc 4.5.
+
+ It's trivial to check the alignment of the members of the array, so it
+ might be worthwhile to add something to the build system to do that
+ automatically. Unfortunately, that only covers this case. I've asked one
+ of the gcc developers about adding a warning when this condition is seen.
+
+Signed-off-by: Jeff Mahoney <jeffm at suse.com>
+LKML-Reference: <4B85770B.6010901 at suse.com>
+Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
+---
+ include/linux/syscalls.h |    6 ++++--
+ include/trace/ftrace.h   |    3 ++-
+ kernel/trace/trace.h     |    3 ++-
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+--- a/include/linux/syscalls.h	2010-05-09 16:06:26.067385302 +0000
++++ b/include/linux/syscalls.h.new	2010-05-09 16:13:05.394071388 +0000
+@@ -153,7 +153,8 @@
+ #define __SC_STR_TDECL6(t, a, ...)	#t, __SC_STR_TDECL5(__VA_ARGS__)
+ 
+ #define SYSCALL_TRACE_ENTER_EVENT(sname)				\
+-	static struct ftrace_event_call event_enter_##sname;		\
++	static struct ftrace_event_call					\
++	__attribute__((__aligned__(4))) event_enter_##sname;		\
+ 	struct trace_event enter_syscall_print_##sname = {		\
+ 		.trace                  = print_syscall_enter,		\
+ 	};								\
+@@ -189,7 +190,8 @@
+ 	}
+ 
+ #define SYSCALL_TRACE_EXIT_EVENT(sname)					\
+-	static struct ftrace_event_call event_exit_##sname;		\
++	static struct ftrace_event_call					\
++	__attribute__((__aligned__(4))) event_exit_##sname;		\
+ 	struct trace_event exit_syscall_print_##sname = {		\
+ 		.trace                  = print_syscall_exit,		\
+ 	};								\
+--- a/include/trace/ftrace.h	2010-05-09 16:06:26.074052099 +0000
++++ b/include/trace/ftrace.h.new	2010-05-09 16:15:29.113195266 +0000
+@@ -43,7 +43,8 @@
+ 		tstruct						\
+ 		char			__data[0];		\
+ 	};							\
+-	static struct ftrace_event_call event_##name
++	static struct ftrace_event_call			\
++	__attribute__((__aligned__(4))) event_##name
+ 
+ #undef __cpparg
+ #define __cpparg(arg...) arg
+--- a/kernel/trace/trace.h	2009-12-03 03:51:21.000000000 +0000
++++ b/kernel/trace/trace.h.new	2010-05-09 16:59:16.402901733 +0000
+@@ -746,7 +746,8 @@
+ 
+ #undef FTRACE_ENTRY
+ #define FTRACE_ENTRY(call, struct_name, id, tstruct, print)		\
+-	extern struct ftrace_event_call event_##call;
++	extern struct ftrace_event_call					\
++	__attribute__((__aligned__(4))) event_##call;
+ #undef FTRACE_ENTRY_DUP
+ #define FTRACE_ENTRY_DUP(call, struct_name, id, tstruct, print)		\
+ 	FTRACE_ENTRY(call, struct_name, id, PARAMS(tstruct), PARAMS(print))




More information about the arch-commits mailing list