Trying to build kernel from source [newbie]need devs help please - ZTE Axon 7 Questions & Answers

Hi, I'm trying to build the axon2017u kernel from source that I download from the openzte website.
I have followed this guide: http://forum.xda-developers.com/yureka/help/guide-compiling-64-bit-android-kernel-t3352728
and i just cannot get it to compile.
I have been running into errors and managed to fix them except an assembly error.
Could anyone (especially if someone has already compiled the kernel from source) tell me which toolkit to use and if you encoutered any kind of error and how you fixed it to make it build?
thanks guys i'm really at my wits end here

Honestly best bet is to ask in that thread. While it is not specific to axon 7 , I bet they have seen the error before and can offer insight.

running this error now:
Code:
In file included from drivers/usb/gadget/android.c:62:0:
./drivers/usb/gadget/function/f_rndis.c: In function 'rndis_alloc_inst':
./drivers/usb/gadget/function/f_rndis.c:1115:10: error: implicit declaration of function 'usb_os_desc_prepare_interf_dir' [-Werror=implicit-function-declaration]
usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs,
^
cc1: some warnings being treated as errors
scripts/Makefile.build:257: recipe for target 'drivers/usb/gadget/android.o' failed
make[3]: *** [drivers/usb/gadget/android.o] Error 1
scripts/Makefile.build:402: recipe for target 'drivers/usb/gadget' failed
make[2]: *** [drivers/usb/gadget] Error 2
scripts/Makefile.build:402: recipe for target 'drivers/usb' failed
make[1]: *** [drivers/usb] Error 2
Makefile:945: recipe for target 'drivers' failed
make: *** [drivers] Error 2
I'm using linaro 4.9, got past the assembly error got much further, now I'm stuck on this one error, can anyone help please?

@Nik2424
Check out the thread at the Android Builders Collective. They are a bunch of exceptionally talented folk & can provide lots of guidance in building. It would also be amazing to have an ABC (Pure Nexus based) ROM for our A7s.

Related

[Q] Having trouble building CM7 from source on OS X

So I've been trying to build CM7 from source following this guide. I follow it exactly (apart from replacing "Vision" with "Glacier" and "-froyo" with "-gingerbread") and it gives me an error when I enter in the command "make -j`sysctl -an hw.logicalcpu` bacon"
"make: *** No rule to make target `vendor/htc/glacier/proprietary/MS-HTCVISION-KNT20-02.apk', needed by `out/target/product/glacier/system/app/MS-HTCVISION-KNT20-02.apk'. Stop.
make: *** Waiting for unfinished jobs...."
And countless other ones during the process.
Any idea why this is happening? I'm on OS X if it helps.
I'm pretty sure it's the same on Linux as it is on OS X, so SOMEONE must know.

OmniRom 6.0 build error

OmniRom 6.0
make update-api doesn't help.
Code:
Checking API: checksystemapi-current
/home/daniil/working_directory/android/OmniRom/6.0/out/target/common/obj/PACKAGING/system-api.txt:2065: error 17: Field android.R.style.TextAppearance_Material_Widget_Button_Inverse has changed value from 16974548 to 16974565
/home/daniil/working_directory/android/OmniRom/6.0/out/target/common/obj/PACKAGING/system-api.txt:2110: error 17: Field android.R.style.ThemeOverlay_Material_Dialog has changed value from 16974550 to 16974564
/home/daniil/working_directory/android/OmniRom/6.0/out/target/common/obj/PACKAGING/system-api.txt:2111: error 17: Field android.R.style.ThemeOverlay_Material_Dialog_Alert has changed value from 16974551 to 16974566
/home/daniil/working_directory/android/OmniRom/6.0/out/target/common/obj/PACKAGING/system-api.txt:2220: error 17: Field android.R.style.Theme_Material_Light_LightStatusBar has changed value from 16974549 to 16974563
******************************
You have tried to change the API from what has been previously released in
an SDK. Please fix the errors listed above.
******************************
build/core/tasks/apicheck.mk:92: ошибка выполнения рецепта для цели «/home/daniil/working_directory/android/OmniRom/6.0/out/target/common/obj/PACKAGING/checksystemapi-last-timestamp»
make: *** [/home/daniil/working_directory/android/OmniRom/6.0/out/target/common/obj/PACKAGING/checksystemapi-last-timestamp] Ошибка 38
make: *** Ожидание завершения заданий…
/home/daniil/working_directory/android/OmniRom/6.0/out/target/common/obj/PACKAGING/public_api.txt:1966: error 17: Field android.R.style.TextAppearance_Material_Widget_Button_Inverse has changed value from 16974548 to 16974565
/home/daniil/working_directory/android/OmniRom/6.0/out/target/common/obj/PACKAGING/public_api.txt:2011: error 17: Field android.R.style.ThemeOverlay_Material_Dialog has changed value from 16974550 to 16974564
/home/daniil/working_directory/android/OmniRom/6.0/out/target/common/obj/PACKAGING/public_api.txt:2012: error 17: Field android.R.style.ThemeOverlay_Material_Dialog_Alert has changed value from 16974551 to 16974566
/home/daniil/working_directory/android/OmniRom/6.0/out/target/common/obj/PACKAGING/public_api.txt:2120: error 17: Field android.R.style.Theme_Material_Light_LightStatusBar has changed value from 16974549 to 16974563
******************************
You have tried to change the API from what has been previously released in
an SDK. Please fix the errors listed above.
******************************
build/core/tasks/apicheck.mk:46: ошибка выполнения рецепта для цели «/home/daniil/working_directory/android/OmniRom/6.0/out/target/common/obj/PACKAGING/checkpublicapi-last-timestamp»
make: *** [/home/daniil/working_directory/android/OmniRom/6.0/out/target/common/obj/PACKAGING/checkpublicapi-last-timestamp] Ошибка 38
How to fix it?
Hmm. Does this disappear if you use "brunch <device>" instead of "make"?
Obviously it needs to be fixed (someone screwed up...) but if it doesn't fail when using brunch, that explains how this issue was missed (most developers use brunch - which is usually far easier BUT does cause API-check failures to get hidden for some reason.)
Entropy512 Thank you.
Solution: Assemble a team brunch instead of make.
Topic can be closed.
DANIIL2017 said:
Entropy512 Thank you.
Solution: Assemble a team brunch instead of make.
Topic can be closed.
Click to expand...
Click to collapse
While you've worked around the problem, I think there's still some investigation on the end of others to figure out why it's breaking - because that's an indication of a potential problem there.
I had the same problem when building my rom for P8 Lite.
I tried "make update-api" but the problem was still present.
Entropy512 said:
While you've worked around the problem, I think there's still some investigation on the end of others to figure out why it's breaking - because that's an indication of a potential problem there.
Click to expand...
Click to collapse
Is there already a solution for this problem, i still have the same problem while building for a non official Omnirom device.
Finally found a solution for the problem:
In the file "build/core/tasks/apicheck.mk" change line 21.
Code:
ifeq (,$(filter true, $(WITHOUT_CHECK_API) $(TARGET_BUILD_PDK)))
change to
Code:
ifeq (,$(filter true, true $(WITHOUT_CHECK_API) $(TARGET_BUILD_PDK)))
It's a workaround but now i can finally build my tree.

[TOOLCHAIN]UBER Toolchains

This is the XDA home of UBER Toolchains.
What is UBERTC?
A bleeding edge toolchain based on latest gnu.org changes and patched with aosp and linaro android patches for optimal performance/battery.
Links
Prebuilts: https://bitbucket.org/matthewdalex/
Source: https://github.com/UBERTC
Communities: UBER Development - https://plus.google.com/u/0/communities/112152563785863538123
DarkRoom Development - https://plus.google.com/u/0/communities/117685307734094084120
Bug Reports/Support
Bug reports and support will be offered on this thread, Github and the Google+ communities in the links section.
Credits
AOSP
Google
Linaro
Cl3Kener
XDA:DevDB Information
UBER Toolchains, Tool/Utility for all devices (see above for details)
Contributors
mdalexca, Cl3Kener
Source Code: https://github.com/UBERTC
Version Information
Status: Stable
Created 2016-12-29
Last Updated 2017-06-17
Great toolchain! Good job, man.
Kindly update the link to pre-builts.
Edit:
Thanks.
@DespairFactor
Hi,
I synced these three chains from your repo today morning and the build was fine,
aarch64-linux-android-4.9, arm-eabi-4.9, arm-linux-androideabi-4.9
however repo synced again few hours back and build is failing every time with this error.
http://pastebin.com/JF1hZAm1
While syncing one commit was truncated for each toolchain.
Can you suggest what's the issue? Thanks.
nicesoni_ash said:
@DespairFactor
Hi,
I synced these three chains from your repo today morning and the build was fine,
aarch64-linux-android-4.9, arm-eabi-4.9, arm-linux-androideabi-4.9
however repo synced again few hours back and build is failing every time with this error.
http://pastebin.com/JF1hZAm1
While syncing one commit was truncated for each toolchain.
Can you suggest what's the issue? Thanks.
Click to expand...
Click to collapse
That's a clang error, not a gcc error. It it segfaulting which is usually something related to memory.
The Flash said:
That's a clang error, not a gcc error. It it segfaulting which is usually something related to memory.
Click to expand...
Click to collapse
Could this commit be a reason for this issue as I read that clang related optimizations may done that, although it's for UberTC and I build using it just today morning.
https://github.com/ashoksoni/android_build/commit/74358aa6c5892f5aed0b16e9833c3a0c4588264f
Sent from my "1+2" powered by Unofficial RR 7.x.x
Compiled by myself
Edit :
I somehow removed my last post mistakenly.
nicesoni_ash said:
Could this commit be a reason for this issue as I read that clang related optimizations may done that, although it's for UberTC and I build using it just today morning.
https://github.com/ashoksoni/android_build/commit/74358aa6c5892f5aed0b16e9833c3a0c4588264f
Sent from my "1+2" powered by Unofficial RR 7.x.x
Compiled by myself
Edit :
I somehow removed my last post mistakenly.
Click to expand...
Click to collapse
It isn't likely because those need to be enabled via boardconfig, which clang are you using?
DespairFactor said:
It isn't likely because those need to be enabled via boardconfig, which clang are you using?
Click to expand...
Click to collapse
I didn't make any changes to my BoardConfig.mk. This is the link.
https://github.com/ashoksoni/android_device_oneplus_oneplus2/blob/cm-14.1/BoardConfig.mk
This looks like the toolchain issue as one other user reported me the same issue. I am using the default toolchain now with same setup except ubertc optimizations and the build is going fine.
Could this be because of this commit?
https://github.com/UBERTC/GCC-UBER/commit/c09770237a5f4443b4328fef8b73636dc07aff41
Coz I only started having this issue after this commit.
Thanks.
nicesoni_ash said:
This looks like the toolchain issue as one other user reported me the same issue. I am using the default toolchain now with same setup except ubertc optimizations and the build is going fine.
Could this be because of this commit?
https://github.com/UBERTC/GCC-UBER/commit/c09770237a5f4443b4328fef8b73636dc07aff41
Coz I only started having this issue after this commit.
Thanks.
Click to expand...
Click to collapse
That commit has been in there for ages. You probably are missing a commit in bionic or build to supplement the opts.
The Flash said:
That commit has been in there for ages. You probably are missing a commit in bionic or build to supplement the opts.
Click to expand...
Click to collapse
Oh, but I only use pre-built ones from DespairFactor's repo. Build is working fine on default tc.
Sent from my "1+2" powered by Unofficial RR 7.x.x
Compiled by myself
nicesoni_ash said:
Oh, but I only use pre-built ones from DespairFactor's repo. Build is working fine on default tc.
Sent from my "1+2" powered by Unofficial RR 7.x.x
Compiled by myself
Click to expand...
Click to collapse
So let me get this straight: the latest toolchains without any additional commits like the Uber opts you posted fail to compile? GCC didn't change at all, if anything were to break it, it would be binutils.
The Flash said:
So let me get this straight: the latest toolchains without any additional commits like the Uber opts you posted fail to compile? GCC didn't change at all, if anything were to break it, it would be binutils.
Click to expand...
Click to collapse
You are right, the pm I got from other user is also reporting the same thing that when he build using binutils 2.5, the error was gone but then the kernel wasn't bootable for him. But since it's clear, do you think now the pre-builts can be build with different binutils?
Sent from my "1+2" powered by Unofficial RR 7.x.x
Compiled by myself
nicesoni_ash said:
You are right, the pm I got from other user is also reporting the same thing that when he build using binutils 2.5, the error was gone but then the kernel wasn't bootable for him. But since it's clear, do you think now the pre-builts can be build with different binutils?
Sent from my "1+2" powered by Unofficial RR 7.x.x
Compiled by myself
Click to expand...
Click to collapse
You can always compile the toolchains yourself, you sync it down just like a ROM and build it with the scripts in the UBERTC organization.
I have a question, is there anything I can do to get the kernel to boot with 7.x?
Boots just fine with 6.x toolchain, but when compiled with 7.x, just stays on the splash screen
The device is Sprint Samsung Galaxy S3, running RR-N
Lonelyskatter12 said:
I have a question, is there anything I can do to get the kernel to boot with 7.x?
Boots just fine with 6.x toolchain, but when compiled with 7.x, just stays on the splash screen
The device is Sprint Samsung Galaxy S3, running RR-N
Click to expand...
Click to collapse
7.x is still in development from GNU, this happened with 6.x when it was in the same state. I suggest waiting until it's official release ,it will likely work at that time.
hello,
just wondering if anyone can assist w/the following error message generated while compiling LOS-13 for OnePlus3 w/UberTC 4.9
build is configured w/the original UBER optimizations...
i've swapped out the physical memory & increased cache from 50-GB to 80-GB
Code:
/tmp/abort_message-19a0bf.s: Assembler messages:
/tmp/abort_message-19a0bf.s:510: Error: inconsistent uses of .cfi_sections
clang++: error: assembler command failed with exit code 1 (use -v to see invocation)
build/core/binary.mk:950: recipe for target '/home/samadhi/los13/out/target/product/oneplus3/obj_arm/STATIC_LIBRARIES/libc++abi_intermediates/src/abort_message.o' failed
make: *** [/home/samadhi/los13/out/target/product/oneplus3/obj_arm/STATIC_LIBRARIES/libc++abi_intermediates/src/abort_message.o] Error 1
make: *** Waiting for unfinished jobs....
target thumb C++: libc++abi_32 <= external/libcxxabi/src/cxa_default_handlers.cpp
/tmp/cxa_aux_runtime-ba7b1a.s: Assembler messages:
/tmp/cxa_aux_runtime-ba7b1a.s:1008: Error: inconsistent uses of .cfi_sections
clang++: error: assembler command failed with exit code 1 (use -v to see invocation)
build/core/binary.mk:950: recipe for target '/home/samadhi/los13/out/target/product/oneplus3/obj_arm/STATIC_LIBRARIES/libc++abi_intermediates/src/cxa_aux_runtime.o' failed
make: *** [/home/samadhi/los13/out/target/product/oneplus3/obj_arm/STATIC_LIBRARIES/libc++abi_intermediates/src/cxa_aux_runtime.o] Error 1
/tmp/cxa_default_handlers-c025bc.s: Assembler messages:
/tmp/cxa_default_handlers-c025bc.s:2706: Error: inconsistent uses of .cfi_sections
clang++: error: assembler command failed with exit code 1 (use -v to see invocation)
build/core/binary.mk:950: recipe for target '/home/samadhi/los13/out/target/product/oneplus3/obj_arm/STATIC_LIBRARIES/libc++abi_intermediates/src/cxa_default_handlers.o' failed
make: *** [/home/samadhi/los13/out/target/product/oneplus3/obj_arm/STATIC_LIBRARIES/libc++abi_intermediates/src/cxa_default_handlers.o] Error 1
make: *** wait: No child processes. Stop.
laperry1 said:
hello,
just wondering if anyone can assist w/the following error message generated while compiling LOS-13 for OnePlus3 w/UberTC 4.9
build is configured w/the original UBER optimizations...
i've swapped out the physical memory & increased cache from 50-GB to 80-GB
Code:
/tmp/abort_message-19a0bf.s: Assembler messages:
/tmp/abort_message-19a0bf.s:510: Error: inconsistent uses of .cfi_sections
clang++: error: assembler command failed with exit code 1 (use -v to see invocation)
build/core/binary.mk:950: recipe for target '/home/samadhi/los13/out/target/product/oneplus3/obj_arm/STATIC_LIBRARIES/libc++abi_intermediates/src/abort_message.o' failed
make: *** [/home/samadhi/los13/out/target/product/oneplus3/obj_arm/STATIC_LIBRARIES/libc++abi_intermediates/src/abort_message.o] Error 1
make: *** Waiting for unfinished jobs....
target thumb C++: libc++abi_32 <= external/libcxxabi/src/cxa_default_handlers.cpp
/tmp/cxa_aux_runtime-ba7b1a.s: Assembler messages:
/tmp/cxa_aux_runtime-ba7b1a.s:1008: Error: inconsistent uses of .cfi_sections
clang++: error: assembler command failed with exit code 1 (use -v to see invocation)
build/core/binary.mk:950: recipe for target '/home/samadhi/los13/out/target/product/oneplus3/obj_arm/STATIC_LIBRARIES/libc++abi_intermediates/src/cxa_aux_runtime.o' failed
make: *** [/home/samadhi/los13/out/target/product/oneplus3/obj_arm/STATIC_LIBRARIES/libc++abi_intermediates/src/cxa_aux_runtime.o] Error 1
/tmp/cxa_default_handlers-c025bc.s: Assembler messages:
/tmp/cxa_default_handlers-c025bc.s:2706: Error: inconsistent uses of .cfi_sections
clang++: error: assembler command failed with exit code 1 (use -v to see invocation)
build/core/binary.mk:950: recipe for target '/home/samadhi/los13/out/target/product/oneplus3/obj_arm/STATIC_LIBRARIES/libc++abi_intermediates/src/cxa_default_handlers.o' failed
make: *** [/home/samadhi/los13/out/target/product/oneplus3/obj_arm/STATIC_LIBRARIES/libc++abi_intermediates/src/cxa_default_handlers.o] Error 1
make: *** wait: No child processes. Stop.
Click to expand...
Click to collapse
That is not related to GCC, those are related to the clang toolchain.
thanks for your reply, it only fails w/UBERTC. w/default TC's it compiles fine...
DespairFactor said:
That is not related to GCC, those are related to the clang toolchain.
Click to expand...
Click to collapse
laperry1 said:
thanks for your reply, it only fails w/UBERTC. w/default TC's it compiles fine...
Click to expand...
Click to collapse
What is the exact toolchain name you are using? Can you give more output too?

Error trying to compile LineageOS 13.0

While trying to compile LineageOS 13.0 for the Nexus I'm stuck with the following error:
/home/android/android/system/out/host/linux-x86/bin/checkpolicy: loading policy configuration from /home/android/android/system/out/target/product/grouper/obj/ETC/sepolicy_intermediates/policy.conf
device/asus/grouper/sepolicy/init_shell.te:2:ERROR 'unknown type init_shell' at token ';' on line 14035:
allow init_shell sysfs_firmware_writable:file { open append write };
#line 1 "device/asus/grouper/sepolicy/init_shell.te"
checkpolicy: error(s) encountered while parsing configuration
external/sepolicy/Android.mk:85: recipe for target '/home/android/android/system/out/target/product/grouper/obj/ETC/sepolicy_intermediates/sepolicy' failed
make: *** [/home/android/android/system/out/target/product/grouper/obj/ETC/sepolicy_intermediates/sepolicy] Error 1
make: *** Waiting for unfinished jobs....
target thumb C++: init <= system/core/init/keychords.cpp
make: *** wait: No child processes. Stop.
Anyone being able to tell me how to get rid of that?
The type init_shell is not defined, i.e. your sepolicy configuration of the device tree does not match to the ROM sources. Probably the best way is to remove those definfitions temporaryly and to build the ROM in permissive mode. Later you can restrict / adapt the permissions to your needs.
Sooo... after some time I got back to this little project.
What I have achieved so far is that LineageOS 13.0 does build for grouper. However, when trying to boot it always starts back in recovery.
What I have done starting from stock LineageOS code for grouper is correcting "tvdpi" to "hdpi" like in 14.1 (https://github.com/LineageOS/androi...mmit/7dd33b8eb8c13b682202405e48c6d7962d5a73d7), and referring the build process to the correct kernel config, which is not "lineageos_android_defconfig" but "lineageos_grouper_defconfig". Then I have tried to substitute the apparently incorrect sepolicy definitions by those of GtrCraft (https://github.com/GtrCraft/cyanogenmod_grouper).
The result can't be too bad, because it actually builds. However, since it is not starting up I'm kinda stuck here again. Anyone being able to provide a hint why this is so or how to diagnose it?
And just for the obvious question: I believe that 14.1 is too much for grouper, although there is a somehow official build. And also, Xposed does not work officially yet on 14.1 (and does not anymore on 11.0). Therefore I would really like to upgrade to 13.0.
Still no luck, compile is finishing without errors, ROM will not boot, but throws me back to recovery. Maybe someone can take a look into the ROM:
https://www.mediafire.com/folder/ts4x8unxshb2z9n,tyv3j58t82z56a8/shared

Kernel build issues

EDIT: Got help. Solved
Alright so im working on a kernel. Im going to try messing around with overclocks and currently im just using elementalx as a base.
Im trying to get my build environment setup and I ran into an issue. Again. Fixed the others then this came along
Still just stock elementalx in this build as Im getting my building environment going then ill modify and rebuild
export CROSS_COMPILE=~/home/keelin/aarch64-linux-android-4.9/bin/aarch64-linux-android-
export ARCH=arm64
make elementalx_defconfig
sudo make
The runs good for a little, no errors then boom. This
arch/x86/kernel/cpu/perf_event_intel_pt.c: In function ‘pt_init’:
arch/x86/kernel/cpu/perf_event_intel_pt.c:1175:23: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
error, forbidden warning: perf_event_intel_pt.c:1175
scripts/Makefile.build:258: recipe for target 'arch/x86/kernel/cpu/perf_event_intel_pt.o' failed
make[3]: *** [arch/x86/kernel/cpu/perf_event_intel_pt.o] Error 1
scripts/Makefile.build:403: recipe for target 'arch/x86/kernel/cpu' failed
make[2]: *** [arch/x86/kernel/cpu] Error 2
scripts/Makefile.build:403: recipe for target 'arch/x86/kernel' failed
make[1]: *** [arch/x86/kernel] Error 2
Makefile:966: recipe for target 'arch/x86' failed
make: *** [arch/x86] Error 2
I met the same problem. Could you tell me how to solve it?
Could you please tell me how you solved it? i'm just trying to build normally without any changes either but stopping at the same place with exactly the same errors.
I have followed the same steps too, only difference is I used "defconfig" instead of "elementalx_defconfig"

Categories

Resources