Skip to content
Snippets Groups Projects
Commit 70e2f555 authored by Richard Qian's avatar Richard Qian
Browse files

Update files for the LG G3 (T-Mobile) (lg-d851) to allow for successful compilation and booting

parent bbd00a62
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armhf"
arch="armv7"
options="!check !archcheck"
depends="postmarketos-base linux-lg-d851 mkbootimg mesa-dri-gallium"
makedepends="devicepkg-dev"
......@@ -19,4 +19,4 @@ package() {
devicepkg_package $startdir $pkgname
}
sha512sums="cd344372a04def49580f8c5d24c6ad5aca5fcf208e9c9243d4320164461c7010f850397b1e81f5e2f88fb1e5af04a29443f158cff1e8c83275492596f66610ad deviceinfo"
sha512sums="2e401e086a0f22676a36b7dc25424c9674b72255a78a57a84c28abec5e55a7021415beef22721e83eafe161f3140dd732a3ea5df4b1a0d17e5018c58ca4675cc deviceinfo"
......@@ -8,7 +8,7 @@ deviceinfo_codename="lg-d851"
deviceinfo_year="2014"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="armhf"
deviceinfo_arch="armv7"
# Device related
deviceinfo_chassis="handset"
......@@ -22,10 +22,8 @@ deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="androidboot.hardware=g3 user_debug=31 msm_rtb.filter=0x0 buildvariant=userdebug"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_offset_base="0x00000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x02000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"
source:
https://github.com/ShinySide/HispAsian_Lollipop_G6/commit/b7756b6fc4bb728722b14d2dfdbaf1dc843812e9
* These need to be static to avoid these errors:
drivers/built-in.o: In function `.LANCHOR1':
msm_iommu_sec.c:(.data+0x9298): undefined reference to `kgsl_iommu_sync_lock'
msm_iommu_sec.c:(.data+0x929c): undefined reference to `kgsl_iommu_sync_unlock'
Makefile:877: recipe for target '.tmp_vmlinux1' failed
make: *** [.tmp_vmlinux1] Error 1
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
--- a/drivers/gpu/msm/kgsl_iommu.c
+++ b/drivers/gpu/msm/kgsl_iommu.c
@@ -1010,7 +1010,7 @@ static int kgsl_iommu_init_sync_lock(struct kgsl_mmu *mmu)
*
* Return - int - number of commands.
*/
-inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
+static inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
unsigned int *cmds)
{
struct kgsl_device *device = mmu->device;
@@ -1080,7 +1080,7 @@ inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
*
* Return - int - number of commands.
*/
-inline unsigned int kgsl_iommu_sync_unlock(struct kgsl_mmu *mmu,
+static inline unsigned int kgsl_iommu_sync_unlock(struct kgsl_mmu *mmu,
unsigned int *cmds)
{
struct kgsl_device *device = mmu->device;
......@@ -5,13 +5,13 @@ pkgname=linux-lg-d851
pkgver=3.4.113
pkgrel=0
pkgdesc="LG G3 (T-Mobile) kernel fork"
arch="armhf"
arch="armv7"
_carch="arm"
_flavor="lg-d851"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="bash bc bison devicepkg-dev dtbtool flex openssl-dev perl xz"
makedepends="bash bc bison devicepkg-dev dtbtool elfutils-dev flex gmp-dev gcc6 installkernel linux-headers openssl-dev perl sed xz"
# Source
_repository="android_kernel_lge_g3"
......@@ -20,13 +20,21 @@ _config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/$_repository/archive/$_commit.tar.gz
$_config
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
kernel-use-the-gnu89-standard-explicitly.patch
compiler-gcc6.h
02_gpu-msm-fix-gcc5-compile.patch
"
builddir="$srcdir/$_repository-$_commit"
_outdir="out"
# Compiler: this kernel was only tested with GCC6. Feel free to make a merge
# request if you find out that it is booting working with newer GCCs as
# well. See <https://postmarketos.org/vendorkernel> for instructions.
if [ "${CC:0:5}" != "gcc6-" ]; then
CC="gcc6-$CC"
HOSTCC="gcc6-gcc"
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
fi
prepare() {
default_prepare
. downstreamkernel_prepare
......@@ -36,21 +44,17 @@ build() {
unset LDFLAGS
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
# Generate master DTB (deviceinfo_bootimg_qcdt)
dtbTool -s 2048 -p "scripts/dtc/" -o "arch/arm/boot/dt.img" "arch/arm/boot/"
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir"
# Master DTB (deviceinfo_bootimg_qcdt)
install -Dm644 "$builddir/arch/arm/boot/dt.img" \
"$pkgdir/boot/dt.img"
dtbTool -p scripts/dtc/ -o "$_outdir/arch/$_carch/boot"/dt.img "$_outdir/arch/$_carch/boot/"
install -Dm644 "$_outdir/arch/$_carch/boot"/dt.img "$pkgdir"/boot/dt.img
}
sha512sums="ce7447b654bc3a50c7ebb2e97807b60ea738bca31ceef768804592134f6d313f999e203604b269664bacd46be585ff26131d4a9e12c2edef376cc0e825977d1f linux-lg-d851-e9173c6249c1a965b5e0c3a73c4b232f0d19b080.tar.gz
9116046c9b835e2b4740aad77141d9474914ff4e1e3c699533a578c4161b3c49f9585bed6615b621fe1928e67d5950783f469fc6cf0ae4db3922a6695705e5a5 config-lg-d851.armhf
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch"
07de1bc56a3fd84bc8d3a7538f72a80ffb0a849cdbcf4c0473e5da974e70264c0a65e6f76f3a85b12524926408baaf0666fb91f253d3591d8af19744ad88e52b config-lg-d851.armv7
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
7be03a9e78b7ac330a54b1f00509caa0621a95c0c55901878ad757f9dd69cc05ba2c8b5ea987063ae1224f92c4d090d515fa5d369e7755181a4871b0d0f82881 02_gpu-msm-fix-gcc5-compile.patch"
// 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 */
......@@ -3334,14 +3334,21 @@ CONFIG_BIF_QPNP=y
#
# File systems
#
# CONFIG_EXT2_FS is not set
# CONFIG_EXT3_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT2_FS_XIP is not set
CONFIG_EXT3_FS=y
CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
CONFIG_EXT3_FS_XATTR=y
# CONFIG_EXT3_FS_POSIX_ACL is not set
# CONFIG_EXT3_FS_SECURITY is not set
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_XATTR=y
# CONFIG_EXT4_FS_POSIX_ACL is not set
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_JBD2=y
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
......@@ -3650,7 +3657,6 @@ CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_ABLK_HELPER=y
# CONFIG_CRYPTO_USER is not set
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
CONFIG_CRYPTO_GF128MUL=y
......@@ -3711,7 +3717,7 @@ CONFIG_CRYPTO_SHA512_ARM_NEON=y
#
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_AES_ARM=y
CONFIG_CRYPTO_AES_ARM_BS=y
# CONFIG_CRYPTO_AES_ARM_BS is not set
# CONFIG_CRYPTO_ANUBIS is not set
CONFIG_CRYPTO_ARC4=y
# CONFIG_CRYPTO_BLOWFISH is not set
......
../../.shared-patches/linux/gcc7-give-up-on-ilog2-const-optimizations.patch
\ No newline at end of file
../../.shared-patches/linux/gcc8-fix-put-user.patch
\ No newline at end of file
../../.shared-patches/linux/kernel-use-the-gnu89-standard-explicitly.patch
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment