I’m trying to compile it inside a fresh Ubuntu Impish VM and I get 5 errors:
../drivers/staging/wlan-qc/qcacld-3.0/core/hdd/src/wlan_hdd_assoc.c:2135:28: error: variable 'psoc' set but not used [-Werror,-Wunused-but-set-variable]
struct wlan_objmgr_psoc **psoc;
^
../techpack/audio/asoc/codecs/bolero/wsa-macro.c:2148:5: error: variable 'bst_state_max' set but not used [-Werror,-Wunused-but-set-variable]
u8 bst_state_max;
^
../techpack/audio/asoc/codecs/bolero/wsa-macro.c:2180:5: error: variable 'bst_state_max' set but not used [-Werror,-Wunused-but-set-variable]
u8 bst_state_max;
^
../techpack/audio/asoc/msm-dai-q6-v2.c:7221:17: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
int rc, id, i, len;
^
../techpack/audio/dsp/codecs/q6audio_v2_aio.c:175:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
int ret;
^
The VM has been set up from scratch via vagrant with ubuntu/impish64 and provisioned with sudo apt install -y make bison flex clang lld llvm repo libssl-dev gcc-aarch64-linux-gnu.
Any ideas why these errors happen and the build fails?
@lucaweiss
I’m probably doing something really stupid and waste your valuable time - I have no real clue what could be causing this - my thought is maybe you see it at a glance?
If not don’t even bother!
One should be doing it like @phedoreanu with a small clean ubuntu vm anyhow I guess.
(tried it with Manjaro / Arch)
(I will be using some more time to learn about the backgrounds)
[bliss@bliss-tower-linux msm-4.19]$ make CC=clang LLVM=1 -j$(nproc)
make[1]: Entering directory '/home/bliss/Desktop/fp4-kernel/kernel/msm-4.19/build'
which: no aarch64-linux-gnu-elfedit in (/usr/lib/jvm/java-16-openjdk/bin:/home/bliss/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin)
arch/arm64/Makefile:27: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
arch/arm64/Makefile:48: Detected assembler with broken .inst; disassembly will be unreliable
which: no ld.lld in (/usr/lib/jvm/java-16-openjdk/bin:/home/bliss/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin)
UPD include/config/kernel.release
GEN ./Makefile
WRAP arch/arm64/include/generated/uapi/asm/errno.h
WRAP arch/arm64/include/generated/uapi/asm/ioctl.h
WRAP arch/arm64/include/generated/uapi/asm/kvm_para.h
WRAP arch/arm64/include/generated/uapi/asm/ioctls.h
WRAP arch/arm64/include/generated/uapi/asm/mman.h
WRAP arch/arm64/include/generated/uapi/asm/ipcbuf.h
WRAP arch/arm64/include/generated/uapi/asm/msgbuf.h
WRAP arch/arm64/include/generated/uapi/asm/poll.h
WRAP arch/arm64/include/generated/uapi/asm/resource.h
WRAP arch/arm64/include/generated/uapi/asm/sembuf.h
WRAP arch/arm64/include/generated/uapi/asm/socket.h
WRAP arch/arm64/include/generated/uapi/asm/shmbuf.h
WRAP arch/arm64/include/generated/uapi/asm/termbits.h
WRAP arch/arm64/include/generated/uapi/asm/termios.h
WRAP arch/arm64/include/generated/uapi/asm/sockios.h
WRAP arch/arm64/include/generated/uapi/asm/swab.h
WRAP arch/arm64/include/generated/uapi/asm/types.h
UPD include/generated/uapi/linux/version.h
UPD include/generated/utsrelease.h
Using .. as source for kernel
WRAP arch/arm64/include/generated/asm/bugs.h
WRAP arch/arm64/include/generated/asm/delay.h
WRAP arch/arm64/include/generated/asm/div64.h
WRAP arch/arm64/include/generated/asm/dma.h
WRAP arch/arm64/include/generated/asm/dma-contiguous.h
WRAP arch/arm64/include/generated/asm/early_ioremap.h
WRAP arch/arm64/include/generated/asm/hw_irq.h
WRAP arch/arm64/include/generated/asm/emergency-restart.h
WRAP arch/arm64/include/generated/asm/kdebug.h
WRAP arch/arm64/include/generated/asm/irq_regs.h
WRAP arch/arm64/include/generated/asm/kmap_types.h
WRAP arch/arm64/include/generated/asm/local.h
WRAP arch/arm64/include/generated/asm/local64.h
WRAP arch/arm64/include/generated/asm/mcs_spinlock.h
WRAP arch/arm64/include/generated/asm/mm-arch-hooks.h
WRAP arch/arm64/include/generated/asm/preempt.h
WRAP arch/arm64/include/generated/asm/msi.h
WRAP arch/arm64/include/generated/asm/qrwlock.h
WRAP arch/arm64/include/generated/asm/rwsem.h
WRAP arch/arm64/include/generated/asm/qspinlock.h
WRAP arch/arm64/include/generated/asm/segment.h
WRAP arch/arm64/include/generated/asm/serial.h
WRAP arch/arm64/include/generated/asm/set_memory.h
WRAP arch/arm64/include/generated/asm/sizes.h
WRAP arch/arm64/include/generated/asm/switch_to.h
WRAP arch/arm64/include/generated/asm/trace_clock.h
WRAP arch/arm64/include/generated/asm/user.h
WRAP arch/arm64/include/generated/asm/unaligned.h
WRAP arch/arm64/include/generated/asm/vga.h
WRAP arch/arm64/include/generated/asm/xor.h
HOSTCC scripts/bin2c
HOSTCC scripts/kallsyms
HOSTCC scripts/sortextable
HOSTCC scripts/asn1_compiler
HOSTCC scripts/pnmtologo
HOSTCC scripts/sign-file
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/dtc/dtc.o
YACC scripts/genksyms/parse.tab.c
YACC scripts/genksyms/parse.tab.h
HOSTCC scripts/extract-cert
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/genksyms/genksyms.o
LEX scripts/genksyms/lex.lex.c
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/selinux/genheaders/genheaders
CC scripts/mod/empty.o
HOSTCC scripts/selinux/mdp/mdp
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/mod/mk_elfconfig
HOSTCC scripts/dtc/util.o
/usr/bin/as: unrecognized option '-EL'
clang-12: error: assembler command failed with exit code 1 (use -v to see invocation)
make[3]: *** [../scripts/Makefile.build:339: scripts/mod/empty.o] Error 1
make[3]: *** Waiting for unfinished jobs....
LEX scripts/dtc/dtc-lexer.lex.c
CC kernel/bounds.s
YACC scripts/dtc/dtc-parser.tab.h
YACC scripts/dtc/dtc-parser.tab.c
UPD include/generated/timeconst.h
make[2]: *** [../scripts/Makefile.build:642: scripts/mod] Error 2
make[2]: *** Waiting for unfinished jobs....
HOSTCC scripts/genksyms/lex.lex.o
HOSTCC scripts/genksyms/parse.tab.o
HOSTCC scripts/dtc/dtc-lexer.lex.o
UPD include/generated/bounds.h
CC arch/arm64/kernel/asm-offsets.s
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/dtc/dtc
HOSTLD scripts/genksyms/genksyms
make[1]: *** [/home/bliss/Desktop/fp4-kernel/kernel/msm-4.19/Makefile:1225: scripts] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from ../arch/arm64/kernel/asm-offsets.c:25:
In file included from ../include/linux/kvm_host.h:39:
In file included from ../arch/arm64/include/asm/kvm_host.h:42:
In file included from ../include/kvm/arm_pmu.h:21:
In file included from ../include/linux/perf_event.h:57:
In file included from ../include/linux/cgroup.h:28:
../include/linux/cgroup-defs.h:507:16: warning: field 'cgrp' with variable sized type 'struct cgroup' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct cgroup cgrp;
^
1 warning generated.
UPD include/generated/asm-offsets.h
CALL ../scripts/checksyscalls.sh
make[1]: Leaving directory '/home/bliss/Desktop/fp4-kernel/kernel/msm-4.19/build'
make: *** [Makefile:151: sub-make] Error 2
[bliss@bliss-tower-linux msm-4.19]$
Hello,
So I tried building as well and I got through a lot of error messages already solved. BUt now I get this message during the build (shows up after ~20min):
make[3]: *** No rule to make target 'net/netfilter/xt_DSCP.o', needed by 'net/netfilter/built-in.a'. Stop.
make[2]: *** [../scripts/Makefile.build:642: net/netfilter] Error 2
Can you share the clang version you’ve used (clang --version)? Also you shouldn’t need to modify the sources at all for them to build.
The only special thing I can see about xt_DSCP is that there’s both a xt_DSCP.c and a xt_dscp.c file in the source tree. Are you building on a case insensitive file system like NTFS maybe?
Hi, I’ve had a successful build under Ubuntu Impish and Clang 13, thanks for your hard work!
I have a question regarding the DT.
I am new to tinkering around on android. My understanding is that the DT is a description of hardward nodes in the device.
The DTS is the source code of the DT, and compiling the DTS generates the DT.
Please note, that currently the sources do not contain the devicetree sources (.dts, .dtsi). You will need to extract the dtb (device tree blob) from the stock image’s boot.img and use that with your self-compiled kernel (e.g. with unpackbootimg from github.com/osm0sis/mkbootimg).
However, next to the Image file I get, I also have a dts folder containing a bunch of hardware-manufacturers-named sub folders (“nvidia”, “broadcom” etc…). They all contain a “modules.order” file, except for the “qcom” folder which also has a bunch of .dtb files
I dont really know what all that is ; dtb makes me think these are the compiled source, but again i dont really know what i’m looking at.
Is the documentation outdated and this is the DTS ? Or do I not understand what the DTS is and what it’s supposed to look like ?
Yes, those are included in the sources but just because they come from upstream like that. The files relevant for FP4 would be lagoon.dtsi and friends, but as is mentioned in the docs those are currently not included.
Otherwise yes, normally .dts (plus included .dtsi files) gets compiled into .dtb which is used to describe the hardware and tell the kernel which hardware is available and all the details there.
Building non-Windows on case insensitive file systems is always a bad idea.
Your compiled kernel build/arch/arm64/boot/Image isn’t the boot.img mentioned in the docs, that would be the binary that’s on your device’s boot partition (technically boot_a or boot_b because it’s an A/B device) or distributed in the stock image where the file is normally called boot.img (also note, that the stock image is not yet available for download).
Ok, but then what is it that I build? I thought that I would be building something that I can flash onto my device and that it would consist of the mentioned boot.img.
So I can extract it when I pull the boot.img from my device?
Whoops, I forgot about that. Yes that’s the file you need to unpack.
The file at build/arch/arm64/boot/Image is the Linux kernel which is one of the things contained in a boot.img, there’s also ramdisk, dtb and some offsets contained there.