I can use dkms to install (or just make) realtek-rtl88xxau-5.2.20.2~20180812 on Rock Pi running Ubuntu server (from a couple of years ago) and Rock64 running debian (4.4.132-1075-rockchip).
On the Rock Pi using debian desktop (4.4.154-112-rockchip and -113-rockchip), both dkms build or make give me “Exec format error”. I have tried gcc-8 -7 and -6, the last of which is what is working on Rock64, and I deduce that the problem is with the linux-headers.
The following would not compile (make) on either the Rock Pi (debian desktop) or the Rock64:
How may I work through this error aside from trying various different kernels and accompanying linux-headers by trial and error?
Hi,
I had the same kind of error when I tried to use the rtl8811cu wifi usb dongle on the Rock 3A. The error was “scripts/basic/fixdep: Exec format error”.
I looked into the fixdep file by cat command and I realized the file was built on x86 environment.
Therefore, I re-made the file on arm64 environment.
In the directory of /usr/src/linux-heafers-*/, execute #make scripts
The process may stop by an error, however, the new fixdep is re-built. you can check it by the new timestamp or “cat fixdep”. It probably contains “aarch64” information.
After that, you will succeed in the driver installation using “sudo ./dkms-install.sh”.
Your comment was very helpful.
I ran into this problem when I first received my Rock Pi as shown by my post from 2019,
and had forgotten.
file /usr/src/linux-headers-4.4.194-19-rockchip-g287ff75afc47/scripts/recordmcount
/usr/src/linux-headers-4.4.194-19-rockchip-g287ff75afc47/scripts/recordmcount: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=0610df3dcc846dfea7202b5038911829152c7685, not stripped
Your approach did not work for me.
make scripts
make: *** No rule to make target ‘scripts’. Stop.
The file-by-file method (involving only two binaries) did. To find what to fix, I compiled the driver manually. Then, I did the following.
mv recordmcount recordmcount-orig_x86-64
make recordmcount
cc recordmcount.c -o recordmcount
cd basic/
mv fixdep fixdep-orig_x86-64
make fixdep
cc fixdep.c -o fixdep
Now, I have run into another, different problem (which does not occur on my Rock64).
/home/rock/realtek-rtl88xxau-5.2.20.2~20180812/hal/rtl8812a/usb/rtl8812au_xmit.c: In function ‘upload_txpktbuf_8812au’:
/home/rock/realtek-rtl88xxau-5.2.20.2~20180812/hal/rtl8812a/usb/rtl8812au_xmit.c:443:61: warning: bitwise comparison always evaluates to false [-Wtautological-compare]
error, forbidden warning:rtl8812au_xmit.c:443
while ((rtw_read32(adapter, REG_PKTBUF_DBG_CTRL) & BIT23) == 1) {
^~
A web search suggests the problem may be with python, but both my Rock Pi and Rock64 have 2.7.
I do not (yet?) see anything relevant in the driver’s Makefile.
I have the driver compiled and the wifi adapter functional. It is capable of downloading. I have not yet tested its ability to upload.
NOTE: This problem is not truly solved for the Rock Pi.
I could not compile /usr/src/linux-headers-4.4.154-113-rockchip-gdb9dfc2cdd25/scripts/mod/modpost (see below).
I used the binary from Rock64’s linux-headers.
I had to make two changes to my system.
i. I fixed wrongly compiled scripts (which were binaries not scripts) in kernel headers.
file /usr/src/linux-headers-4.4.194-19-rockchip-g287ff75afc47/scripts/recordmcount
/usr/src/linux-headers-4.4.194-19-rockchip-g287ff75afc47/scripts/recordmcount: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=0610df3dcc846dfea7202b5038911829152c7685, not stripped
I backed up original scripts and compiled each needed one anew.
cd /usr/src/linux-headers-4.4.154-113-rockchip-gdb9dfc2cdd25
cp -a scripts/ scripts-orig_x86-64
cd scripts
I had to compile one at a time after I found which I needed (by attempting to compile 8812au.ko and seeing where cc choked).
mv recordmcount recordmcount-orig_x86-64
make recordmcount
cc recordmcount.c -o recordmcount
cd basic/
mv fixdep fixdep-orig_x86-64
make fixdep
cc fixdep.c -o fixdep
and later, after bypassing an error in compiling,
cd /usr/src/linux-headers-4.4.154-113-rockchip-gdb9dfc2cdd25/scripts
cd mod/
mv modpost modpost-orig_x86-64
make modpost
cc modpost.o -o modpost
/usr/bin/ld: modpost.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: modpost.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: modpost.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: modpost.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: modpost.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: modpost.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
make: *** [: modpost] Error 1
Here, I decided to use Rock64’s modpost
cp -a /home/rock/ROCK64-files_for_Rock_Pi/modpost .
ii. I used gcc-7 to compile to avoid the following error with gcc-8:
/home/rock/realtek-rtl88xxau-5.2.20.2~20180812/hal/rtl8812a/usb/rtl8812au_xmit.c:443:61: warning: bitwise comparison always evaluates to false [-Wtautological-compare]
error, forbidden warning:rtl8812au_xmit.c:443
while ((rtw_read32(adapter, REG_PKTBUF_DBG_CTRL) & BIT23) == 1) {
apt install gcc-7
The following NEW packages will be installed:
cpp-7 gcc-7 gcc-7-base libasan4 libgcc-7-dev libubsan0
0 upgraded, 6 newly installed, 0 to remove and 41 not upgraded.
Need to get 15.9 MB of archives.
After this operation, 50.5 MB of additional disk space will be used.
cd /usr/bin/
rm /usr/bin/gcc
ln -s gcc-7 /usr/bin/gcc
rm /usr/bin/gcc-ar
ln -s gcc-ar-7 /usr/bin/gcc-ar
rm /usr/bin/gcc-nm
ln -s gcc-nm-7 /usr/bin/gcc-nm
rm /usr/bin/gcc-ranlib
ln -s gcc-ranlib-7 /usr/bin/gcc-ranlib
ls -l /usr/bin/gcc*
showed gcc-7 in use.
cp -a realtek-rtl88xxau-5.2.20.2~20180812 /usr/src/
dkms add realtek-rtl88xxau/5.2.20.2~20180812
dkms build realtek-rtl88xxau/5.2.20.2~20180812
dkms install realtek-rtl88xxau/5.2.20.2~20180812
After compiling/installing I reverted to gcc-8
cd /usr/bin
rm /usr/bin/gcc
ln -s gcc-8 /usr/bin/gcc
rm /usr/bin/gcc-ar
ln -s gcc-ar-8 /usr/bin/gcc-ar
rm /usr/bin/gcc-nm
ln -s gcc-nm-8 /usr/bin/gcc-nm
rm /usr/bin/gcc-ranlib
ln -s gcc-ranlib-8 /usr/bin/gcc-ranlib
ls -l /usr/bin/gcc*
showed gcc-8 in use.
In Makefile, I changed
CONFIG_PLATFORM_I386_PC = y
CONFIG_PLATFORM_ARM_RPI = n
CONFIG_PLATFORM_ARM64_RPI = n
to
CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARM_RPI = n
CONFIG_PLATFORM_ARM64_RPI = y
and the driver compiled (with my changes to linux-headers).
I have not yet tested it.