From ff6004ab785964da01f7eea18c231badd7f43f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=A4chler?= Date: Mon, 31 Mar 2014 23:22:46 +0000 Subject: [PATCH] linux: some PKGBUILD fixes and re-add the syscalls.h revert --- ...tooth-allocate-static-minor-for-vhci.patch | 2 +- ...tiple-calls-to-MODULE_DEVICE_TABLE-p.patch | 2 +- 0003-module-remove-MODULE_GENERIC_TABLE.patch | 2 +- ...h-use-gcc-alias-instead-of-assembler.patch | 48 ++++++++----------- PKGBUILD | 35 ++++---------- 5 files changed, 33 insertions(+), 56 deletions(-) rename 0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch => 0004-Revert-syscalls.h-use-gcc-alias-instead-of-assembler.patch (56%) diff --git a/0001-Bluetooth-allocate-static-minor-for-vhci.patch b/0001-Bluetooth-allocate-static-minor-for-vhci.patch index f991079..eaf24f9 100644 --- a/0001-Bluetooth-allocate-static-minor-for-vhci.patch +++ b/0001-Bluetooth-allocate-static-minor-for-vhci.patch @@ -1,7 +1,7 @@ From 5d77ba2d26110c678b40fd723866a17d4036de12 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 18 Feb 2014 02:19:26 -0300 -Subject: [PATCH 1/3] Bluetooth: allocate static minor for vhci +Subject: [PATCH 1/4] Bluetooth: allocate static minor for vhci Commit bfacbb9 (Bluetooth: Use devname:vhci module alias for virtual HCI driver) added the module alias to hci_vhci module so it's possible to diff --git a/0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch b/0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch index b4069b7..f969457 100644 --- a/0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch +++ b/0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch @@ -1,7 +1,7 @@ From 9bc5b710f5957763d6944f38143b627d127c15ff Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Mon, 3 Feb 2014 11:14:13 +1030 -Subject: [PATCH 2/3] module: allow multiple calls to MODULE_DEVICE_TABLE() per +Subject: [PATCH 2/4] module: allow multiple calls to MODULE_DEVICE_TABLE() per module Commit 78551277e4df5: "Input: i8042 - add PNP modaliases" had a bug, where the diff --git a/0003-module-remove-MODULE_GENERIC_TABLE.patch b/0003-module-remove-MODULE_GENERIC_TABLE.patch index 043e8a3..c507827 100644 --- a/0003-module-remove-MODULE_GENERIC_TABLE.patch +++ b/0003-module-remove-MODULE_GENERIC_TABLE.patch @@ -1,7 +1,7 @@ From 06d2e746733a83469944481cb7f4fb1c7134a8ce Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 3 Feb 2014 11:15:13 +1030 -Subject: [PATCH 3/3] module: remove MODULE_GENERIC_TABLE +Subject: [PATCH 3/4] module: remove MODULE_GENERIC_TABLE MODULE_DEVICE_TABLE() calles MODULE_GENERIC_TABLE(); make it do the work directly. This also removes a wart introduced in the last patch, diff --git a/0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch b/0004-Revert-syscalls.h-use-gcc-alias-instead-of-assembler.patch similarity index 56% rename from 0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch rename to 0004-Revert-syscalls.h-use-gcc-alias-instead-of-assembler.patch index c4242e0..dd4334f 100644 --- a/0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch +++ b/0004-Revert-syscalls.h-use-gcc-alias-instead-of-assembler.patch @@ -1,68 +1,60 @@ -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 +From 268984331a319f47179d6f0b62aa0e312fe4497d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20B=C3=A4chler?= +Date: Tue, 1 Apr 2014 01:15:34 +0200 +Subject: [PATCH 4/4] Revert "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 reverts commit 83460ec8dcac14142e7860a01fa59c267ac4657c. -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 +For details, see https://lkml.org/lkml/2014/1/26/22. --- 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 +index 3f448c6..90c199f 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)))); \ +- asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\ +- __attribute__((alias(__stringify(compat_SyS##name)))); \ ++ asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ 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); \ ++ 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 +index a747a77..9e7cb9d 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h -@@ -184,7 +184,8 @@ extern struct trace_event_functions exit_syscall_print_funcs; +@@ -185,8 +185,7 @@ 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)))); \ +- asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ +- __attribute__((alias(__stringify(SyS##name)))); \ ++ asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ 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; +@@ -196,6 +195,7 @@ 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); \ ++ 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 +1.9.1 diff --git a/PKGBUILD b/PKGBUILD index a3b95f9..0369671 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -21,15 +21,17 @@ source=("https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz" '0001-Bluetooth-allocate-static-minor-for-vhci.patch' '0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch' '0003-module-remove-MODULE_GENERIC_TABLE.patch' + '0004-Revert-syscalls.h-use-gcc-alias-instead-of-assembler.patch' ) sha256sums=('61558aa490855f42b6340d1a1596be47454909629327c49a5e4e10268065dffa' '059325a759c92a0bbc07b5618b3d59eccd72a7647d066c509c9eceb0aecc799e' 'd2c8ddda8e56884596ce76fd53f1513a27ed4f9a092513813d0d6164f423cc28' 'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c' 'faced4eb4c47c4eb1a9ee8a5bf8a7c4b49d6b4d78efbe426e410730e6267d182' - '17984c2dafbc3099cafe01dbf03039844099c3cc7719d9bc8633b1ca6a6ab17b' - '03522828e5a2af5b5ccfdedb21ec429797e4391549091781df899e7aacb9818a' - 'fa447576b7f86b495ff922f6b217e5c5864484d23428dd62e46f8fb7778cec7c') + '29a958c37e1fb04c49b1cc3be4f38b53ffdeef61ab049865209f6b77817302d0' + 'd8db3b235d871d2b27986d3cb73a57b1d33fed52196a4b608152498a57e93838' + 'eb9a773b7b978bc508e8459ef835ff2cb8a41bb235caff1c18c5b718d7ce902c' + '4edd92642d710d8a351dd2acce36d412eccbf60380f9d0368ec315acb49ad704') _kernelname=${pkgbase#linux} @@ -48,9 +50,6 @@ prepare() { # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227) patch -p1 -i "${srcdir}/change-default-console-loglevel.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" - # Fix vhci warning in kmod (to restore every kernel maintainer's sanity) patch -p1 -i "${srcdir}/0001-Bluetooth-allocate-static-minor-for-vhci.patch" @@ -58,6 +57,10 @@ prepare() { patch -p1 -i "${srcdir}/0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch" patch -p1 -i "${srcdir}/0003-module-remove-MODULE_GENERIC_TABLE.patch" + # Fix symbols: Revert http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=83460ec8dcac14142e7860a01fa59c267ac4657c + # For details, see https://lkml.org/lkml/2014/1/26/22 + patch -p1 -i "${srcdir}/0004-Revert-syscalls.h-use-gcc-alias-instead-of-assembler.patch" + if [ "${CARCH}" = "x86_64" ]; then cat "${srcdir}/config.x86_64" > ./.config else @@ -205,25 +208,6 @@ _package-headers() { cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/" - # add headers for lirc package - # pci - for i in bt8xx cx88 saa7134; do - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/pci/${i}" - cp -a drivers/media/pci/${i}/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/pci/${i}" - done - # usb - for i in cpia2 em28xx pwc sn9c102; do - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/${i}" - cp -a drivers/media/usb/${i}/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/${i}" - done - # i2c - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c" - cp drivers/media/i2c/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/" - for i in cx25840; do - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/${i}" - cp -a drivers/media/i2c/${i}/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/${i}" - done - # add docbook makefile install -D -m644 Documentation/DocBook/Makefile \ "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile" @@ -255,6 +239,7 @@ _package-headers() { # http://bugs.archlinux.org/task/13146 mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/" cp drivers/media/dvb-frontends/lgdt330x.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/" + mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/" cp drivers/media/i2c/msp3400-driver.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/" # add dvb headers