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

Compiled fine on Pi OS 11 32 bit (ARM), but on Pi OS 11 64 bit (ARM64), make fails? #5

Open
Jibun-no-Kage opened this issue Nov 16, 2022 · 6 comments

Comments

@Jibun-no-Kage
Copy link

Compiled fine on Pi OS 11 32 bit (ARM), but on Pi OS 11 64 bit (ARM64), make fails? I am using rpi-update to latest firmware/kernel, and rpi-source to pull the very latest raspberry pi kernel headers to match rpi-update. As I noted above, this seemed to work fine under 32 bit, but hit the following error(s) under 64 bit. Any idea why? Should it not work under 64 bit?

Error detail...

LD [M] /root/rtl8188eu-ivanovborislav/8188eu.o
MODPOST /root/rtl8188eu-ivanovborislav/Module.symvers
ERROR: modpost: "__const_udelay" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "__arch_copy_from_user" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "_raw_spin_unlock" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "__rcu_read_lock" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "__rcu_read_unlock" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "cpu_hwcap_keys" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "csum_ipv6_magic" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "__warn_printk" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "arm64_const_caps_ready" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "__udelay" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
WARNING: modpost: suppressed 2 unresolved symbol warnings because there were too many)
make[2]: *** [scripts/Makefile.modpost:133: /root/rtl8188eu-ivanovborislav/Module.symvers] Error 1
make[2]: *** Deleting file '/root/rtl8188eu-ivanovborislav/Module.symvers'
make[1]: *** [Makefile:1815: modules] Error 2
make[1]: Leaving directory '/root/linux-31bf7119c2a66c2d198386bb92bd9a421c9fd394'
make: *** [Makefile:2489: modules] Error 2

@ivanovborislav
Copy link
Owner

Hi!

What is the kernel version?

@Jibun-no-Kage
Copy link
Author

Jibun-no-Kage commented Nov 19, 2022

Ah, I should have included that... it was the latest rpi-update and used rpi-source to pull the headers. I am testing a new i2c-sensor overlay that the Pi team (here on GitHub) just updated for me, to add some new sensors to the official support list, so I needed the latest firmware/kernel.

I updated 32 bit from...
Linux template 5.15.61-v7+ #1579 SMP Fri Aug 26 11:10:59 BST 2022 armv7l GNU/Linux
To...
Linux template 5.15.79-v7+ #1600 SMP Fri Nov 18 18:20:17 GMT 2022 armv7l GNU/Linux

I updated 64 bit from...
Linux template 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux
To...
Linux template 5.15.79-v8+ #1600 SMP PREEMPT Fri Nov 18 18:27:08 GMT 2022 aarch64 GNU/Linux

Using a Pi Model 3 B in this case. But don't think that matters.

Just to validate I did the following steps on 32 bit and then 64 bit Pi OS images...

# uname -a
# rpi-update
# reboot
# uname -a

# cd /root
# apt update
# apt full-upgrade
# apt install bison flex libncurses5-dev git bc libssl-dev python2
# git clone https://github.com/RPi-Distro/rpi-source.git
# cd rpi-source
# python2 ./rpi-source

# cd /root
# apt install bc build-essential
# apt install raspberrypi-kernel-headers
# git clone https://github.com/ivanovborislav/rtl8188eu.git
# mv rtl8188eu rtl8188eu-ivanovborislav
# cd rtl8188eu-

(Changed Makefile)
CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_RPI_ARM = n
CONFIG_PLATFORM_RPI_ARM64 = y

# echo "blacklist r8188eu" > /etc/modprobe.d/blacklist-r8188eu-realtek.conf
# make
# make install

On 32 bit... Everything compiled, installed, and on insert of wifi-dongle, got association and ip address as expected.

On 64 bit,... Previous test, when I opened the issue, failure, and with the latest test, also a failure...
# make clean
#make -C /lib/modules/5.15.79-v8+/build M=/root/rtl8188eu-ivanovborislav clean
cd hal ; rm -fr ///.mod.c ///.mod ///.o ///..cmd ///.ko
cd hal ; rm -fr //.mod.c //.mod //.o //..cmd //*.ko
cd hal ; rm -fr /.mod.c /.mod /.o /..cmd /.ko
cd hal ; rm -fr *.mod.c *.mod .o ..cmd *.ko
cd core ; rm -fr /.mod.c /.mod /.o /..cmd /.ko
cd core ; rm -fr *.mod.c *.mod .o ..cmd *.ko
cd os_dep/linux ; rm -fr *.mod.c *.mod .o ..cmd *.ko
cd os_dep ; rm -fr *.mod.c *.mod .o ..cmd *.ko
cd platform ; rm -fr *.mod.c *.mod .o ..cmd *.ko
rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order
rm -fr *.mod.c *.mod .o ..cmd *.ko *~
rm -fr .tmp_versions
# make
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/5.15.79-v8+/build M=/root/rtl8188eu-ivanovborislav modules
make[1]: Entering directory '/root/linux-3e2b55bf16ebcdc0cc4585e57463d32635161611'
CC [M] /root/rtl8188eu-ivanovborislav/core/rtw_cmd.o
CC [M] /root/rtl8188eu-ivanovborislav/core/rtw_security.o
CC [M] /root/rtl8188eu-ivanovborislav/core/rtw_debug.o
[Redacted]
CC [M] /root/rtl8188eu-ivanovborislav/core/rtw_mp.o
LD [M] /root/rtl8188eu-ivanovborislav/8188eu.o
MODPOST /root/rtl8188eu-ivanovborislav/Module.symvers
ERROR: modpost: "__const_udelay" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "__arch_copy_from_user" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "_raw_spin_unlock" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "__rcu_read_lock" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "__rcu_read_unlock" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "cpu_hwcap_keys" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "csum_ipv6_magic" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "__warn_printk" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "arm64_const_caps_ready" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
ERROR: modpost: "__udelay" [/root/rtl8188eu-ivanovborislav/8188eu.ko] undefined!
WARNING: modpost: suppressed 2 unresolved symbol warnings because there were too many)
make[2]: *** [scripts/Makefile.modpost:133: /root/rtl8188eu-ivanovborislav/Module.symvers] Error 1
make[2]: *** Deleting file '/root/rtl8188eu-ivanovborislav/Module.symvers'
make[1]: *** [Makefile:1815: modules] Error 2
make[1]: Leaving directory '/root/linux-3e2b55bf16ebcdc0cc4585e57463d32635161611'
make: *** [Makefile:2489: modules] Error 2

For 64 bit image...
# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Let me know if any other information is needed.

@Jibun-no-Kage
Copy link
Author

Jibun-no-Kage commented Nov 19, 2022

I after a pretty extensive google search I found a vague reference to the fact that newer kernel compiling seems to demand .o.cmd file was missing, The author mentioned, "add a touch command to the Kbuild file (i.e. 'touch .driver.o.cmd')."

Then I found a comment that a modules.symvers file must exist or be generated. So I tried that, since I did not understand the reference to a missing .o.cmd file.

# make clean
# make modulesymfile=./Module.symvers

This seemed to let the make finish. So with blind faith did the make install...

# make install

Surprise, when I inserted the 8188eus based USB wifi dongle, the driver loaded, the interface appeared and get an IP address as usual. I leave it to greater minds than mind, to understand why this worked? I need to test the driver of course, but the compile appears good, at least for now.

I guess another question is, why did the 32 bit test work without this tweak?

@ivanovborislav
Copy link
Owner

I can't fix this! It's an PiOS 64bit problem. Just try another OS.

@Jibun-no-Kage
Copy link
Author

That is why I tested on both 32 bit and 64 bit Pi OS. Worked fine on 32 bit Pi OS. Creating an empty Modules.symvers file seems to let the compile complete, which seems really odd to me, but I am not an expert on use make. Like I said I got the idea of the empty file tweak from a few references via Google, was really surprised when it worked. Maybe if you include an empty Modules.symvers file in the git, just so it works? Or document it as a possible issue in the read.me file? Just a thought.

@Jibun-no-Kage
Copy link
Author

Jibun-no-Kage commented Nov 21, 2022

A side question, have you any interest in adding dkms support to your project? Would be a nice add to your project, IMHO.

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