From d435b565eae66fdc6ca0b2d0321ea9b8e5a90cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=A4chler?= Date: Sun, 26 Jan 2014 08:54:46 +0000 Subject: [PATCH] Fix broken symbols - this allows us to boot on i686 again! --- ...cc-alias-instead-of-assembler-aliase.patch | 68 +++++++++++++++++++ PKGBUILD | 9 ++- 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch diff --git a/0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch b/0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch new file mode 100644 index 0000000..c4242e0 --- /dev/null +++ b/0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch @@ -0,0 +1,68 @@ +From 83460ec8dcac14142e7860a01fa59c267ac4657c Mon Sep 17 00:00:00 2001 +From: Andi Kleen +Date: Tue, 12 Nov 2013 15:08:36 -0800 +Subject: [PATCH] syscalls.h: use gcc alias instead of assembler aliases for + syscalls + +Use standard gcc __attribute__((alias(foo))) to define the syscall aliases +instead of custom assembler macros. + +This is far cleaner, and also fixes my LTO kernel build. + +Signed-off-by: Andi Kleen +Cc: Al Viro +Cc: Geert Uytterhoeven +Cc: Tetsuo Handa +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +--- + include/linux/compat.h | 4 ++-- + include/linux/syscalls.h | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/include/linux/compat.h b/include/linux/compat.h +index 345da00..ada34c9 100644 +--- a/include/linux/compat.h ++++ b/include/linux/compat.h +@@ -41,14 +41,14 @@ + COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__) + + #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ +- asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ ++ asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\ ++ __attribute__((alias(__stringify(compat_SyS##name)))); \ + static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ + asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__));\ + asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))\ + { \ + return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \ + } \ +- SYSCALL_ALIAS(compat_sys##name, compat_SyS##name); \ + static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)) + + #ifndef compat_user_stack_pointer +diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h +index 7fac04e..c27f846 100644 +--- a/include/linux/syscalls.h ++++ b/include/linux/syscalls.h +@@ -184,7 +184,8 @@ extern struct trace_event_functions exit_syscall_print_funcs; + + #define __PROTECT(...) asmlinkage_protect(__VA_ARGS__) + #define __SYSCALL_DEFINEx(x, name, ...) \ +- asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ ++ asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ ++ __attribute__((alias(__stringify(SyS##name)))); \ + static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ + asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ + asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ +@@ -194,7 +195,6 @@ extern struct trace_event_functions exit_syscall_print_funcs; + __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ + return ret; \ + } \ +- SYSCALL_ALIAS(sys##name, SyS##name); \ + static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)) + + asmlinkage long sys_time(time_t __user *tloc); +-- +1.8.5.3 + diff --git a/PKGBUILD b/PKGBUILD index 91e7573..415dae3 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -24,7 +24,8 @@ source=("http://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz" '0003-nfs-check-if-gssd-is-running-before-attempting-to-us.patch' '0004-rpc_pipe-remove-the-clntXX-dir-if-creating-the-pipe-.patch' '0005-sunrpc-add-an-info-file-for-the-dummy-gssd-pipe.patch' - '0006-rpc_pipe-fix-cleanup-of-dummy-gssd-directory-when-no.patch') + '0006-rpc_pipe-fix-cleanup-of-dummy-gssd-directory-when-no.patch' + '0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch') md5sums=('0ecbaf65c00374eb4a826c2f9f37606f' 'ba4468d313adfaf22368add7f58204aa' '035bb27dac306f5c028d96cad14bb249' @@ -36,7 +37,8 @@ md5sums=('0ecbaf65c00374eb4a826c2f9f37606f' '7cbd2349cdf046acc37b652c06ba36be' '10dbaf863e22b2437e68f9190d65c861' 'd5907a721b97299f0685c583499f7820' - 'a724515b350b29c53f20e631c6cf9a14') + 'a724515b350b29c53f20e631c6cf9a14' + 'e6fa278c092ad83780e2dd0568e24ca6') _kernelname=${pkgbase#linux} @@ -77,6 +79,9 @@ prepare() { # http://git.linux-nfs.org/?p=trondmy/linux-nfs.git;a=commitdiff;h=23e66ba97127ff3b064d4c6c5138aa34eafc492f patch -p1 -i "${srcdir}/0006-rpc_pipe-fix-cleanup-of-dummy-gssd-directory-when-no.patch" + # Fix symbols: Revert http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=83460ec8dcac14142e7860a01fa59c267ac4657c + patch -Rp1 -i "${srcdir}/0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch" + if [ "${CARCH}" = "x86_64" ]; then cat "${srcdir}/config.x86_64" > ./.config else