linux-sony-nicki: modernize with new gcc8 linux aportgen code

This commit is contained in:
Konrad Dybcio 2018-10-19 13:54:21 +00:00 committed by Oliver Smith
parent a82204c127
commit 9d8928f2a0
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
4 changed files with 14 additions and 99 deletions

View file

@ -1,25 +1,21 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/lineageos_nicki_defconfig # Kernel config based on: arch/arm/configs/lineageos_nicki_defconfig
pkgname="linux-sony-nicki" pkgname="linux-sony-nicki"
pkgver=3.4.0 pkgver=3.4.0
pkgrel=0 pkgrel=1
pkgdesc="Sony Xperia M kernel fork" pkgdesc="Sony Xperia M kernel fork"
arch="armhf" arch="armhf"
_carch="arm" _carch="arm"
_flavor="sony-nicki" _flavor="sony-nicki"
url="https://kernel.org" url="https://kernel.org"
license="GPL2" license="GPL-2.0-only"
options="!strip !check !tracedeps" options="!strip !check !tracedeps"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev gcc6" makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev"
# Compiler: this kernel was only tested with GCC6. Feel free to make a merge # Compiler: latest GCC from Alpine
# request if you find out that it is booting working with newer GCCs as HOSTCC="${CC:-gcc}"
# well. See <https://postmarketos.org/vendorkernel> for instructions. HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
if [ "${CC:0:5}" != "gcc6-" ]; then
CC="gcc6-$CC"
HOSTCC="gcc6-gcc"
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
fi
# Source # Source
_repository="android_kernel_sony_msm8x27" _repository="android_kernel_sony_msm8x27"
@ -34,29 +30,14 @@ source="
03_kgsl_iommu_sync_lock.patch 03_kgsl_iommu_sync_lock.patch
04_psmouse_base.patch 04_psmouse_base.patch
05_try_to_make_kgsl_work.patch 05_try_to_make_kgsl_work.patch
compiler-gcc6.h gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
" "
builddir="$srcdir/${_repository}-${_commit}" builddir="$srcdir/${_repository}-${_commit}"
prepare() { prepare() {
default_prepare default_prepare
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
# gcc6 support
cp -v "$srcdir/compiler-gcc6.h" "$builddir/include/linux/"
# Remove -Werror from all makefiles
local i
local makefiles="$(find . -type f -name Makefile)
$(find . -type f -name Kbuild)"
for i in $makefiles; do
sed -i 's/-Werror-/-W/g' "$i"
sed -i 's/-Werror//g' "$i"
done
# Prepare kernel config ('yes ""' for kernels lacking olddefconfig)
mkdir -p "$srcdir"/build
cp "$srcdir"/$_config "$builddir"/.config
yes "" | make O="$srcdir"/build ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
} }
build() { build() {
@ -93,4 +74,5 @@ a8c955bf718f155011e980f3d0948be98e1fee5649f418299a4851780543019daf7afa406aa7b082
448bad436377a22c93ac401b9aecb504fe8e84b9511a3dd28f3cc125f3725cc1168ef03dee9f8f1085a9fbb7910b9e75cd25a382ccce626b427c8e27f7c17ffc 03_kgsl_iommu_sync_lock.patch 448bad436377a22c93ac401b9aecb504fe8e84b9511a3dd28f3cc125f3725cc1168ef03dee9f8f1085a9fbb7910b9e75cd25a382ccce626b427c8e27f7c17ffc 03_kgsl_iommu_sync_lock.patch
f7e31cfe422696922aec52002e56c58103183966edee3bb8e1995d33f8d37b07c32280a8ecc213874e358a6ff367418556a4542fba7e3c17e4b8e82e05c3a543 04_psmouse_base.patch f7e31cfe422696922aec52002e56c58103183966edee3bb8e1995d33f8d37b07c32280a8ecc213874e358a6ff367418556a4542fba7e3c17e4b8e82e05c3a543 04_psmouse_base.patch
270aa134a7040409cf2ec5502939b8aa68470c47eeb2bef8f378aa2758a8b546b79018298a81625351f1c06241d8f76bf016793474f58b888db7871a5d745801 05_try_to_make_kgsl_work.patch 270aa134a7040409cf2ec5502939b8aa68470c47eeb2bef8f378aa2758a8b546b79018298a81625351f1c06241d8f76bf016793474f58b888db7871a5d745801 05_try_to_make_kgsl_work.patch
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h" 77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
0b33408a0c024c6a9103cc1006bf1534d0146333815a91406a8ae87ce5ec09da0ec427f2c7df211ecbd0a0a59206b3757f6196b9f2d3963734acc69807a5bbf2 gcc8-fix-put-user.patch"

View file

@ -1,69 +0,0 @@
// SOURCE:
// https://github.com/NextThingCo/CHIP-u-boot/issues/10#issuecomment-287515505
#ifndef __LINUX_COMPILER_H
#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
#endif
#define __used __attribute__((__used__))
#define __must_check __attribute__((warn_unused_result))
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
/* Mark functions as cold. gcc will assume any path leading to a call
to them will be unlikely. This means a lot of manual unlikely()s
are unnecessary now for any paths leading to the usual suspects
like BUG(), printk(), panic() etc. [but let's keep them for now for
older compilers]
Early snapshots of gcc 4.3 don't support this and we can't detect this
in the preprocessor, but we can live with this because they're unreleased.
Maketime probing would be overkill here.
gcc also has a __attribute__((__hot__)) to move hot functions into
a special section, but I don't see any sense in this right now in
the kernel context */
#define __cold __attribute__((__cold__))
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
#ifndef __CHECKER__
# define __compiletime_warning(message) __attribute__((warning(message)))
# define __compiletime_error(message) __attribute__((error(message)))
#endif /* __CHECKER__ */
/*
* Mark a position in code as unreachable. This can be used to
* suppress control flow warnings after asm blocks that transfer
* control elsewhere.
*
* Early snapshots of gcc 4.5 don't support this and we can't detect
* this in the preprocessor, but we can live with this because they're
* unreleased. Really, we need to have autoconf for the kernel.
*/
#define unreachable() __builtin_unreachable()
/* Mark a function definition as prohibited from being cloned. */
#define __noclone __attribute__((__noclone__))
/*
* Tell the optimizer that something else uses this function or variable.
*/
#define __visible __attribute__((externally_visible))
/*
* GCC 'asm goto' miscompiles certain code sequences:
*
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
*
* Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
*
* (asm goto is automatically volatile - the naming reflects this.)
*/
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
#define __HAVE_BUILTIN_BSWAP32__
#define __HAVE_BUILTIN_BSWAP64__
#define __HAVE_BUILTIN_BSWAP16__
#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc7-give-up-on-ilog2-const-optimizations.patch

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc8-fix-put-user.patch