OnePlusOSS / android_kernel_oneplus_msm8996

Other
146 stars 150 forks source link

build: fix standalone compile (3/3T Nougat) #28

Closed NewEraCracker closed 7 years ago

NewEraCracker commented 7 years ago

This kernel does not build unless the locations of the includes are fixed, and the compiler wrapper disabled. This PR fixes those problems.

jcadduono commented 7 years ago

hmm, I'm building standalone and the only change actually needed for compiling with 5.3.1 toolchain was the transposed arguments. other than that, you can add

KBUILD_CFLAGS   += $(call cc-disable-warning,maybe-uninitialized,)
KBUILD_CFLAGS   += $(call cc-disable-warning,unused-const-variable,)

right below

include $(srctree)/arch/$(SRCARCH)/Makefile

in Makefile.

It is probably better to disable build failures on those warnings rather than disable the warnings entirely, however. Not sure what the call for disabling specific -Werror features is.

for the kernel modules stripping, you can call make modules_install with INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH="." this should strip and install the modules to ./lib/modules

if it makes it easier for you, I have made some scripts to accomplish building with a few less keystrokes here: https://github.com/jcadduono/android_kernel_oneplus_msm8996/commit/24038d9b962a37550f76c522f683e2aee54bc501 (add .patch to the url for a patch)

@gregkh i would not advise visiting my repositories, you would be critiquing for days, bad commit habits i'm guilty :) cool to see you here, i'd say i'm somewhat of a fan!

i'm not a big fan of the android build system and prefer to compile kernels standalone, especially in the way I use them (ex. not built with a device operating system, but simply as a quick kernel image swap: https://github.com/jcadduono/lazyflasher)