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

This commit is contained in:
Valentin Marinov 2018-10-16 08:48:34 +03:00 committed by Oliver Smith
parent 9666ffaa98
commit a82204c127
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
5 changed files with 45 additions and 109 deletions

View File

@ -1,13 +0,0 @@
diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c
index b37fd1e07ac1..1f091a261d22 100644
--- a/drivers/video/msm/mdss/mdss_fb.c
+++ b/drivers/video/msm/mdss/mdss_fb.c
@@ -2668,7 +2668,7 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)
var->left_margin = panel_info->lcdc.h_back_porch;
var->right_margin = panel_info->lcdc.h_front_porch;
var->hsync_len = panel_info->lcdc.h_pulse_width;
- var->pixclock = panel_info->clk_rate / 1000;
+ var->pixclock = 1000000 / 60;
/*
* Store the cont splash state in the var reserved[3] field.

View File

@ -1,8 +1,9 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/aosp_shinano_aries_defconfig # Kernel config based on: arch/arm/configs/aosp_shinano_aries_defconfig
pkgname="linux-sony-aries" pkgname="linux-sony-aries"
pkgver=3.10.84 pkgver=3.10.84
pkgrel=7 pkgrel=8
pkgdesc="Sony Xperia Z3 Compact kernel" pkgdesc="Sony Xperia Z3 Compact kernel"
arch="armhf" arch="armhf"
_carch="arm" _carch="arm"
@ -10,54 +11,57 @@ _flavor=sony-aries
url="https://github.com/sonyxperiadev/kernel" url="https://github.com/sonyxperiadev/kernel"
license="GPL2" license="GPL2"
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="kernel" _repository="kernel"
_commit="b1ceda7b02ea29c526d329884db1e9f2694ab394" _commit="2134cafba220b32c43701368413ee333b41b7fe0"
_config="config-${_flavor}.armhf" _config="config-${_flavor}.${arch}"
source=" source="
$pkgname-$_commit.tar.gz::https://github.com/sonyxperiadev/${_repository}/archive/${_commit}.tar.gz $pkgname-$_commit.tar.gz::https://github.com/sonyxperiadev/${_repository}/archive/${_commit}.tar.gz
$_config $_config
compiler-gcc6.h gcc7-give-up-on-ilog2-const-optimizations.patch
02_mdss_fb_refresh_rate.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/"
cp "$srcdir"/$_config "$builddir"/.config
make ARCH="$_carch" HOSTCC="$HOSTCC" silentoldconfig
} }
build() { build() {
unset LDFLAGS unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \ make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
} }
package() { package() {
install -Dm644 "$builddir/arch/arm/boot/zImage-dtb" \ # kernel.release
"$pkgdir/boot/vmlinuz-$_flavor"
install -D "$builddir/include/config/kernel.release" \ install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release" "$pkgdir/usr/share/kernel/$_flavor/kernel.release"
# zImage (find the right one)
cd "$builddir/arch/$_carch/boot"
_target="$pkgdir/boot/vmlinuz-$_flavor"
for _zimg in zImage-dtb Image.gz-dtb *zImage Image; do
[ -e "$_zimg" ] || continue
msg "zImage found: $_zimg"
install -Dm644 "$_zimg" "$_target"
break
done
if ! [ -e "$_target" ]; then
error "Could not find zImage in $PWD!"
return 1
fi
} }
sha512sums="f63f32b9eb0e81509dad2ede7c8e8f8e367c80ede2c411009c7135a1108a62042a67e911bf7811fb340e9a868a382b7da18f2b5c01e04034c2b5661049a573e0 linux-sony-aries-b1ceda7b02ea29c526d329884db1e9f2694ab394.tar.gz sha512sums="fae2299d9d36956be71f40ae724ac0a5069b53d440c114184f82495550c76743e9275e37ad00f6d4a012d32e91a580f424cdb1a1222647c5f2fd678a405a225f linux-sony-aries-2134cafba220b32c43701368413ee333b41b7fe0.tar.gz
0c453c3f74941854e98d3a4465e667e6996192b2c0e8ef69a3de5815cd26317642099bf7e85b91f200c5ba5edd70c43fb7a5982f0268fb8d31788a537914c8ef config-sony-aries.armhf 0c453c3f74941854e98d3a4465e667e6996192b2c0e8ef69a3de5815cd26317642099bf7e85b91f200c5ba5edd70c43fb7a5982f0268fb8d31788a537914c8ef config-sony-aries.armhf
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h 77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
a8c955bf718f155011e980f3d0948be98e1fee5649f418299a4851780543019daf7afa406aa7b0829375645107e4e6fbf241026b0cabe2b2ac895a47df83d2d8 02_mdss_fb_refresh_rate.patch" 00ef6044df2e904289fcbbe268c0200e94b085c374e6126b7f8ff7763285c689bafe9781dc17b85b3684d1d438f3839891925d6ca892ddb6610e68f12e3784a2 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,13 @@
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 272c4072..fad6c342 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -177,7 +177,7 @@ extern int __put_user_8(void *, unsigned long long);
({ \
unsigned long __limit = current_thread_info()->addr_limit - 1; \
const typeof(*(p)) __user *__tmp_p = (p); \
- register const typeof(*(p)) __r2 asm("r2") = (x); \
+ register typeof(*(p)) __r2 asm("r2") = (x); \
register const typeof(*(p)) __user *__p asm("r0") = __tmp_p; \
register unsigned long __l asm("r1") = __limit; \
register int __e asm("r0"); \