diff options
author | Chris Severance | 2018-12-18 15:17:45 -0500 |
---|---|---|
committer | Chris Severance | 2018-12-18 15:17:45 -0500 |
commit | a1b70a5bdd18a775f662a8588659a80aae0a319e (patch) | |
tree | 0d3f18db1c1fa59d857fdbebfd2c3d5345462bca | |
parent | 3b43ac4488cdd5e97813e26c50790b9e5ae53478 (diff) | |
download | aur-a1b70a5bdd18a775f662a8588659a80aae0a319e.tar.gz |
autu: Update to 3.16.62-1
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | 0000-unknown-rela-relocation-4-binutils.2.31.kernel.3.16.patch | 78 | ||||
-rw-r--r-- | 0001-binutils.2.31.max-page-size.patch | 53 | ||||
-rw-r--r-- | PKGBUILD | 51 |
4 files changed, 163 insertions, 33 deletions
@@ -1,7 +1,7 @@ # Generated by mksrcinfo v8 -# Sun Dec 2 02:08:37 UTC 2018 +# Tue Dec 18 20:17:45 UTC 2018 pkgbase = linux-lts316 - pkgver = 3.16.61 + pkgver = 3.16.62 pkgrel = 1 url = https://www.kernel.org/ arch = i686 @@ -14,22 +14,24 @@ pkgbase = linux-lts316 makedepends = bc options = !strip source = https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.16.tar.xz - source = https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.16.61.xz + source = https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.16.62.xz source = config source = config.x86_64 source = 99-linux.hook source = linux.preset source = change-default-console-loglevel.patch source = 0000-unknown-rela-relocation-4-binutils.2.31.kernel.3.16.patch + source = 0001-binutils.2.31.max-page-size.patch source = update.sh sha256sums = 4813ad7927a7d92e5339a873ab16201b242b2748934f12cb5df9ba2cfe1d77a0 - sha256sums = 946d72d9bbb1fecef70b4e93334395fbc686e7202f0008db028532fe48516cf6 + sha256sums = ee24505b8ca695ef4c049fb1f17ce1fffe8248c96b61564e5cfba924e4abc825 sha256sums = 3bce3e9adce8ae3f826eebab75e9784ca92a914e526ae352de61c1da93aab8d3 sha256sums = 9d82115ea8921d3f4f7f28ba162a3a3f256f88f14f8fad49a833eddb77c0efea sha256sums = 834bd254b56ab71d73f59b3221f056c72f559553c04718e350ab2a3e2991afe0 sha256sums = f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c sha256sums = 1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99 - sha256sums = 0399497c991372817b2ae25e1570d30588e16183a2122367276d542952f03b56 + sha256sums = b0f101562baca5f8aed72ba90638763ef2be8f4618c111a50334970dd03dfb4b + sha256sums = f71e0de924013fe60c3cbed45f322e6a09942db978daeddd18adb8582373b5ed sha256sums = 4dad3093e0c2bd7dafd30a0344b4df6432c3a7d1422edc4e0d1e6201aa513648 pkgname = linux-lts316 @@ -40,10 +42,12 @@ pkgname = linux-lts316 depends = kmod depends = mkinitcpio>=0.7 optdepends = crda: to set the correct wireless channels of your country + provides = linux=3.16.62 backup = etc/mkinitcpio.d/linux-lts316.preset pkgname = linux-lts316-headers pkgdesc = Header files and scripts for building modules for Linux-lts316 kernel + provides = linux-headers=3.16.62 pkgname = linux-lts316-docs pkgdesc = Kernel hackers manual - HTML documentation that comes with the Linux-lts316 kernel diff --git a/0000-unknown-rela-relocation-4-binutils.2.31.kernel.3.16.patch b/0000-unknown-rela-relocation-4-binutils.2.31.kernel.3.16.patch index ea79324e3c67..6578beb82dcd 100644 --- a/0000-unknown-rela-relocation-4-binutils.2.31.kernel.3.16.patch +++ b/0000-unknown-rela-relocation-4-binutils.2.31.kernel.3.16.patch @@ -1,6 +1,65 @@ -diff -pNaru5 src1/linux-3.16/arch/x86/kernel/module.c src2/linux-3.16/arch/x86/kernel/module.c ---- src1/linux-3.16/arch/x86/kernel/module.c 2014-08-03 18:25:02.000000000 -0400 -+++ src2/linux-3.16/arch/x86/kernel/module.c 2018-12-01 20:13:20.479487508 -0500 +From b21ebf2fb4cde1618915a97cc773e287ff49173e Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" <hjl.tools@gmail.com> +Date: Wed, 7 Feb 2018 14:20:09 -0800 +Subject: x86: Treat R_X86_64_PLT32 as R_X86_64_PC32 + +On i386, there are 2 types of PLTs, PIC and non-PIC. PIE and shared +objects must use PIC PLT. To use PIC PLT, you need to load +_GLOBAL_OFFSET_TABLE_ into EBX first. There is no need for that on +x86-64 since x86-64 uses PC-relative PLT. + +On x86-64, for 32-bit PC-relative branches, we can generate PLT32 +relocation, instead of PC32 relocation, which can also be used as +a marker for 32-bit PC-relative branches. Linker can always reduce +PLT32 relocation to PC32 if function is defined locally. Local +functions should use PC32 relocation. As far as Linux kernel is +concerned, R_X86_64_PLT32 can be treated the same as R_X86_64_PC32 +since Linux kernel doesn't use PLT. + +R_X86_64_PLT32 for 32-bit PC-relative branches has been enabled in +binutils master branch which will become binutils 2.31. + +[ hjl is working on having better documentation on this all, but a few + more notes from him: + + "PLT32 relocation is used as marker for PC-relative branches. Because + of EBX, it looks odd to generate PLT32 relocation on i386 when EBX + doesn't have GOT. + + As for symbol resolution, PLT32 and PC32 relocations are almost + interchangeable. But when linker sees PLT32 relocation against a + protected symbol, it can resolved locally at link-time since it is + used on a branch instruction. Linker can't do that for PC32 + relocation" + + but for the kernel use, the two are basically the same, and this + commit gets things building and working with the current binutils + master - Linus ] + +Signed-off-by: H.J. Lu <hjl.tools@gmail.com> +Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> +--- + arch/x86/kernel/machine_kexec_64.c | 1 + + arch/x86/kernel/module.c | 1 + + arch/x86/tools/relocs.c | 3 +++ + 3 files changed, 5 insertions(+) + +# File not present in linux-3.16 +#diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c +#index 1f790cf9d38f..3b7427aa7d85 100644 +#--- a/arch/x86/kernel/machine_kexec_64.c +#+++ b/arch/x86/kernel/machine_kexec_64.c +#@@ -542,6 +542,7 @@ int arch_kexec_apply_relocations_add(const Elf64_Ehdr *ehdr, +# goto overflow; +# break; +# case R_X86_64_PC32: +#+ case R_X86_64_PLT32: +# value -= (u64)address; +# *(u32 *)location = value; +# break; +diff -pNaru5 linux-3.16.61.orig/arch/x86/kernel/module.c linux-3.16/arch/x86/kernel/module.c +--- linux-3.16.61.orig/arch/x86/kernel/module.c 2014-08-03 18:25:02.000000000 -0400 ++++ linux-3.16/arch/x86/kernel/module.c 2018-12-02 20:13:13.245493421 -0500 @@ -178,10 +178,11 @@ int apply_relocate_add(Elf64_Shdr *sechd *(s32 *)loc = val; if ((s64)val != *(s32 *)loc) @@ -13,10 +72,10 @@ diff -pNaru5 src1/linux-3.16/arch/x86/kernel/module.c src2/linux-3.16/arch/x86/k #if 0 if ((s64)val != *(s32 *)loc) goto overflow; -diff -pNaru5 src1/linux-3.16/arch/x86/tools/relocs.c src2/linux-3.16/arch/x86/tools/relocs.c ---- src1/linux-3.16/arch/x86/tools/relocs.c 2018-12-01 20:10:30.802647293 -0500 -+++ src2/linux-3.16/arch/x86/tools/relocs.c 2018-12-01 20:13:41.022841461 -0500 -@@ -761,10 +761,11 @@ static int do_reloc64(struct section *se +diff -pNaru5 linux-3.16.61.orig/arch/x86/tools/relocs.c linux-3.16/arch/x86/tools/relocs.c +--- linux-3.16.61.orig/arch/x86/tools/relocs.c 2018-12-02 20:13:11.958832565 -0500 ++++ linux-3.16/arch/x86/tools/relocs.c 2018-12-02 20:13:13.245493421 -0500 +@@ -761,13 +761,16 @@ static int do_reloc64(struct section *se offset += per_cpu_load_addr; switch (r_type) { @@ -26,5 +85,10 @@ diff -pNaru5 src1/linux-3.16/arch/x86/tools/relocs.c src2/linux-3.16/arch/x86/to /* * NONE can be ignored and PC relative relocations don't * need to be adjusted. ++ * ++ * NB: R_X86_64_PLT32 can be treated as R_X86_64_PC32. */ break; + + case R_X86_64_32: + case R_X86_64_32S: diff --git a/0001-binutils.2.31.max-page-size.patch b/0001-binutils.2.31.max-page-size.patch new file mode 100644 index 000000000000..1be4dba370dc --- /dev/null +++ b/0001-binutils.2.31.max-page-size.patch @@ -0,0 +1,53 @@ +From e3d03598e8ae7d195af5d3d049596dec336f569f Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" <hjl.tools@gmail.com> +Date: Mon, 19 Mar 2018 13:57:46 -0700 +Subject: x86/build/64: Force the linker to use 2MB page size + +Binutils 2.31 will enable -z separate-code by default for x86 to avoid +mixing code pages with data to improve cache performance as well as +security. To reduce x86-64 executable and shared object sizes, the +maximum page size is reduced from 2MB to 4KB. But x86-64 kernel must +be aligned to 2MB. Pass -z max-page-size=0x200000 to linker to force +2MB page size regardless of the default page size used by linker. + +Tested with Linux kernel 4.15.6 on x86-64. + +Signed-off-by: H.J. Lu <hjl.tools@gmail.com> +Cc: Andy Shevchenko <andy.shevchenko@gmail.com> +Cc: Eric Biederman <ebiederm@xmission.com> +Cc: H. Peter Anvin <hpa@zytor.com> +Cc: Juergen Gross <jgross@suse.com> +Cc: Kees Cook <keescook@chromium.org> +Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> +Cc: Linus Torvalds <torvalds@linux-foundation.org> +Cc: Peter Zijlstra <peterz@infradead.org> +Cc: Thomas Gleixner <tglx@linutronix.de> +Link: http://lkml.kernel.org/r/CAMe9rOp4_%3D_8twdpTyAP2DhONOCeaTOsniJLoppzhoNptL8xzA@mail.gmail.com +Signed-off-by: Ingo Molnar <mingo@kernel.org> +--- + arch/x86/Makefile | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/arch/x86/Makefile b/arch/x86/Makefile +index 498c1b812300..1c4d012550ec 100644 +--- a/arch/x86/Makefile ++++ b/arch/x86/Makefile +@@ -223,6 +223,15 @@ KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) + + LDFLAGS := -m elf_$(UTS_MACHINE) + ++# ++# The 64-bit kernel must be aligned to 2MB. Pass -z max-page-size=0x200000 to ++# the linker to force 2MB page size regardless of the default page size used ++# by the linker. ++# ++ifdef CONFIG_X86_64 ++LDFLAGS += $(call ld-option, -z max-page-size=0x200000) ++endif ++ + # Speed up the build + KBUILD_CFLAGS += -pipe + # Workaround for a gcc prelease that unfortunately was shipped in a suse release +-- +cgit 1.2-0.3.lf.el7 + @@ -4,36 +4,39 @@ # Contributor: Thomas Baechler <thomas@archlinux.org> set -u -pkgbase=linux-lts316 -_srcname=linux-3.16 -pkgver=3.16.61 -pkgrel=1 +pkgbase="linux-lts316" +_srcname="linux-3.16" +pkgver="3.16.62" +pkgrel='1' arch=('i686' 'x86_64') url="https://www.kernel.org/" license=('GPL2') makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc') options=('!strip') _verwatch=('https://mirrors.edge.kernel.org/pub/linux/kernel/v3.x/' '.*patch-\(3\.16\.[0-9]\+\)\.xz.*' 'f') -source=("https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz" - "https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz" - # the main kernel config files - 'config' 'config.x86_64' - # pacman hook for initramfs regeneration - '99-linux.hook' - # standard config files for mkinitcpio ramdisk - 'linux.preset' - 'change-default-console-loglevel.patch' - '0000-unknown-rela-relocation-4-binutils.2.31.kernel.3.16.patch' # https://www.reddit.com/r/linuxquestions/comments/903xwq/unable_to_compile_working_kernel_modules_anymore/ - 'update.sh' - ) +source=( + "https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz" + "https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz" + # the main kernel config files + 'config' 'config.x86_64' + # pacman hook for initramfs regeneration + '99-linux.hook' + # standard config files for mkinitcpio ramdisk + 'linux.preset' + 'change-default-console-loglevel.patch' + '0000-unknown-rela-relocation-4-binutils.2.31.kernel.3.16.patch' # https://www.reddit.com/r/linuxquestions/comments/903xwq/unable_to_compile_working_kernel_modules_anymore/ + '0001-binutils.2.31.max-page-size.patch' # http://lists.gnu.org/archive/html/bug-binutils/2018-03/msg00193.html + 'update.sh' +) sha256sums=('4813ad7927a7d92e5339a873ab16201b242b2748934f12cb5df9ba2cfe1d77a0' - '946d72d9bbb1fecef70b4e93334395fbc686e7202f0008db028532fe48516cf6' + 'ee24505b8ca695ef4c049fb1f17ce1fffe8248c96b61564e5cfba924e4abc825' '3bce3e9adce8ae3f826eebab75e9784ca92a914e526ae352de61c1da93aab8d3' '9d82115ea8921d3f4f7f28ba162a3a3f256f88f14f8fad49a833eddb77c0efea' '834bd254b56ab71d73f59b3221f056c72f559553c04718e350ab2a3e2991afe0' 'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c' '1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99' - '0399497c991372817b2ae25e1570d30588e16183a2122367276d542952f03b56' + 'b0f101562baca5f8aed72ba90638763ef2be8f4618c111a50334970dd03dfb4b' + 'f71e0de924013fe60c3cbed45f322e6a09942db978daeddd18adb8582373b5ed' '4dad3093e0c2bd7dafd30a0344b4df6432c3a7d1422edc4e0d1e6201aa513648') _kernelname=${pkgbase#linux} @@ -43,7 +46,7 @@ _kernelname=${pkgbase#linux} _makeopts=( #CC='gcc-5' CXX='g++-5' HOSTCC='gcc-5' HOSTCXX='g++-5' # LD='ld.gold' #CC='gcc-6' CXX='g++-6' HOSTCC='gcc-6' HOSTCXX='g++-6' - LDFLAGS='-z max-page-size=0x200000' # http://lists.gnu.org/archive/html/bug-binutils/2018-03/msg00193.html + #LDFLAGS='-z max-page-size=0x200000' # http://lists.gnu.org/archive/html/bug-binutils/2018-03/msg00193.html ) #makedepends+=('gcc5') @@ -63,8 +66,12 @@ prepare() { # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227) patch -Nup1 -i "${srcdir}/change-default-console-loglevel.patch" - # diff -pNaru5 src1 src2 > '0000-unknown-rela-relocation-4-binutils.2.31.kernel.3.16.patch' - patch -Nup2 -i "${srcdir}/0000-unknown-rela-relocation-4-binutils.2.31.kernel.3.16.patch" + # diff -pNaru5 'linux-3.16'{.61.orig,} > 'new_0000-unknown-rela-relocation-4-binutils.2.31.kernel.3.16.patch' + #(cd ..; cp -pr "${_srcname}"{,.61.orig}) + patch -Nup1 -i "${srcdir}/0000-unknown-rela-relocation-4-binutils.2.31.kernel.3.16.patch" + # false + + patch -Nup1 -i "${srcdir}/0001-binutils.2.31.max-page-size.patch" declare -A _config=([i686]='config' [x86_64]='config.x86_64') cat "${srcdir}/${_config[${CARCH}]}" > './.config' @@ -137,6 +144,7 @@ _package() { optdepends=('crda: to set the correct wireless channels of your country') backup=("etc/mkinitcpio.d/${pkgbase}.preset") install=linux.install + provides=("linux=${pkgver}") cd "${srcdir}/${_srcname}" @@ -199,6 +207,7 @@ _package() { _package-headers() { set -u pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel" + provides=("linux-headers=${pkgver}") install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}" |