[SOLVED] Several .o files not found during build process while compiling a kernel for my SAMSUNG GALAXY J7 (SM-J700F)
Linux - MobileThis forum is for the discussion of all topics relating to Mobile Linux. This includes Android, Tizen, Sailfish OS, Replicant, Ubuntu Touch, webOS, and other similar projects and products.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
and has put the toolchains where the Makefile searches for it.
Now at kernel source root directory I did the following:
Code:
make ARCH=arm64 j7elte_00_defconfig
OUTPUT:
Code:
[wrocket@wrocket-pc kernel]$ make ARCH=arm64 j7elte_00_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
In file included from scripts/kconfig/zconf.tab.c:2503:
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c:567:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
567 | jump->offset = r->len - 1;
| ~~~~~~~~~~~~~^~~~~~~~~~~~
scripts/kconfig/menu.c:528:19: note: ‘jump’ was declared here
528 | struct jump_key *jump;
| ^~~~
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
After that I did the following:
Code:
make ARCH=arm64 -j64 -no-integreted-as
OUTPUT:
Code:
...
set -e; echo ' LINK vmlinux'; /bin/sh scripts/link-vmlinux.sh ../PLATFORM/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-ld -EL -p --no-undefined -X --build-id; echo 'cmd_vmlinux := /bin/sh scripts/link-vmlinux.sh ../PLATFORM/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-ld -EL -p --no-undefined -X --build-id' > ./.vmlinux.cmd
LINK vmlinux
LD vmlinux.o
aarch64-linux-android-ld: error: cannot open arch/arm64/kernel/head.o: No such file or directory
aarch64-linux-android-ld: error: cannot open init/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open usr/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/kernel/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/mm/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/crypto/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/mach-exynos/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/plat-samsung/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open kernel/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open mm/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open fs/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open ipc/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open security/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open crypto/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open block/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/lib/lib.a: No such file or directory
aarch64-linux-android-ld: error: cannot open lib/lib.a: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/lib/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open lib/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open drivers/built-in.o: No such file or directory
aarch64-linux-android-ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
make: *** [Makefile:805: vmlinux] Error 1
I can see some of the source file like head.S but head.o is not there. I assume missing .o file should be build before it is required. I tried to figure out whats wrong but had no luck.
Please shed some light. I am new to kernel building.
Last edited by wrufesh; 03-04-2021 at 01:37 PM.
Reason: Debug log added. Source information added.
and has put the toolchains where the Makefile searches for it.
Now at kernel source root directory I did the following:
Code:
make ARCH=arm64 j7elte_00_defconfig
OUTPUT:
Code:
[wrocket@wrocket-pc kernel]$ make ARCH=arm64 j7elte_00_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
In file included from scripts/kconfig/zconf.tab.c:2503:
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c:567:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
567 | jump->offset = r->len - 1;
| ~~~~~~~~~~~~~^~~~~~~~~~~~
scripts/kconfig/menu.c:528:19: note: ‘jump’ was declared here
528 | struct jump_key *jump;
| ^~~~
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
After that I did the following:
Code:
make ARCH=arm64 -j64 -no-integreted-as
OUTPUT:
Code:
...
set -e; echo ' LINK vmlinux'; /bin/sh scripts/link-vmlinux.sh ../PLATFORM/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-ld -EL -p --no-undefined -X --build-id; echo 'cmd_vmlinux := /bin/sh scripts/link-vmlinux.sh ../PLATFORM/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-ld -EL -p --no-undefined -X --build-id' > ./.vmlinux.cmd
LINK vmlinux
LD vmlinux.o
aarch64-linux-android-ld: error: cannot open arch/arm64/kernel/head.o: No such file or directory
aarch64-linux-android-ld: error: cannot open init/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open usr/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/kernel/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/mm/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/crypto/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/mach-exynos/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/plat-samsung/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open kernel/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open mm/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open fs/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open ipc/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open security/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open crypto/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open block/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/lib/lib.a: No such file or directory
aarch64-linux-android-ld: error: cannot open lib/lib.a: No such file or directory
aarch64-linux-android-ld: error: cannot open arch/arm64/lib/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open lib/built-in.o: No such file or directory
aarch64-linux-android-ld: error: cannot open drivers/built-in.o: No such file or directory
aarch64-linux-android-ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
make: *** [Makefile:805: vmlinux] Error 1
I can see some of the source file like head.S but head.o is not there. I assume missing .o file should be build before it is required. I tried to figure out whats wrong but had no luck.
Please shed some light. I am new to kernel building.
While I've only ever built the Linux kernel for the x86 platform, and not the ARM platform; it seems strange to me that it would try and link the kernel before compiling the object code - as that what it looks like to me. The process as far as I know should be, compile the object code, and THEN link the object code into an executable(s) or library(s), not the other way around.
And I don't get what the "-no-integreted-as" argument below does either - I've never seen that argument before and Google seems to fail me in trying to figure out what that argument does. Do you know what that is there for?
Code:
make ARCH=arm64 -j64 -no-integreted-as
Also, looking at the link you provided above, I cannot find any guide that I assume you followed.
Could you provide a link directly to whatever guide/howto you followed?
You might also what to keep on eye on your other thread over at the XDA-developers forum, and let us know if they manage to help you solve the problem.
While I've only ever built the Linux kernel for the x86 platform, and not the ARM platform; it seems strange to me that it would try and link the kernel before compiling the object code - as that what it looks like to me. The process as far as I know should be, compile the object code, and THEN link the object code into an executable(s) or library(s), not the other way around.
And I don't get what the "-no-integreted-as" argument below does either - I've never seen that argument before and Google seems to fail me in trying to figure out what that argument does. Do you know what that is there for?
Code:
make ARCH=arm64 -j64 -no-integreted-as
Also, looking at the link you provided above, I cannot find any guide that I assume you followed.
Could you provide a link directly to whatever guide/howto you followed?
You might also what to keep on eye on your other thread over at the XDA-developers forum, and let us know if they manage to help you solve the problem.
While I've only ever built the Linux kernel for the x86 platform, and not the ARM platform; it seems strange to me that it would try and link the kernel before compiling the object code - as that what it looks like to me. The process as far as I know should be, compile the object code, and THEN link the object code into an executable(s) or library(s), not the other way around.
And I don't get what the "-no-integreted-as" argument below does either - I've never seen that argument before and Google seems to fail me in trying to figure out what that argument does. Do you know what that is there for?
Code:
make ARCH=arm64 -j64 -no-integreted-as
Also, looking at the link you provided above, I cannot find any guide that I assume you followed.
Could you provide a link directly to whatever guide/howto you followed?
You might also what to keep on eye on your other thread over at the XDA-developers forum, and let us know if they manage to help you solve the problem.
I am following the instruction from README available at source.
for me it looks like misconfiguration, probably you missed a step somewhere. Or the make config step failed.
Yes I had a warning during config step. It was like this.
Code:
[wrocket@wrocket-pc kernel]$ make ARCH=arm64 j7elte_00_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
In file included from scripts/kconfig/zconf.tab.c:2503:
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c:567:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
567 | jump->offset = r->len - 1;
| ~~~~~~~~~~~~~^~~~~~~~~~~~
scripts/kconfig/menu.c:528:19: note: ‘jump’ was declared here
528 | struct jump_key *jump;
| ^~~~
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by wrufesh
Is there any way I could verify that? The source of code seems trust-able and ready to build.
If I'm right in thinking that for whatever reason it's trying to link non-existent object code, then that's why it's failing to build. So you would need to find out why the object code isn't being compiled in order to know what the solution is.
FWIW, I'm thinking along the same lines as pan64 in post #6, or you're missing something in the README, or similar.
Could you attach the README file you're following to your next post, so we can see exactly what instructions you're following? As perhaps, we can provide better help and find out what you might be missing.
If I'm right in thinking that for whatever reason it's trying to link non-existent object code, then that's why it's failing to build. So you would need to find out why the object code isn't being compiled in order to know what the solution is.
FWIW, I'm thinking along the same lines as pan64 in post #6, or you're missing something in the README, or similar.
Could you attach the README file you're following to your next post, so we can see exactly what instructions you're following? As perhaps, we can provide better help and find out what you might be missing.
This is it
Quote:
################################################################################
HOW TO BUILD KERNEL FOR SM-J700F_SWA_MM_INS
1. How to Build
- get Toolchain
download and install aarch64-linux-android-4.9 toolchain for ARM EABI.
Extract kernel source and move into the top directory.
$ make ARCH=arm64 j7elte_00_defconfig
$ make ARCH=arm64 -j64
4. How to make .tar binary for downloading into target.
- change current directory to Kernel/arch/arm64/boot
- type following command
$ tar cvf SM-J700F_SWA_MM_INS.tar zImage
#################################################################################
If I'm right in thinking that for whatever reason it's trying to link non-existent object code, then that's why it's failing to build. So you would need to find out why the object code isn't being compiled in order to know what the solution is.
FWIW, I'm thinking along the same lines as pan64 in post #6, or you're missing something in the README, or similar.
Could you attach the README file you're following to your next post, so we can see exactly what instructions you're following? As perhaps, we can provide better help and find out what you might be missing.
I just build the kernel successfully with Ubuntu 18.04.
While on Arch linux, with
Code:
make ARCH=arm64 -j64
I was getting the following
Code:
<inline asm>:2:1: note: instantiated into assembly here
->OFF_hid_device_id_product 8 offsetof(struct hid_device_id, product)
^
scripts/mod/devicetable-offsets.c:30:2: error: unexpected token at start of statement
DEVID(ieee1394_device_id);
^
scripts/mod/devicetable-offsets.c:4:22: note: expanded from macro 'DEVID'
#define DEVID(devid) DEFINE(SIZE_##devid, sizeof(struct devid))
^
include/linux/kbuild.h:5:25: note: expanded from macro 'DEFINE'
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
^
<inline asm>:2:1: note: instantiated into assembly here
->SIZE_ieee1394_device_id 32 sizeof(struct ieee1394_device_id)
^
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
I'm glad you managed to get it working, nice work wrufesh!
Yes, I was suspecting the "-no-integrated-as" was most likely causing the problem, and the README you posted doesn't list that as an argument either. In any case, it seems it's a problem with the toolchain used in Arch Linux, and more precisely, based on the link you posted above, a LLVM/Clang issue, but the same issue isn't present in Ubuntu 18.04's toolchain. From what I understand from the link you posted above, the "-no-integrated-as" tells Clang not to use it's integrated assembler, so still not entirely sure why it wasn't compiling the object code. Perhaps, there wasn't an external assembler available, or it wasn't being called for some reason? Not really sure what was going on there.
I did have problems trying to get the kernel to build using LLVM/Clang on the x86 platform, but it was a different issue in that case. In that case, it was actually the LLVM linker failing to link the object code, but Clang had no issue compiling the object code.
In any case, if you would like to know more about the assembly errors you were getting, you could start another thread about it in the Programming forum and perhaps the guys there could shed some light on it for you. As I'm afraid my assembly knowledge is pretty well non-existent, so I really can't help you there sorry to say. You should also post the assembly output you posted above and a link to this thread for context if you decide to start another thread in the Programming forum here. You should also post the solution and a link to this thread here in your thread over at the XDA-developers forum in any case.
first, make sure you are using the same development environment. your beuilding Tizen OS if i'm not mistaken. they might use ubuntu they might use fedorda you have to use the same.
second: that's a very typical build error. the usual suspect is KERNEL DEPENDENCIES. you were hacking changes into the kernel options, selected one unselected the other and wham, you ooops'ed one of the dependencies that had been automatically selected then clobbered by your further selections. (either you got a .config with a minor error or you f'ed it up slighly). So you check your dependencies list in menu.config (see the kernel directory files), check dependencies, make sure everything in that list is also Y or M in your .config, rebuild, it will work. Next time don't oops your dependencies. Don't select a bunch of stuff, unselect sporadically, then expect it to work (i'm assuming your using the old make menuconfig when i say that). The tool isn't sophisticated enough to track dependencies: it works correctly when you do this:
1) uncheck anything you shouldn't build
2) check anything that will build
3) don't make any keyboard mistakes
4) hand edit the .config if that isn't sufficient
third: if it's in a proprietary section it might be intentional. Tizen might not be "100% open" (you might need the pre-built .o "blob" from Tizen OS). probably not the case here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.