Compiling Lollipop - Nokia X

when I try to compile Lollipop
I get this error
device/nokia/normandy/Android.mk:27: *** my-dir must be called before including any other makefile ... stop
I've been search on google and XDA
but all the same, must edit the Android.mk, which " LOCAL_PATH :=$(call my-dir) " must be at the beginning
I'm done with it, and still get that error
anyone know how to fix this?

Related

[Q] Kernel compiling problems

Can anyone tell me what this means and what to do to fix it?
cc1: warnings being treated as errors
init/main.c: In function 'do_one_initcall':
init/main.c:734:10: error: 'calltime.tv64' may be used uninitialized in this function
make[1]: *** [init/main.o] Error 1
make: *** [init] Error 2
Edit: Resolved, was missing Bootimage.
I still get other errors. Is there anyone who can post a guide to compile stock kernel? I would expand from there if I could just get it to compile.
Can't seem to get a kernel to compile. I know I am missing something.
dieselford said:
Can anyone tell me what this means and what to do to fix it?
cc1: warnings being treated as errors
init/main.c: In function 'do_one_initcall':
init/main.c:734:10: error: 'calltime.tv64' may be used uninitialized in this function
make[1]: *** [init/main.o] Error 1
make: *** [init] Error 2
Edit: Resolved, was missing Bootimage.
I still get other errors. Is there anyone who can post a guide to compile stock kernel? I would expand from there if I could just get it to compile.
Can't seem to get a kernel to compile. I know I am missing something.
Click to expand...
Click to collapse
Try this thread...
http://forum.xda-developers.com/showthread.php?t=1197147

FTDI kernel module unknown relocation

Hey guys,
I've spent a few days now researching and attempting to build the FTDI kernel module for my Archos 70b. After following this guide I managed to get a successful compilation. I uploaded it to my device (which was rooted via Paul's root and rebooted into sde). When I attempt to use insmod, I get the following error: insmod: cannot insert '/sdcard/ftdi_sio.ko': Invalid module format (-1): Exec format error. I ran 'dmesg -c' and got the following output: [ 684.472290] ftdi_sio: unknown relocation: 27. I have the usbserial module installed already as well. What is the problem here? I'm assuming by relocation it means it's loading the module into the wrong part of the address space? I could be very off I'm new to this process. I just want to thank everyone in advance for their help, this is my first post and I've used these forums extensively over the last few days. You have a great community here.
A little extra information:
I'm using the toolkit from the android-ndk-r8. My makefile looks like this:
obj-m := ftdi_sio.o
KDIR := ~/bin/gen8/archos-gpl-gen9-kernel/
PWD := $(shell pwd)
CCPATH := ~/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
whistlinwilly said:
Hey guys,
I've spent a few days now researching and attempting to build the FTDI kernel module for my Archos 70b. After following this guide I managed to get a successful compilation. I uploaded it to my device (which was rooted via Paul's root and rebooted into sde). When I attempt to use insmod, I get the following error: insmod: cannot insert '/sdcard/ftdi_sio.ko': Invalid module format (-1): Exec format error. I ran 'dmesg -c' and got the following output: [ 684.472290] ftdi_sio: unknown relocation: 27. I have the usbserial module installed already as well. What is the problem here? I'm assuming by relocation it means it's loading the module into the wrong part of the address space? I could be very off I'm new to this process. I just want to thank everyone in advance for their help, this is my first post and I've used these forums extensively over the last few days. You have a great community here.
A little extra information:
I'm using the toolkit from the android-ndk-r8. My makefile looks like this:
obj-m := ftdi_sio.o
KDIR := ~/bin/gen8/archos-gpl-gen9-kernel/
PWD := $(shell pwd)
CCPATH := ~/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
Click to expand...
Click to collapse
Hi !
First be sure that you have the same version kernel->module , run modinfo module.ko and vermagic need to be the same with kernel version !
- if it's ok you can try strings module.ko and than insmod module.ko !
( but can be many things wrong in your process of compiling module !!! ) Good luck ...
I can confirm that the versions are the same, I was using an incorrect version before and dmesg was complaining. I've since compiled the module for the right kernel version and now dmesg only gives me the "unknown relocation: 27" error.
I ran the strings command, it outputted over 4000 lines. I'm not quite sure what you could gain from the output but I can attached the text file I piped it to if that will be helpful.
whistlinwilly said:
I can confirm that the versions are the same, I was using an incorrect version before and dmesg was complaining. I've since compiled the module for the right kernel version and now dmesg only gives me the "unknown relocation: 27" error.
I ran the strings command, it outputted over 4000 lines. I'm not quite sure what you could gain from the output but I can attached the text file I piped it to if that will be helpful.
Click to expand...
Click to collapse
Ok!
May be you have a problem when your module "export symbols" -> take a look into Module.symvers ... and see if something export !
I looked around and couldn't find Module.symvers either in the source code or on the actual device. Do you know where I might be able to find it or how I can create the file myself? When the module is compiled, make throws a warning about not being able to find it. I think this is the problem.
whistlinwilly said:
I looked around and couldn't find Module.symvers either in the source code or on the actual device. Do you know where I might be able to find it or how I can create the file myself? When the module is compiled, make throws a warning about not being able to find it. I think this is the problem.
Click to expand...
Click to collapse
Hi !
...maybe it help you => http://tldp.org/LDP/lkmpg/2.6/html/lkmpg.html
( module.symvers is created after you run make ( for make module) in directory where you compile module )
I'm not quite sure I understand. I get a warning
WARNING: Symbol fakepath/kernel/Module.symvers
is missing; modules will have no dependencies and modversions.
when I run make in the modules folder. There IS a file created called Module.symvers after I run make, but it is empty; I'm assuming its just a copy of whatever Module.symvers file it is actually looking for.
Has anyone compiled the archos gen9 kernel that might have created this file and can pass it along to me?
whistlinwilly said:
A little extra information:
I'm using the toolkit from the android-ndk-r8. My makefile looks like this:
obj-m := ftdi_sio.o
KDIR := ~/bin/gen8/archos-gpl-gen9-kernel/
PWD := $(shell pwd)
CCPATH := ~/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
Click to expand...
Click to collapse
Hi whistlinwilly
Are you sure you've grabbed the right kernel source - your KDIR says gen9, if your compiling for the 70b you probably need the gen8 kernel source code as I think it's on the Gen8 product line
you can check which kernel version you have by running the following from a command prompt.
Code:
adb shell uname -a
Hope that helps
Hey whistlinwilly,
i don't know if you were successful in the meantime, but here's what i suggest for simple kernel module compilation...
You might refer to my custom kernel thread and check my toolchain, which is ready to rock (only 32bit linux right now):
http://forum.xda-developers.com/showthread.php?t=1328027
To compile custom kernel/modules only, look here as well:
http://forum.xda-developers.com/showpost.php?p=19134490&postcount=8
The archos specific toolchain uses uclibc and is used for kernel and userland.
So if you use stock kernel, but choose a different toolchain (e.g. libc based) to compile your modules, you might run into trouble at some point.
BTW, is it correct that you talk about this device:
http://www.archos.com/products/ta/archos_70b/index.html?country=de&lang=de
Not sure which family it exactly belongs to
If you're talking about this one:
http://www.archos.com/products/ta/archos_70it2/index.html?country=de&lang=de
...the kernel should be 2.6.35 then.
http://gitorious.org/archos/archos-gpl-gen9-kernel
I'm not aware of any config for the A70IT2 though.
Please refer to trevd's suggestion and find out your kernel release first...
Good luck!
scholbert
I had the same problem (Relocation error: 27) when trying to compile a custom kernel module for my Moto xoom running Honeycomb.
I was able to compile successfully by rolling back to Android NDK 5b. I also had to force the vermagic string to read ARMv7 so I know this isn't the right way to solve the problem, but when I compiled with the 5b toolchain, the relocation error goes away and I am able to insmod without error on the tablet.
I would love to know why this works and the right way to get NDK 7 to work with this, if anyone can shed some light??
EDIT:
On further digging and testing- I realize it is not necessarily NDK 5b, but rather the toolchain "arm-eabi-4.4.0" as opposed to using the "arm-linux-androideabi-4.4.3" toolchain, that makes the difference with the "unknown relocation 27" error. It just so happens that NDK 5b is the last NDK that shipped with both toolchains, AFAIK.
It still for some reason likes to compile under ARMv5 unless I force it to use ARMv7 but this issue is probably unrelated- I didn't mean to confuse things with the ARM v5/v7 versus NDKr5 /NDKr7 which don't correlate...
Anyway I hope this helps, or maybe someone else who knows more can help us both!
Well, I solved my toolchain issue- I just needed to add an EXTRA_CFLAGS=-fno-pic to get the arm-linux-androideabi-4.4.3 toolchain to compile without seeing an unknown relocation error on the tablet.
Hope this helps someone!
the_zuck said:
Well, I solved my toolchain issue- I just needed to add an EXTRA_CFLAGS=-fno-pic to get the arm-linux-androideabi-4.4.3 toolchain to compile without seeing an unknown relocation error on the tablet.
Hope this helps someone!
Click to expand...
Click to collapse
Thanks a million, finally got past the relocation 27 error now. Insmod doesn't complain anymore and the drivers load successfully, now to just figure out why I'm getting a backtrace on device insertion.
Thanks for solving my major headache tho
Exec format error
the_zuck said:
Well, I solved my toolchain issue- I just needed to add an EXTRA_CFLAGS=-fno-pic to get the arm-linux-androideabi-4.4.3 toolchain to compile without seeing an unknown relocation error on the tablet.
Hope this helps someone!
Click to expand...
Click to collapse
Ok, thanks for the answer. My first post here.
After this got solved. I still have "Exec format error". And! and no errors are display in dmesg. Are there any other places where the error might be displayed? I just created a simple printk("hello world") project.
If i remove the printk it doesn't show the error.
I don't know whether to laugh or cry. I dabbled my self to the brink of madness to solve this. I couldn't find a solution anywhere. Finally solved it after 6 weeks of my time. Probably my boss at work will not be happy if he finds I was working on this instead of working.
And I find the solution here 2 days after I solved it. WOW!!!:crying::crying:
But my saga still continues...

Kernel Compiling Problem

Hello!
I need to say this first : i'm a newbie at development but i want to learn.
I succesfully managed to compile CM9 from CyanogenMod sources but i have some problems trying to compile mike's cm10.1 kernel.I followed his tutorial changing smultron to zeus in terminal,it gave me something about trying dependecies only and then moved on(tried with smultron too and same message) .It compiles for about half hour and then it says :
Code:
host StaticLib: libLLVMCore (/home/filip/android/system/out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMCore_intermediates/libLLVMCore.a)
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/filip/android/system/kernel/semc/msm7x30'
make: *** [TARGET_KERNEL_BINARIES] Error 2
make: *** Waiting for unfinished jobs....
[email protected]:~/android/system$
The changes I have made to the kernel where to change the input drivers from him with the input drivers from DoomLord 3.4 kernel for msm7x30 zeus branch , but I don't think this is the main reason of this error.
EDIT: Compiled succesfully with the input folder from mike's sources.Any idea how to resolve the problem with the input folder from DoomLord ? in his git he says the the touchscreen problem is resolved.
EDIT 2: New error:
Code:
scripts/kconfig/conf --silentoldconfig Kconfig
GEN /home/filip/android/system/out/target/product/zeus/obj/KERNEL_OBJ/Makefile
CHK include/linux/version.h
Using /home/filip/android/system/kernel/semc/msm7x30 as source for kernel
CHK include/generated/utsrelease.h
make[3]: `include/generated/mach-types.h' is up to date.
CALL /home/filip/android/system/kernel/semc/msm7x30/scripts/checksyscalls.sh
CHK include/generated/compile.h
GZIP kernel/config_data.gz
CHK kernel/config_data.h
UPD kernel/config_data.h
CC kernel/configs.o
CC drivers/input/touchscreen/cy8ctma300_touch.o
LD kernel/built-in.o
/home/filip/android/system/kernel/semc/msm7x30/drivers/input/touchscreen/cy8ctma300_touch.c:185:28: error: expected ')' before 'int'
/home/filip/android/system/kernel/semc/msm7x30/drivers/input/touchscreen/cy8ctma300_touch.c:186:32: error: expected ')' before string constant
/home/filip/android/system/kernel/semc/msm7x30/drivers/input/touchscreen/cy8ctma300_touch.c: In function 'perform_reset':
/home/filip/android/system/kernel/semc/msm7x30/drivers/input/touchscreen/cy8ctma300_touch.c:488:2: error: implicit declaration of function 'gpio_set_value' [-Werror=implicit-function-declaration]
/home/filip/android/system/kernel/semc/msm7x30/drivers/input/touchscreen/cy8ctma300_touch.c:492:2: error: implicit declaration of function 'gpio_get_value' [-Werror=implicit-function-declaration]
/home/filip/android/system/kernel/semc/msm7x30/drivers/input/touchscreen/cy8ctma300_touch.c: At top level:
/home/filip/android/system/kernel/semc/msm7x30/drivers/input/touchscreen/cy8ctma300_touch.c:1104:13: error: 'THIS_MODULE' undeclared here (not in a function)
/home/filip/android/system/kernel/semc/msm7x30/drivers/input/touchscreen/cy8ctma300_touch.c:1106:2: error: unknown field 'ioctl' specified in initializer
/home/filip/android/system/kernel/semc/msm7x30/drivers/input/touchscreen/cy8ctma300_touch.c:1106:2: warning: initialization from incompatible pointer type [enabled by default]
error, forbidden warning: cy8ctma300_touch.c:1106
make[5]: *** [drivers/input/touchscreen/cy8ctma300_touch.o] Error 1
make[4]: *** [drivers/input/touchscreen] Error 2
make[3]: *** [drivers/input] Error 2
make[2]: *** [drivers] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/filip/android/system/kernel/semc/msm7x30'
make: *** [TARGET_KERNEL_BINARIES] Error 2
I attached cy8ctma300_touch.c
sorry.. of topic.. but thanks.. thanks for Trying .. for yourself and Us.. .. I hope someone can answer that.
I tried to compile kernel with cy8ctma300_touch.c from Wedgess's 2.6 kernel from
[DEV][WIP][PLAY] cm 10.1 & pac 4.2 [ROM][KERNEL][4.2.2][UPDATED 21-03-13] and i got exactly same error
As you said, CM10.1 compile without errors with it's own cy8ctma300_touch.c
I'll look into it as much my limited knowledge about linux/kernel things alow me (noob here also, this was my very first rom/kernel compiled from source )
Bakisha said:
I tried to compile kernel with cy8ctma300_touch.c from Wedgess's 2.6 kernel from
[DEV][WIP][PLAY] cm 10.1 & pac 4.2 [ROM][KERNEL][4.2.2][UPDATED 21-03-13] and i got exactly same error
As you said, CM10.1 compile without errors with it's own cy8ctma300_touch.c
I'll look into it as much my limited knowledge about linux/kernel things alow me (noob here also, this was my very first rom/kernel compiled from source )
Click to expand...
Click to collapse
I also want to get into Kernel Compiling.. and ROM compiling of course.. can anyone suggest me is my computer specs enough for compiling and Dual Booting Windows 8 and Ubuntu.. (should I even use Ubuntu ?? or any other distro.. plz recommend) .
My Computer Specs are
4GB Ram
Intel Core 2 Duo CPU T9300 @ 2.50 Ghz
650gb HD
Windows 8 Pro 64 Bit.
yes , it's enough . I don't know if you could resolve anything but you can try . there are a lots of guides on the net about how to do this.
Bakisha said:
I tried to compile kernel with cy8ctma300_touch.c from Wedgess's 2.6 kernel from
[DEV][WIP][PLAY] cm 10.1 & pac 4.2 [ROM][KERNEL][4.2.2][UPDATED 21-03-13] and i got exactly same error
As you said, CM10.1 compile without errors with it's own cy8ctma300_touch.c
I'll look into it as much my limited knowledge about linux/kernel things alow me (noob here also, this was my very first rom/kernel compiled from source )
Click to expand...
Click to collapse
ChunkFlip said:
yes , it's enough . I don't know if you could resolve anything but you can try . there are a lots of guides on the net about how to do this.
Click to expand...
Click to collapse
what distro to use.. lubuntu,, xubuntu.. Ubuntu.. ? which is most stable for android compiling.. and I might start using it as daily driver besides Windows as well.. (don't think so., but maybe.. hehe)
saqibkhan said:
what distro to use.. lubuntu,, xubuntu.. Ubuntu.. ? which is most stable for android compiling.. and I might start using it as daily driver besides Windows as well.. (don't think so., but maybe.. hehe)
Click to expand...
Click to collapse
I'm using Ubuntu 13.10 x64 in Virtualbox. I firstly tried 12.04 LTS but it gave me nothing but trouble in virtualbox.
As in OP, i followed Mike's guide to build from source
As for initial setting up ubuntu i followed this guide and lot of "googling" (basicly, whatever error i get, i copy that text and paste it to google search).
But be warned, source is at least 15GB, it can take some time to download. Plus, compiling time (at least for me) is 3 or 4 hours (if building only kernel, it's shorter, about half an hour)
My progress is very slow, don't have much time for testing, but so far i found that maybe error is not in Mike's cy8ctma300_touch.c but rather difference in kernel between 2.6 and 3.4 . For example, it compile ok if in line 1106 in wedgess cy8ctma300_touch.c i enter ".unlocked_ioctl" instead of just ".ioctl" but touchscreen don't work still. In Mike's kernel there is already line with ".unlocked_ioctl" so it don't give error when compiling.
I still have to try something i found on web, but i don't know will i be able to do it this weekend...
Bakisha said:
I'm using Ubuntu 13.10 x64 in Virtualbox. I firstly tried 12.04 LTS but it gave me nothing but trouble in virtualbox.
As in OP, i followed Mike's guide to build from source
As for initial setting up ubuntu i followed this guide and lot of "googling" (basicly, whatever error i get, i copy that text and paste it to google search).
But be warned, source is at least 15GB, it can take some time to download. Plus, compiling time (at least for me) is 3 or 4 hours (if building only kernel, it's shorter, about half an hour)
My progress is very slow, don't have much time for testing, but so far i found that maybe error is not in Mike's cy8ctma300_touch.c but rather difference in kernel between 2.6 and 3.4 . For example, it compile ok if in line 1106 in wedgess cy8ctma300_touch.c i enter ".unlocked_ioctl" instead of just ".ioctl" but touchscreen don't work still. In Mike's kernel there is already line with ".unlocked_ioctl" so it don't give error when compiling.
I still have to try something i found on web, but i don't know will i be able to do it this weekend...
Click to expand...
Click to collapse
I think if Ubuntu is installed as a separate Operating system.. it would take less time to build.. 3-4 hours is tooo long.. anyways.. I am going to install it DUal boot it with Windows 8.. and start compiling then.

System Classes Import

I've observed that some modules source code have system package specific imports
example:
Code:
import com.android.systemui.statusbar.BaseStatusBar;
import com.android.systemui.statusbar.NotificationData;
import com.android.systemui.statusbar.NotificationData.Entry;
I've picked this code from serajr blurred systemui module.
I'm using android studio but even in eclipse I cant import them
but I've tried lots of methods but I coudn't find a way for importing it, it says that it's not there, can someone help me please?
thank you
Depends on the SDK version you're targeting.
If I recall correctly before Lollipop (or maybe KitKat?) you could simply import system classes by adding private Andoid libraries to classpath in your IDE.
But for never Androids you need to move all your Class loading to handleLoadPackage in the module because of ClassLoader changes, or else your module isn't gonna work even if it compiles right.
XspeedPL said:
Depends on the SDK version you're targeting.
If I recall correctly before Lollipop (or maybe KitKat?) you could simply import system classes by adding private Andoid libraries to classpath in your IDE.
But for never Androids you need to move all your Class loading to handleLoadPackage in the module because of ClassLoader changes, or else your module isn't gonna work even if it compiles right.
Click to expand...
Click to collapse
I solved it by adding the hidden libs and decompiling systemui, picking the dex file, converting it to jar and adding provide dependency on android studio, but thanks anyway
Xiaomi Poco F1 [ROM] [8.1.0] ResurrectionRemix v6.2.1
I installed xposed v90beta3, I can not start the module, it gives an error.
Help solve the problem
zygote64(3278): ClassLoaderContext size mismatch. expected=1, actual=2 (PCL[] | PCL[];PCL[/data/dalvik-cache/xposed_XResourcesSuperClass.dex*2802528989:/data/dalvik-cache/xposed_XTypedArraySuperClass.dex*708326108])

How do I provide libqdMetaData_intermediates/export_includes?

When trying to build AOSP Nougat for the Z1C according to Sony's HowTo (which is for MarshMallow) the build runs on the following error:
Code:
Running kati to generate build-aosp_d5503.ninja...
No need to regenerate ninja file
Starting build with ninja
ninja: Entering directory `.'
ninja: error: 'out/target/product/amami/obj/SHARED_LIBRARIES/libqdMetaData_intermediates/export_includes', needed by 'out/target/product/amami/obj/SHARED_LIBRARIES/camera.msm8974_intermediates/import_includes', missing and no known rule to make it
make: *** [build/core/ninja.mk:149: ninja_wrapper] Error 1
#### make failed to build some targets (5 seconds) ####
How do I fix this? I don't know how the build chain works ...looks like there can always be an export_includes folder and an import_includes folder. I guess these are folders for C header files. Sony's manifest xml removes the default camera and adds a different camera project. I already tried disabling both xml tags, re-run lunch and started compiling again - but with the same result.
Maybe I should start with this question: How can I provide a required dependency in the build chain in general?
Meanwhile I found Sony's HowTo for Nougat and now all dependencies are fulfilled. Anyway I would like to understand the build process, so answers to my question are still welcome.
thorstenhirsch said:
Meanwhile I found Sony's HowTo for Nougat and now all dependencies are fulfilled. Anyway I would like to understand the build process, so answers to my question are still welcome.
Click to expand...
Click to collapse
I don't think you're gonna get anywhere with this because there are no Nougat binaries available ATM.

Categories

Resources