Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
TogoFire opened this issue Aug 29, 2024 · 11 comments
Open

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

TogoFire opened this issue Aug 29, 2024 · 11 comments

Comments

@TogoFire
Copy link

TogoFire commented Aug 29, 2024

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

@TogoFire
Copy link
Author

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
Copy link
Owner

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

@TogoFire
Copy link
Author

TogoFire commented Aug 30, 2024

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
Copy link
Owner

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

@TogoFire
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

TogoFire commented Aug 30, 2024

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants