[HELP] Compiling Kernel : Makefile errors - Android Q&A, Help & Troubleshooting

Hi,
I'm trying to compile the kernel source from @flar2
I didn't find a specific build instructions so followed the usual method
After pointing to toolchain folder
Kernel source: https://github.com/korom42/ocean
My working setup:
Information about my OS:
Virtualization: oracle
OS: Ubuntu 16.04 Fedora 28 (Workstation Edition)
Kernel: Linux 4.17.17-200.fc28.x86_64
CPU: Intel Core i5-7200u @ 2x 2.7GHz [50.0°C]
GPU: intel
RAM: 2048MiB
Prepare :
Code:
export CROSS_COMPILE=/home/korom42/aarch64-linux-android-4.9/bin/aarch64-linux-android-
export ARCH=arm64
export SUBARCH=arm64
export USE_CCACHE=1
make elementalx_defconfig
make /or make O=out
Compile issue:
http://prntscr.com/kl1gyi
lib/Makefile:17: *** recipe commences before first target. Stop.
Makefile:1213: recipe for target '_clean_lib' failed
make: *** [_clean_lib] Error 2
Update: I changed my building environment to Fedora 28 and that problem is fixed now. But, I am getting another error I guess it is related to the source code , I found a similar issue here
Code:
[...]
CC drivers/base/module.o
CC drivers/base/soc.o
CC drivers/base/pinctrl.o
CC drivers/base/platform-msi.o
LD drivers/base/built-in.o
CC drivers/block/brd.o
CC drivers/block/loop.o
CC drivers/block/zram/zcomp_lzo.o
CC drivers/block/zram/zcomp.o
CC drivers/block/zram/zram_drv.o
CC drivers/block/zram/zcomp_lz4.o
LD drivers/block/zram/zram.o
LD drivers/block/zram/built-in.o
LD drivers/block/built-in.o
CC drivers/bluetooth/bluetooth-power.o
CC drivers/bluetooth/btfm_slim.o
drivers/bluetooth/btfm_slim.c:26:23: fatal error: btfm_slim.h: No such file or directory
#include <btfm_slim.h>
^
compilation terminated.
make[2]: *** [scripts/Makefile.build:264: drivers/bluetooth/btfm_slim.o] Error 1
make[1]: *** [scripts/Makefile.build:408: drivers/bluetooth] Error 2
make: *** [Makefile:966: drivers] Error 2
I also tried
Code:
make O=out clean
And got the same error

Update:
Possibly similar issue here
I guess it is source code related ? Any ideas how to fix that

Related

[Q] Compile CM10 Kernel: Successful but non-existant?

Hi All,
I'm not sure what I'm doing wrong here. I'm trying to compile a CyanogenMod kernel for my device (Transformer Prime, but this really applies to any device) so that I can create additional/alternative kernel modules.
I followed this wiki for a Fedora 64it system with some changes based on it being out of date: http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source
Code:
yum install git gnupg java-1.6.0-openjdk-devel flex bison gperf SDL-devel esound-devel wxGTK-devel zip curl ncurses-devel zlib-devel gcc-c++
yum install glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686
mkdir -p ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
echo $PATH|grep ~/bin>/dev/null||export PATH="${PATH}":~/bin
mkdir -p [B]/storage/Software/Android/TransformerPrime/Cyanogenmod10/[/B]android/system
cd [B]/storage/Software/Android/TransformerPrime/Cyanogenmod10/[/B]android/system
repo init -u git://github.com/CyanogenMod/android.git -b [B]jellybean[/B]
repo sync -j16
I then downloaded Sourcery CodeBench Lite 2012.03-56 for ARM EABI from https://sourcery.mentor.com/GNUToolchain/release2188 as a tar.bz and extracted it out. Interestingly in 4.4.3 they added "none" into the executable name, though that didn't seem to cause any issues during compile.
Code:
export CCOMPILER=[B]"/storage/Software/Android/TransformerPrime/Cyanogenmod10/eabi/arm-2012.03/[/B]bin/arm-[B]none[/B]-eabi-"
mkdir -p [B]/storage/Software/Android/TransformerPrime/Cyanogenmod10[/B]/android/kernel
cd [B]/storage/Software/Android/TransformerPrime/Cyanogenmod10/[/B]android/kernel
git clone git://github.com/CyanogenMod/cm-kernel.git
cd cm-kernel
Then went into my ADB folder to grab the config.gz file off my Transformer Prime and put it in the cm-kernel directory.
Code:
cat config.gz | gunzip > .config
make ARCH=arm CROSS_COMPILE=$CCOMPILER menuconfig
It brought up the menu config, I went straight to exit and saved.
Code:
make ARCH=arm CROSS_COMPILE=$CCOMPILER -j`grep 'processor' /proc/cpuinfo | wc -l`
So in the above it compiled. I did not see any errors, but /storage/Software/Android/TransformerPrime/Cyanogenmod10/android/kernel/cm-kernel/arch/arm/boot/zImage was missing.
Any ideas why or what I've done wrong?
Thanks,
Ben
Interesting.. it didn't show errors at the end of the compile, but running the last make command again returned:
Code:
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC drivers/mmc/host/sdhci.o
CC drivers/net/ppp_generic.o
CC drivers/power/power_supply_core.o
CC drivers/regulator/core.o
CC drivers/rtc/rtc-lib.o
drivers/mmc/host/sdhci.c: In function 'sdhci_suspend_host':
drivers/mmc/host/sdhci.c:1652:2: error: too few arguments to function 'mmc_suspend_host'
include/linux/mmc/host.h:285:12: note: declared here
CC drivers/regulator/dummy.o
make[3]: *** [drivers/mmc/host/sdhci.o] Error 1
make[2]: *** [drivers/mmc/host] Error 2
make[1]: *** [drivers/mmc] Error 2
make[1]: *** Waiting for unfinished jobs....
CC drivers/rtc/hctosys.o
CC drivers/rtc/class.o
CC drivers/power/power_supply_sysfs.o
CC drivers/regulator/fixed.o
CC drivers/rtc/interface.o
LD drivers/power/power_supply.o
LD drivers/power/built-in.o
CC drivers/rtc/rtc-dev.o
CC drivers/rtc/rtc-proc.o
CC drivers/rtc/rtc-sysfs.o
CC drivers/rtc/alarm.o
CC drivers/regulator/virtual.o
CC drivers/regulator/tps6586x-regulator.o
CC drivers/rtc/alarm-dev.o
CC drivers/net/ppp_mppe.o
LD drivers/rtc/rtc-core.o
CC drivers/net/pppox.o
CC drivers/net/pppolac.o
LD drivers/regulator/built-in.o
CC drivers/net/pppopns.o
CC drivers/net/slhc.o
LD drivers/rtc/built-in.o
CC drivers/net/dummy.o
CC drivers/net/tun.o
LD drivers/net/arm/built-in.o
LD drivers/net/caif/built-in.o
CC drivers/net/usb/asix.o
LD drivers/net/wireless/built-in.o
CC drivers/net/usb/cdc_ether.o
CC drivers/net/usb/smsc95xx.o
CC drivers/net/usb/cdc_subset.o
CC drivers/net/usb/usbnet.o
drivers/net/usb/cdc_subset.c:221:2: warning: #warning You need to configure some hardware for this driver [-Wcpp]
LD drivers/net/usb/built-in.o
LD drivers/net/built-in.o
make: *** [drivers] Error 2
Any thoughts?
And as a final thought, since I don't need the kernel just modules I commented out the line just to see if it would build, and came up with:
Code:
/storage/Software/Android/TransformerPrime/Cyanogenmod10/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-ld: no machine record defined
/storage/Software/Android/TransformerPrime/Cyanogenmod10/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-ld: no machine record defined
This was also after trying the toolchain that came with the cyanogenmod source.

[Q] Trouble trying to compile the DNA kernel

Hi guys,
I've really been having a hard time trying to compile a kernel for the Droid DNA. I've downloaded the kernel source from the HTC dev site, and within the download there is a readme which suggests to download this toolchain "git clone https://android.googlesource.com/platform/prebuilt." I have tried the toolchains included in this, but they never finish the compiling process. It's weird because it looks like it is processing nicely, and even runs for several minutes, but it just stops abrubtly and does not produce the zimage. I have also tried toolchains from the official Android NDK and even a custom one I found, with no luck. Most of the other toolchains just crap out with a bunch of errors, which looks like it is missing some library files, so I don't know what to do there.
Do you actually need to install the toolchain somehow, or can you just do an export CROSS_COMPILE=~/toolchain/bin/arm-linux-androideabi- to handle this? I would be more than greatful to get any sort of assistance with this, as it is starting to drive me nuts! lol. I also uploaded some of the errors and final output from my last compile.
stevedub40 said:
Hi guys,
I've really been having a hard time trying to compile a kernel for the Droid DNA. I've downloaded the kernel source from the HTC dev site, and within the download there is a readme which suggests to download this toolchain "git clone https://android.googlesource.com/platform/prebuilt." I have tried the toolchains included in this, but they never finish the compiling process. It's weird because it looks like it is processing nicely, and even runs for several minutes, but it just stops abrubtly and does not produce the zimage. I have also tried toolchains from the official Android NDK and even a custom one I found, with no luck. Most of the other toolchains just crap out with a bunch of errors, which looks like it is missing some library files, so I don't know what to do there.
Do you actually need to install the toolchain somehow, or can you just do an export CROSS_COMPILE=~/toolchain/bin/arm-linux-androideabi- to handle this? I would be more than greatful to get any sort of assistance with this, as it is starting to drive me nuts! lol. I also uploaded some of the errors and final output from my last compile.
Click to expand...
Click to collapse
Hmm, it doesn't look like my file uploaded. Here it is in code tags:
Code:
net/netfilter/xt_mark.c:16:37: error: linux/netfilter/xt_mark.h: No such file or directory
net/netfilter/xt_mark.c: In function 'mark_tg':
net/netfilter/xt_mark.c:32: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c:32: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c: In function 'mark_mt':
net/netfilter/xt_mark.c:41: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c:41: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c:41: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c: At top level:
net/netfilter/xt_mark.c:49: error: invalid application of 'sizeof' to incomplete type 'struct xt_mark_tginfo2'
net/netfilter/xt_mark.c:58: error: invalid application of 'sizeof' to incomplete type 'struct xt_mark_mtinfo1'
make[2]: *** [net/netfilter/xt_mark.o] Error 1
make[1]: *** [net/netfilter] Error 2
make[1]: *** Waiting for unfinished jobs....
drivers/mfd/pm8921-core.c:211: error: resources_pwrkey causes a section type conflict
drivers/mfd/pm8921-core.c:211: error: resources_pwrkey causes a section type conflict
drivers/mfd/pm8921-core.c:165: error: adc_cell_resources causes a section type conflict
drivers/mfd/pm8921-core.c:165: error: adc_cell_resources causes a section type conflict
make[2]: *** [drivers/mfd/pm8921-core.o] Error 1
make[1]: *** [drivers/mfd] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [net] Error 2
make: *** Waiting for unfinished jobs....
CC drivers/media/video/msm/wfd/enc-subdev.o
CC drivers/media/video/msm/sensors/imx175_v4l2.o
CC drivers/media/video/msm/sensors/ov8838_v4l2.o
CC drivers/media/video/msm/sensors/s5k3h2yx_v4l2.o
CC drivers/media/video/msm/rawchip/Yushan_Platform_Specific.o
CC drivers/media/video/msm/wfd/vsg-subdev.o
CC drivers/media/video/msm/msm_gesture.o
CC drivers/media/video/msm/rawchip/Yushan_HTC_Functions.o
CC drivers/media/video/msm/sensors/ar0260_v4l2.o
CC drivers/media/video/msm/wfd/wfd-ioctl.o
CC drivers/media/video/msm/msm_axi_qos.o
CC drivers/media/video/msm/sensors/s5k3l1yx.o
CC drivers/media/video/msm/flash.o
CC drivers/media/video/msm/sensors/ov2722_v4l2.o
CC drivers/media/video/msm/wfd/wfd-util.o
CC drivers/media/video/msm/msm_io_8960.o
LD drivers/media/video/msm/sensors/built-in.o
CC drivers/media/video/msm/msm_vfe32.o
CC drivers/media/video/msm/rawchip/yushan_reg.o
LD drivers/media/video/msm/wfd/built-in.o
CC drivers/media/video/msm/msm_vpe.o
CC drivers/media/video/msm/rawchip/yushan_u_code_r2.o
CC drivers/media/video/msm/rawchip/yushan_u_code_r3.o
CC drivers/media/video/msm/rawchip/yushan_reg_s5k3h2yx.o
CC drivers/media/video/msm/rawchip/yushan_reg_imx175.o
CC drivers/media/video/msm/rawchip/yushan_reg_ov8838.o
CC drivers/media/video/msm/rawchip/yushan_reg_ar0260.o
CC drivers/media/video/msm/rawchip/yushan_reg_ov2722.o
LD drivers/media/video/msm/rawchip/built-in.o
LD drivers/media/video/msm/built-in.o
LD drivers/media/video/videodev.o
LD drivers/media/video/built-in.o
LD drivers/media/built-in.o
make: *** [drivers] Error 2
[email protected] ~/android/kernel/linux $
Talk to DSB9938 or Elkay, they work on kernels for our phone.
orangechoochoo said:
Talk to DSB9938 or Elkay, they work on kernels for our phone.
Click to expand...
Click to collapse
Will do. Thanks for the reply.
Alright, I have discovered my problem. It looks like I was in fact missing the xt_mark.h file. For some reason, the HTC kernel source only includes xt_MARK.h. I downloaded the kernel source for the Nexus 4 and pulled the necessary header files. I was missing a couple others, which I don't recall off hand. What has me baffled is that I seem to be the only one with this issue. I downloaded the HTC source again just to make sure, and just as I suspected it was missing some header files. Has anyone else experienced this?
EDIT: I just tested with a couple different toolchains and they all compile perfectly now. That is so strange that my problem this whole time has been missing header files from HTC.

[Q] Driver error while compiling kernel

So guys, I've tried to build my own kernel from johns github sources based on his kool-aid kernel. This happens with the msm8226_defconfig makefile
So I got my sources synced set up this linaro toolchain https://github.com/Christopher83/arm-cortex_a7-linux-gnueabihf-linaro_4.9, got the path set up in bashrc
Code:
#Android Toolchain PATH
export ARCH=arm
export CCOMPILE=$CROSS_COMPILE
export CROSS_COMPILE=arm-cortex_a7-linux-gnueabihf
export PATH=$PATH:/home/steffen/toolchain/bin"
When running
Code:
make ARCH=arm CROSS_COMPILE=arm-cortex_a7-linux-gnueabihf-
It starts compiling and everything seems fine, when it gets to this last part
Code:
CC [M] drivers/mmc/card/mmc_block_test.o
CC drivers/mmc/core/core.o
CC drivers/mmc/core/bus.o
CC drivers/mmc/core/host.o
CC drivers/mmc/core/mmc.o
drivers/mmc/core/mmc.c:1869:12: warning: initialization from incompatible pointer type
error, forbidden warning: mmc.c:1869
make[3]: *** [drivers/mmc/core/mmc.o] Error 1
make[2]: *** [drivers/mmc/core] Error 2
make[1]: *** [drivers/mmc] Error 2
make: *** [drivers] Error 2
It seems to run into a problem with the drivers, tried searching up on the
Code:
drivers/mmc/core/mmc.c:1869:12: warning: initialization from incompatible pointer type
error
part, and only thing actually coming up has been some pastebins etc with the same error log as I got (almost), hoped someone could help out with this?
Also when I try using the g2m_global_com_defconfig instead, I get this at the end
Code:
AR lib/lib.a
LD vmlinux.o
MODPOST vmlinux.o
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
drivers/built-in.o: In function `video_open':
/home/steffen/kernel_lge_msm8226_g2m/drivers/media/radio/radio-iris.c:5083: undefined reference to `hci_fm_smd_register'
drivers/built-in.o: In function `iris_remove':
/home/steffen/kernel_lge_msm8226_g2m/drivers/media/radio/radio-iris.c:5219: undefined reference to `hci_fm_smd_deregister'
make: *** [.tmp_vmlinux1] Error 1
[email protected]:~/kernel_lge_msm8226_g2m$
Help anyone?
Sorry for this post, got it fixed myself anyways
Sent from my LG-D620 using xda Forum
steffenbakke said:
Sorry for this post, got it fixed myself anyways
Sent from my LG-D620 using xda Forum
Click to expand...
Click to collapse
How you fix it????

[Q] Developers: Trouble Compiling CM11 Kernel

So I've done some work on boot images before, but not much, and I wanted to try building a kernel for AOSP KitKat on the EVO 4G LTE. (Why not Lollipop? Data and roaming issues.) But I'm hitting camera-related errors when I try to compile it. Here's the relevant output in the make process:
Code:
CC arch/arm/mach-msm/board-8064-gpiomux.o
CC arch/arm/mach-msm/board-8064-camera.o
In file included from arch/arm/mach-msm/include/mach/camera.h:26:0,
from arch/arm/mach-msm/board-8064-camera.c:19:
include/media/msm_camera.h:1543:6: warning: "CONFIG_HTC_CAMERA_HAL_VERSION" is not defined [-Wundef]
error, forbidden warning: msm_camera.h:1543
make[1]: *** [arch/arm/mach-msm/board-8064-camera.o] Error 1
make: *** [arch/arm/mach-msm] Error 2
I tried to fix it by adding the HTC_CAMERA_HAL_VERSION config to Kconfig, but then I get this error instead:
Code:
CC arch/arm/mach-msm/board-8064-gpiomux.o
CC arch/arm/mach-msm/board-8064-camera.o
In file included from arch/arm/mach-msm/board-8064-camera.c:19:0:
arch/arm/mach-msm/include/mach/camera.h:682:33: warning: 'struct msm_camera_csi_params' declared inside parameter list
error, forbidden warning: camera.h:682
make[1]: *** [arch/arm/mach-msm/board-8064-camera.o] Error 1
make: *** [arch/arm/mach-msm] Error 2
Any ideas?

[HELP] Errors while compiling Android kernel

Hey guys,
I wanted to enable KVM on the kernel I use, reached to the kernel source and enabled KVM by adding some lines to defconfig file. But whenever I want to compile, I got these error messages. I could not fix that. Could someone help me please?
Code:
C arch/arm64/kvm/../../../virt/kvm/vfio.o
CC arch/arm64/kvm/../../../arch/arm/kvm/arm.o
CC arch/arm64/kvm/../../../arch/arm/kvm/mmu.o
AS arch/arm64/crypto/poly-hash-ce-core.o
CC arch/arm64/crypto/aes-ce-cipher.o
CC arch/arm64/mm/flush.o
In file included from ../arch/arm64/kvm/../../../arch/arm/kvm/arm.c:42:
../arch/arm64/include/asm/kvm_mmu.h:309:70: error: too few arguments to function call, expected 3, have 2
return (cpuid_feature_extract_field(reg, ID_AA64MMFR1_VMIDBITS_SHIFT) == 2) ? 16 : 8;
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
make[2]: *** [../scripts/Makefile.build:285: arch/arm64/kvm/../../../arch/arm/kvm/arm.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CC arch/arm64/crypto/aes-ce-ccm-glue.o
In file included from ../arch/arm64/kvm/../../../arch/arm/kvm/mmu.c:27:
../arch/arm64/include/asm/kvm_mmu.h:309:70: error: too few arguments to function call, expected 3, have 2
return (cpuid_feature_extract_field(reg, ID_AA64MMFR1_VMIDBITS_SHIFT) == 2) ? 16 : 8;
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
make[2]: *** [../scripts/Makefile.build:285: arch/arm64/kvm/../../../arch/arm/kvm/mmu.o] Error 1
AS arch/arm64/crypto/aes-ce-ccm-core.o
CC arch/arm64/crypto/aes-glue-ce.o
make[1]: *** [/home/gorkemoji/android/kernel/Makefile:1034: arch/arm64/kvm] Error 2
make[1]: *** Waiting for unfinished jobs....
Thanks!
Best regards
Device: Redmi Note 7
Kernel source: https://github.com/LineageOS/android_kernel_xiaomi_sdm660
Up.
Anyone?

Categories

Resources