Custom Kernel Compiling Error Message

588 views
Skip to first unread message

BrokenE39

unread,
Jun 19, 2018, 10:28:35 PM6/19/18
to Android-x86
I'm following Paul Lutus' guide and the assoicated group thread to try to build a custom kernel for my Teclast X98 Plus (A5C6). When I try to compile it, I got the following error:

[ 99% 1170/1171] glob test/vts/utils/native/libprofiling/Android.bp
ninja: error: 'kernel/arch/x86/configs/myconfig/config1', needed by '/home/daniel/android-x86/out/target/product/x86/obj/kernel/.config', missing and no known rule to make it
16:58:51 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1

Not really sure what to make if it since it's my first time building anything android related. Attached is my config file and error log. If there is a new way of building custom kernel or custom x86 fork, I'm all ears. Thanks!
log
config

Mauro Rossi

unread,
Jun 20, 2018, 1:53:58 AM6/20/18
to Android-x86
Hi,
since compiling has not even started, please check if the file config1 is present or its location.
Mauro

grep: kernel/arch/x86/configs/myconfig/config1: No such file or directory

BrokenE39

unread,
Jun 20, 2018, 11:29:54 PM6/20/18
to Android-x86
Mauro, thanks for pointing it out. I thought there was some kind of missing file initially but thought it wasn't because I picked the folder to save the .config file in xconfig. Turns out to be a permission type of issue and the file wasn't saved by xconfig. However, now I'm getting the following error:

[  9% 19/199] //external/compiler-rt:libcompiler_rt-extras clang lib/builtins/comparedf2.c [linux]
ninja: build stopped: subcommand failed.
20:16:51 ninja failed with: exit status 1

build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1

Output file attached.
buildlog

Mauro Rossi

unread,
Jun 21, 2018, 2:10:48 AM6/21/18
to Android-x86
Hi,
I suggest to proceed in this way:

0. Recheck: install all the required packages for Android Build System to work

1. Start from a working android-x86_64_defconfig for 64bit iso or android-x86_defconfig file, if you are building x86 32bit iso

2. Apply the config changes you need

3. Save your defconfig_file it to /home/daniel/android-x86/kernel/arch/x86/configs/defconfig_file and avoid using subfolders, 
TARGET_KERNEL_CONFIG definitionwill search the file in there

4. If you encounter errors about locale in Ubuntu 18.04 bionic beaver, use this command prior to building:

export LC_ALL=C

5. commands to build with ad hoc defconfig_file should look like this:

cd /home/daniel/android-x86
. build/envsetup.sh
lunch android_x86-userdebug && make -j4 iso_img TARGET_KERNEL_CONFIG=defconfig_file

The problem in your buildlog file is clear:

FAILED: /home/daniel/android-x86/out/target/product/x86/obj/kernel/.config 
/bin/bash -c "(mkdir -p /home/daniel/android-x86/out/target/product/x86/obj/kernel && cat kernel/arch/x86/configs/myconfig device/generic/common/selinux_diffconfig > /home/daniel/android-x86/out/target/product/x86/obj/kernel/.config ) && (ln -sf ../../../../../../external /home/daniel/android-x86/out/target/product/x86/obj/kernel ) && (make -j3 -C kernel O=/home/daniel/android-x86/out/target/product/x86/obj/kernel ARCH=x86 CROSS_COMPILE=\" /home/daniel/android-x86/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/bin/x86_64-linux-android-\"  oldnoconfig )"
cat: kernel/arch/x86/configs/myconfig: Is a directory

.config file could not be generated because of the highlighted error,
if TARGET_KERNEL_CONFIG=myconfig was used, then myconfig must be a file.

Mauro

BrokenE39

unread,
Jun 23, 2018, 11:14:17 PM6/23/18
to Android-x86
Hi Mauro,

Thank you very much for the continuing assistance but I'm running into other issues still after following your instructions as close as possible.

1. Save the .config file in /home/daniel/android-x86/configs/

2. lunch commend was changed to use android_x86_64-userdebug instead since I'm using 64 bit

3. Run "make mrproper" in the kernel folder after I ran into an error message

4. Run the following commands to start the build process

. build/envsetup.sh
export LC_ALL=C
sudo make clean
lunch android_x86_64-userdebug && make -j6 iso_img TARGET_PRODUCT=android_x86 TARGET_KERNEL_CONFIG=.config

5. Ran into the following error messages:

FAILED: /home/daniel/android-x86/out/target/product/x86/obj/kernel/arch/x86/boot/bzImage
/bin/bash -c "make -j3 -C kernel O=/home/daniel/android-x86/out/target/product/x86/obj/kernel ARCH=x86 CROSS_COMPILE=\" /home/daniel/android-x86/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/bin/x86_64-linux-android-\"  bzImage modules"

CC      arch/x86/kernel/SSEPlus_float_REF.o
/home/daniel/android-x86/kernel/arch/x86/kernel/SSEPlus_float_REF.c:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12
 #include <linux/kernel.h>
 ^
/home/daniel/android-x86/kernel/scripts/Makefile.build:331: recipe for target 'arch/x86/kernel/SSEPlus_float_REF.o' failed
make[3]: *** [arch/x86/kernel/SSEPlus_float_REF.o] Error 1
/home/daniel/android-x86/kernel/scripts/Makefile.build:645: recipe for target 'arch/x86/kernel' failed
make[2]: *** [arch/x86/kernel] Error 2
/home/daniel/android-x86/kernel/Makefile:1082: recipe for target 'arch/x86' failed

I also got some warning messages from GCC but I won't paste them here to avoid jamming up the post. Output log attached.

Thanks!
buildlog

Mauro Rossi

unread,
Jun 24, 2018, 8:30:59 AM6/24/18
to Android-x86
Hi,


Il giorno domenica 24 giugno 2018 05:14:17 UTC+2, BrokenE39 ha scritto:
Hi Mauro,

Thank you very much for the continuing assistance but I'm running into other issues still after following your instructions as close as possible.

1. Save the .config file in /home/daniel/android-x86/configs/

Please check, the defconfig file has to be in 
/home/daniel/android-x86/kernel/arch/x86/configs/

Please call the file it like my_defconfig, even if you call it .config it may work, but in order to avoid confusion
 

2. lunch commend was changed to use android_x86_64-userdebug instead since I'm using 64 bit

3. Run "make mrproper" in the kernel folder after I ran into an error message

4. Run the following commands to start the build process

. build/envsetup.sh
export LC_ALL=C
sudo make clean
lunch android_x86_64-userdebug && make -j6 iso_img TARGET_PRODUCT=android_x86 TARGET_KERNEL_CONFIG=.config

'TARGET_PRODUCT=android_x86' should not be necessary if you want to build 64 bit user image on 64 kernel


5. Ran into the following error messages:

FAILED: /home/daniel/android-x86/out/target/product/x86/obj/kernel/arch/x86/boot/bzImage
/bin/bash -c "make -j3 -C kernel O=/home/daniel/android-x86/out/target/product/x86/obj/kernel ARCH=x86 CROSS_COMPILE=\" /home/daniel/android-x86/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/bin/x86_64-linux-android-\"  bzImage modules"

CC      arch/x86/kernel/SSEPlus_float_REF.o
/home/daniel/android-x86/kernel/arch/x86/kernel/SSEPlus_float_REF.c:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12
 #include <linux/kernel.h>
 ^
/home/daniel/android-x86/kernel/scripts/Makefile.build:331: recipe for target 'arch/x86/kernel/SSEPlus_float_REF.o' failed
make[3]: *** [arch/x86/kernel/SSEPlus_float_REF.o] Error 1
/home/daniel/android-x86/kernel/scripts/Makefile.build:645: recipe for target 'arch/x86/kernel' failed
make[2]: *** [arch/x86/kernel] Error 2
/home/daniel/android-x86/kernel/Makefile:1082: recipe for target 'arch/x86' failed

I also got some warning messages from GCC but I won't paste them here to avoid jamming up the post. Output log attached.

Thanks!

I recommned you start from branches that build without doubts, e.g. android-x86 kernel-4.14 branch
and perform the minimal changes necessary for your customization to kernel and defconfig file

It is very difficult to troubleshoot without knowing what you have in the kernel project source and what you changed.

Mauro
Message has been deleted

BrokenE39

unread,
Jun 24, 2018, 9:05:09 PM6/24/18
to Android-x86
I couldn't get make to look for the "my_defconfig" file. When I issue the make kernel command, it looks for the folder instead. For example:

make -C kernel O=/home/daniel/android-x86/kernel/arch/x86/configs/my_defconfig xconfig

Creates a new folder named "my_defconfig" and when I save it in xconfig, it would save it as a .config

make -C kernel O=/home/daniel/android-x86/kernel/arch/x86/configs/my_defconfig.config xconfig

This would throw a "failed to create output directory" since it is looking for "my_defconfig.config" directory.

"my_defconfig.config" is a copy of the existing x86_64 defconfig file. The only modifications I made to the source folder is adding 2 bash scripts to run the make commands and the build output log file.

Mauro Rossi

unread,
Jun 25, 2018, 3:41:30 AM6/25/18
to Android-x86
Hi, 
If you change some configuration with xconfig and it is save as a .config,
you just need to copy+rename it  to /home/daniel/android-x86/kernel/arch/x86/configs/

and then use TARGET_KERNEL_CONFIG=newfile

or leave the .config created by xconfig where it is and use

TARGET_KERNEL_CONFIG=my_defconfig/.config

but the former is less error prone.

As a recommendation use the Android provided procedure to build instead of your scripts,
the main reason is that some configs are changed at build

If the problem is that you don't want to rebuild all iso image, you can build just the kernel:

. build/envsetup.sh
export LC_ALL=C
lunch android_x86_64-userdebug && make -j6 kernel TARGET_KERNEL_CONFIG=newfile

Mauro
Reply all
Reply to author
Forward
0 new messages