[SOLVED][CM13] Libcrypto : incompatible target during brunch build - Android Q&A, Help & Troubleshooting

Hi Guys,
I'm trying to build CM-13 for an arm device (x86_64) on Marshmallow (6.0.1), but my build always fail on an incompatible target error...
The so files seems to be built for a different arch than the target
I'm using a prebuilt kernel (yes I know, i'll change that a bit later), do you think that the problem is coming from thit point?
Here is the brunch's splat :
pastebin.com/wrH2sckE
Thanks in advance for your help and if you need any details, just ask !
============
Solved :
My BoardConfig.mk was targeting arm instead of arm64.
My best

Related

[HOWTO] Compile modules for stock kernels

I couldn't figure out how to compile a module for stock kernel - I kept getting the following in dmesg:
Code:
<module>: disagrees about version of symbol module_layout
I sent a message to Samsung Open Source Release Center on Friday and received a very helpful response yesterday. Basically, c1_rev02_defconfig contains some debug options that are not set in the actual kernel. These are the options that should not be set in the config:
Code:
CONFIG_DEBUG_PREEMPT
CONFIG_DEBUG_RT_MUTEXES
CONFIG_DEBUG_SPINLOCK
CONFIG_DEBUG_MUTEXES
CONFIG_PROFILING
CONFIG_PERF_EVENTS
CONFIG_PERF_COUNTERS
CONFIG_LATENCYTOP
CONFIG_FTRACE
You can use the attached script to modify all these values (the script was also supplied by Samsung, although it was syntactically incorrect and a couple of modifications were necessary to make it work). I have included a copy of the c1_rev02_defconfig with these modifications.
Using this config, I was finally able to compile modules that can actually be loaded on the device
Kudos to Samsung for sending me this information.
Nice info I guess that will help out the people who had issues with kernel modules on stock ROMs...
jps1974 said:
Kudos to Samsung for sending me this information.
Click to expand...
Click to collapse
No, that is the stuff they should put on their server. Makes you wonder what else they haven't released. Every time they make modifications to the GPL open source code (eg. kernel) and release a new version, they must release the code, and the exact same files they used to build it.
Thanks
That was the info I missed. I have successfully compiled cifs for kf1.
Sent from my GT-I9100 using XDA App
You know guys if there is a basic tutorial available online?.
Thank you!
Hi, I am new to compile modules for android (new to compile kernel anyway)
thanks for your info and config, I am now able to compile modules.
I had a problem on the compiled modules tho, wonder can anyone please point me some direction?
when I insmod the ko, dmesg gives me:
xyz.ko : no symbol version for module_layout
Any hint?
more info, I am compiling like:
I am aiming on compiling to for stock ROM, uname -r > 2.6.35.7-I9100XWKDD-CL161513
- I read, and follow base on http://forum.xda-developers.com/showthread.php?t=1113191
- kernel source from: SHW-M250L kernel source from OSRC, https://opensource.samsung.com/
- .config file of this post, select my wanted modules using make menuconfig
- then make ARCH=arm CROSS_COMPILE=__MYPATH__/bin/arm-none-eabi- modules
Thanks!
Hi,
I'm using insecure kernel :
Code:
#uname -r
2.6.35.7-I9100XWKE2-CL187606
I cross compiled modules using your config file but each time I'm trying to insmod it, I have: failed (Exec format error)
and busybox insmod gives me a invalid module format error
I use the commands :
Code:
make ARCH=arm CROSS_COMPILE=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi- menuconfig
make ARCH=arm CROSS_COMPILE=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi- modules
So I don't really know where I'm wrong here
alx5962 said:
Hi,
I'm using insecure kernel :
Code:
#uname -r
2.6.35.7-I9100XWKE2-CL187606
I cross compiled modules using your config file but each time I'm trying to insmod it, I have: failed (Exec format error)
and busybox insmod gives me a invalid module format error
I use the commands :
Code:
make ARCH=arm CROSS_COMPILE=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi- menuconfig
make ARCH=arm CROSS_COMPILE=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi- modules
So I don't really know where I'm wrong here
Click to expand...
Click to collapse
can you do a dmesg here?
I "think" I am on a same boat as you are on the error tho.....
I didn't checked dmesg, shame on me !
so the error is :
joydev: no symbol version for module_layout
I used your config file, do I need to fix config each time I update with menuconfig ?
alx5962 said:
I didn't checked dmesg, shame on me !
so the error is :
joydev: no symbol version for module_layout
I used your config file, do I need to fix config each time I update with menuconfig ?
Click to expand...
Click to collapse
dmesg is good to read, we are both compiling the same module (joydev)
the config file is not from me, is from jps1974.
no I don't think you need to fix unless you uses the build_kernel.sh unmod, since it cp the defconfig everytime, still I face the same problem...
Instead of SHW-M250L kernel source from OSRC, I just did a quick change to GT-I9100_HK_Opensource.zip
A little bit different on the package, but still the same work flow and results...
.config file:
cp ~/sgs2/9100i_hk/arch/arm/configs/c1_rev02_defconfig ~/sgs2/9100i_hk/kernel/.config
./fix_config.sh
make ARCH=arm CROSS_COMPILE=[PATH_TO_G++LITE_BIN] modules
compile without problem, but no luck, insmod still report:
insmod: init_module '/lib/modules/joydev.ko' failed (Exec format error)
dmesg | grep joy report:
joydev: no symbol version for module_layout
Any help, any directions?
Thanks in advance!!!
I used the european I9100 source from the samsung site and the config file from the opening post when I successfully compiled my modules.
Sent from my GT-I9100 using XDA App
richyy74 said:
I used the european I9100 source from the samsung site and the config file from the opening post when I successfully compiled my modules.
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
YES SIR, will do try this src next!!!!!
richyy74 would u mind share with us which kernel are you at on your phone?
and which version of toolchain u are using on the compile?
Thanks.
A bit of update, just try with GT-I9100_Opensource.zip, nope, still no luck........
I start to think would that be problem of toolchain (which in the readme of the zip from Samsung, they are using 2009q3 while I am using the current 2011 build), or it is possible problem because my/our unsecure kernel (2.6.35.7-I9100XWKDD-CL161513)...
update: Roll back on 2009q3, nope, no luck.............
I can only thinks that it is due to the kernel I am using.............
I compiled for ke7 and kf1 cifs, slow-work and cpu governor modules.
I used the 2009 gnu/linux toolchain from codesourcery /it ends with 67 something/
I never succeded with the version mentioned in the readme.
Sent from my GT-I9100 using XDA App
richyy74 said:
I compiled for ke7 and kf1 cifs, slow-work and cpu governor modules.
I used the 2009 gnu/linux toolchain from codesourcery /it ends with 67 something/
I never succeded with the version mentioned in the readme.
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
Thanks for your direction, will do more test after my "should have slept" 5 hours session.... which end up in data center instead of bed...
utp said:
Thanks for your direction, will do more test after my "should have slept" 5 hours session.... which end up in data center instead of bed...
Click to expand...
Click to collapse
The "exec format error" means that you compiled it for the wrong architecture.
To see which arch the kernel module was compiled for, use the "file" command (found on any Linux computer but not present on the phone itself).
The file command is an extremely useful function for identifying files.
So, at a terminal, type:
Code:
file -k /user/home/output/example.ko
It should output information on the file, which will clarify whether it was statically built, which architecture, etc. Examples:
Dynamically linked executable:
Code:
"ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped"
Statically linked executable:
Code:
"ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped"
Object file:
Code:
"ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped"
Most importantly, if it doesn't say 32bit ARM, it will not work.
So the module I cross-compiled gives me :
joydev.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped.
So it was correctly compiled, I may need to try another toolchain.
Using Sourcery G++ Lite 2009q3-68 for ARM EABI toolchain, still have the issue.
So as I use an insecure kernel, I may need to ask the author what compiler he used for it.

Huawei Honor 4c - Kernel compilation and boot.img creation

Hi all
Thanks to Olrak work for p8 lite, kirin version, i compiled a kernel for Huawei Honor 4c.
For now everything seems to work - android 6.0
Android 5.1 not tested
Code:
Changelog:
Android 6.0
boot60-v4
- added lionfish governor
- enabled all other deactivated governors
boot60-v3
- Initial public release, basic boot.img no tweaks
Android 5.1
boot51-v1
-initial Beta version for test
Downloads
Android 6.0
boot60-v3
boot60-v4
Android 5.1
boot51-v1
How to flash
Copy boot60-vxx.img to the root of your hdd (In windows c:\)
Enter fastboot
on a command line type
fastboot flash boot boot60-vxx.img
it will show something like this
Code:
target reported max download size of 471859200 bytes
sending 'boot' (23682 KB)...
OKAY [ 0.757s]
writing 'boot'...
OKAY [ 1.064s]
finished. total time: 1.825s
then
fastboot reboot
Your phone will reboot
Note:
If you have root you must re-root your phone
Version Information
Status: beta
Current Stable Version: v4
Stable Release Date: 2016-03-28
Created 2015-03-27
Last Updated 2016-03-28
github: android_kernel_huawei_hi6210sft
Kernel compilation error
Hi, Im trying to compile chm-u01 kernel on ubuntu 15.04, but I always get this error:
Code:
drivers/hisi/hi6xxx/hi6xxx_sim.c:24:24: fatal error: hi6xxx_sim.h: No such file or directory
compilation terminated.
scripts/Makefile.build:316: recipe for target 'drivers/hisi/hi6xxx/hi6xxx_sim.o' failed
make[3]: *** [drivers/hisi/hi6xxx/hi6xxx_sim.o] Error 1
scripts/Makefile.build:468: recipe for target 'drivers/hisi/hi6xxx' failed
make[2]: *** [drivers/hisi/hi6xxx] Error 2
scripts/Makefile.build:468: recipe for target 'drivers/hisi' failed
make[1]: *** [drivers/hisi] Error 2
make[1]: *** Waiting for unfinished jobs....
Must check if files are in correct location. Open makefile and see if files are correct sometimes changing < to " in file location helps compilation.
Are you using linaro?
Enviado do meu CHM-U01 através de Tapatalk
lloco73 said:
Must check if files are in correct location. Open makefile and see if files are correct sometimes changing < to " in file location helps compilation.
Are you using linaro?
Enviado do meu CHM-U01 através de Tapatalk
Click to expand...
Click to collapse
Yes I'm using linaro version 4.7.3, which toolchain do you using?
I'm with linaro also.
You are compiling arm or arm64?
Enviado do meu MotoG3 através de Tapatalk
Yu
lloco73 said:
I'm with linaro also.
You are compiling arm or arm64?
Enviado do meu MotoG3 através de Tapatalk
Click to expand...
Click to collapse
Its all I did:
Code:
.bashrc
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export PATH=/opt/toolchain/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_$
Code:
make ARCH=arm hisi_hi6210sft_defconfig
make ARCH=arm zImage
please tell me what os you are running and how you configured environment for compilation
Your doing the right things.
I'm on a virtual machine running 14.04lts 64bits.
I try to see that location and see what's inside that folder.
If find anything I copy here.
This Source code is full of errors.
Enviado do meu MotoG3 através de Tapatalk
on hi6xxx_sim.c
on line 24 change
Code:
#include <hi6xxx_sim.h>
to
Code:
#include "hi6xxx_sim.h"
whenever you find error just go to the *.c file and try to change the corresponding line presented on the error from <xxxxxx.h> to "xxxxxx.h"
I can say the you have a lot to change. i'll upload it so you can save time
here is my kernel fileshttps://drive.google.com/open?id=0B_LzOjvUsn4dSGUtaGRnRndXc3c
extract it and compile it.
arm64 gives a lot of errors so cannot be compiled.
arm is compiled ok.
i will upload it to github
Hi everybody. I tried to compile the source code, using toolchain from google, linaro. But after compiling I don't see the compiled file - "Image" (I can't compile the source code when I wrote to the end of command "zImage", so I just wrote "Image"), it does not exist. I tried to compile from patched source, but the same result.
What am i doing wrong?
how about doing make ARCH=arm only
fitsuli said:
Hi everybody. I tried to compile the source code, using toolchain from google, linaro. But after compiling I don't see the compiled file - "Image" (I can't compile the source code when I wrote to the end of command "zImage", so I just wrote "Image"), it does not exist. I tried to compile from patched source, but the same result.
What am i doing wrong?
Click to expand...
Click to collapse
Hi, I had a same situation, you have to check your compilation output there would be errors
lloco73 said:
here is my kernel fileshttps://drive.google.com/open?id=0B_LzOjvUsn4dSGUtaGRnRndXc3c
extract it and compile it.
arm64 gives a lot of errors so cannot be compiled.
arm is compiled ok.
i will upload it to github
Click to expand...
Click to collapse
I used your source and it gave me zImage output but there is an error:
arm-linux-gnueabihf-ld: unrecognized option `-EL'
Try `arm-linux-gnueabihf-ld --help' for more information
make[1]: *** [arch/arm/kernel/built-in.o] Error 1
make: *** [arch/arm/kernel] Error 2
Click to expand...
Click to collapse
lloco73 said:
how about doing make ARCH=arm only
Click to expand...
Click to collapse
Thanks, it works.
But it seems that the arm works only on Android 4.4, Android 5.1 requires arm64, right?
fitsuli said:
Thanks, it works.
But it seems that the arm works only on Android 4.4, Android 5.1 requires arm64, right?
Click to expand...
Click to collapse
Yes
arm64 is for 5.1 but with this source we cannot make it, but i think arm work also on 5.1, a lot of errors when compiling to arm64
lloco73 said:
Yes
arm64 is for 5.1 but with this source we cannot make it, but i think arm work also on 5.1, a lot of errors when compiling to arm64
Click to expand...
Click to collapse
Device hangs on the first pic (5.1).
I'll check everything again, maybe it's my mistake here.
fitsuli said:
Device hangs on the first pic (5.1).
I'll check everything again, maybe it's my mistake here.
Click to expand...
Click to collapse
adb does not work , right?
how you made boot.img. with all available tools i cannot have a decent boot.img extraction so i can replace zimage to my own.
For my experiences compiled zimage is a lot smaller then the original. is this the same for you?
lloco73 said:
Hi all
I compiled new kernel from source - Lollipop kernel- for the chm-u01 and want to replace my zImage to the stock boot.img to test it, but i can't do it.
When i extract stock boot.img i get all this files
Here is the log for extraction
Code:
Magic = ANDROID!
magic_offset = 0x00000000
page_size = 2048 (00000800)
board = ''
base = 0x07478000
kernel_addr = 0x07480000
kernel offset = 0x00008000
kernel_size = 20346584 (013676d8)
ramdisk_addr = 0x0f000000
ramdisk offset = 0x07b88000
ramdisk_size = 3698022 (00386d66)
second_addr = 0x08300000
second offset = 0x00e88000
second_size = 0 (00000000)
tags_addr = 0x09e00000
tags offset = 0x02988000
cmdline = 'hisi_dma_print=0 vmalloc=384M maxcpus=8 coherent_pool=512K no_irq_affinity androidboot.selinux=enforcing ate_enable=true'
dt_size = 0 (00000000)
Till here everything ok
All files are very tiny except boot.img-kernel cause is where kernel resides
If i try to open it with 7-zip inside it i have 2 files
Name-----------Size------------Compressed size-------Characteristics
.reloc-------------0-----------------------0-----------------InitializedData DiscardableRead 0x100000
.text----------2034632---------------2034632------------Code Execute Read Write 0x500000
Tried to replace my compiled zImage name to boot.img-kernel but when all repacked to a boot.img and flashed it trough Fastboot on power phone stuck on logo
If anyone is interested to help here are the
stock boot.img
My compiled zImage
Used tool for spliting boot.img was CarlivImageKitchen-Windows_v1.0 both on windows and Ubuntu
Click to expand...
Click to collapse
Hi, where you got boot.img?, when i try to extract stock boot.img that i extracted from lollipop frimware i get this error:
Android magic not found
boot. img was extracted from stock lollipop Rom.
Enviado do meu MotoG3 através de Tapatalk

[HELP][SOLVED]Errors while building from source

I am trying to port AOSPA marshmallow-caf (paranoid android) to victara and i cant get past these 2
1.
Code:
frameworks/base/packages/StatementService/src/com/android/statementservice/DirectStatementService.java:149: error: cannot access OkCacheContainer
mHttpResponseCache = HttpResponseCache.install(httpCacheDir, HTTP_CACHE_SIZE_IN_BYTES);
^
class file for com.android.okhttp.OkCacheContainer not found
1 error
make: *** [build/core/java.mk:394: out/target/common/obj/APPS/StatementService_intermediates/classes-full-debug.jar] Error 41
i tried building for the bacon using device trees and vendor stuff from official aospa repos but it also throws this error so i think its not device specific.
2.
Secondly the kernel is not compiling its throwing section mismatch error
Code:
ERROR: modpost: Found 11 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
To build the kernel despite the mismatches, build with:
'make CONFIG_NO_ERROR_ON_MISMATCH=y'
(NOTE: This is not recommended)
i am using the CM kernel sources and defconfig
On googling someone suggested to change toolchains so switched to the one provided in AOSPA manifest (namely eabi-4.8 toolchain in google aosp repos , revision android-r16) previously i was using UBERTC arm-eabi-4.8.
But the exact same error popped up and the exact same file vmlinux.o
Interestingly the kernel is built successfully if i build it separately outside the AOSPA tree , or if i build it inside resurrection remix source tree , with both the toolchains .
Also since i mentioned bacon previously , bacon's kernel doesn't throw this error.
EDIT :
I reverted this
the kernel compiled without section mismatches but i encountered
Code:
The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.
make[2]: *** [modules] Error 1
make[1]: *** [sub-make] Error 2
i think this and this were responsible
i tried compiling with
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
and got the bootimg
so i guess kernel is done
but the class file not found error remains
Ok so i was able to fix the class file not found error also
The problem was that i was using jdk8 i switched to jdk7 and it compiled successfully

Build problem aosp togari (xperia z1 ultra ) LP

Hi all,
i had my last night spent trying searching solution for attached error any help will be highly appreciated
I am new to club on development rom ( aosp)
Details below
instructions followed from ( https://developer.sonymobile.com/op...ld-aosp-lollipop-for-unlocked-xperia-devices/)
using ubuntu LTS 16.04 64 bits , 4 gb ram , 4 processors (VM )
openjdk 7
repo Sync successfully:victory:
lunch successfully:victory:
Make -j or make -j4 are showing errors ( please see attached screen shot )
i tried clean build but no luck ,
its really annoying error , why a build should stumble upon a config which is totally service provider dependent not device dependent ... i am talking about APN . phone OS or complie should not be dependent on APN weather its avilable feeling terrible on the way or thought of person who design it this way
Follows are the error message dump last few lines.
Code:
including ./vendor/sony/yukon-seagull/proprietary/Android.mk ...
including ./vendor/sony/yukon-tianchi/proprietary/Android.mk ...
[COLOR="Red"]PRODUCT_COPY_FILES device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml ignored.
No private recovery resources for TARGET_DEVICE togari
make: *** No rule to make target '–j'. Stop.[/COLOR]
#### make failed to build some targets (01:32 (mm:ss)) ####
ok finally i managed some how to complete the make aosp for togari marshmellow and follows is the result but its only showing system.img in out folder , while boot.img and user.img are missing ? any ideas whats gone wrong ... as per my understanding boot.img is actually recovery .img ?
if i just flash via fastboot the system.img will it work ?

[help] please

i am trying to compile this kernel source
https://github.com/jedld/kernel_9832_7.git
I am getting this error
Makefile:130: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
Click to expand...
Click to collapse
my system linux mint 19.1 cinnamon
AMD A8-7410 APU with AMD Radeon R5 Graphics × 4
kernel 4.15.0-46 genric
ram 8gb
Looks my system has problem because i had compiled samsung j3 pro kernel earlier in this.
Edit - i reinstall os but problem persists while compiling this kernel source. I have tried 3 gcc toolchain version 4.8.
Even i build kernel for sm-j320f with same toolchains without error.
Please help...

Categories

Resources