mvaisakh / gcc-build

Bleeding Edge Bare Metal GCC build script.
GNU General Public License v3.0
58 stars 36 forks source link

ld.lld: error: undefined symbol: __popcountdi2 #31

Open TogoFire opened 2 weeks ago

TogoFire commented 2 weeks ago

Log: ld.lld: error: undefined symbol: __popcountdi2

referenced by msm_vidc_common.c video/msm/vidc/msm_vidc_common.o:(msm_comm_set_color_format_constraints) in archive techpack/built-in.a referenced by dp_link.c display/msm/dp/dp_link.o:(dp_link_process_request) in archive techpack/built-in.a make[1]: [/home/togo77/kernel_oneplus_sm8350/Makefile:1299: vmlinux] Error 1 make: [Makefile:192: sub-make] Error 2

Full log: https://bin.cyberknight777.dev/eVQ6/raw

kt: https://github.com/dev-sm8350/kernel_oneplus_sm8350 gcc used: 29082024 gcc of the day: 22082024. It was ok

mvaisakh commented 2 weeks ago

This doesn't look like gcc/LLD issue. Try compiling the same kernel source with an older version of gcc. Does the same source build fine with the mentioned older gcc? Or was it building fine on that particular day?

TogoFire commented 2 weeks ago

This doesn't look like gcc/LLD issue. Try compiling the same kernel source with an older version of gcc. Does the same source build fine with the mentioned older gcc? Or was it building fine on that particular day?

Old gcc compiles normally. Only this newer gcc one doesn't compile.

mvaisakh commented 2 weeks ago

I'll trigger a build now, check with that. Build will take approximately 6hours.

TogoFire commented 2 weeks ago

I'll trigger a build now, check with that. Build will take approximately 6hours.

Unfortunately the error persists.

IMG_20240830_063746_209

gcc version: 30082024

mvaisakh commented 2 weeks ago

It seems like lld specific issue. Try switching from LLD to LD and see if that works.

TogoFire commented 2 weeks ago

Screenshot_1 I don't think so. I'm using Fedora. With all dependencies installed. sudo dnf install llvm gcc android-tools autoconf213 bison bzip2 ccache clang curl xmlstarlet bsdtar flex gawk gcc-c++ git git-lfs glibc-devel glibc-static libstdc++-static libX11-devel make mesa-libGL-devel ncurses-devel openssl patch zlib-devel ncurses-devel.i686 readline-devel.i686 libX11-devel.i686 mesa-libGL-devel.i686 glibc-devel.i686 libstdc++.i686 libXrandr.i686 zip perl-Digest-SHA python2 python3 wget lzop openssl-devel java-1.8.0-openjdk-devel ImageMagick ncurses schedtool lzip vboot-utils vim sha megatools aria2 libxcrypt-compat zram sudo dnf groupinstall "Development Tools" "Development Libraries"

GCC version: 22082024 - (Build this version without any problems). wget https://github.com/mvaisakh/gcc-build/releases/download/22082024/eva-gcc-arm-22082024.xz -O eva-gcc-arm.xz wget https://github.com/mvaisakh/gcc-build/releases/download/22082024/eva-gcc-arm64-22082024.xz -O eva-gcc-arm64.xz tar xvf eva-gcc-arm.xz tar xvf eva-gcc-arm64.xz image

GCC version 30082024 (RIP): image

mvaisakh commented 2 weeks ago

No it has nothing to do with your system. You're using lld instead of gnu ld. Try using the gnu ld itself.

TogoFire commented 2 weeks ago

I just tried. It didn't work. It gives the same error. I tried like this: "HOSTLD=ld.lld" to "HOSTLD=ld" in script compile.sh And then I tried removing HOSTLD. And the error persists. image

mvaisakh commented 2 weeks ago

It's not HOSTLD, your kernel cross compiler ld differs. Drop the flag for using LLD with GCC and just use the regular GNU ld.

TogoFire commented 2 weeks ago

It's not HOSTLD, your kernel cross compiler ld differs. Drop the flag for using LLD with GCC and just use the regular GNU ld.

In this case you are referring to removing the llvm flags to be able to use LD=$(CROSS_COMPILE)ld ; CC= $(CROSS_COMPILE)gcc ... - From the kernel makefile. Is that it? If so. I removed the "LLVM_IAS=1" "LLVM=1" flags. And the error continues. image I'm sorry if I don't understand or am a bit lost.

mvaisakh commented 2 weeks ago

Hmm so it does look like a GCC side issue. I think you might need a kernel backport for this. For now you can stick to using older GCC.