Driver (88xxau/8812au) for Alfa AWUS036AC/AWUS036ACH won't compile [Required Rock64's modpost to solve]

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”.

I hope this help you.

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) {

                                                     ^~

Originally, gcc-8 was the compiler.
ls -l /usr/bin/gcc*
lrwxrwxrwx 1 root root 5 Feb 25 2019 /usr/bin/gcc -> gcc-8
lrwxrwxrwx 1 root root 23 Apr 6 2019 /usr/bin/gcc-8 -> aarch64-linux-gnu-gcc-8
lrwxrwxrwx 1 root root 8 Feb 25 2019 /usr/bin/gcc-ar -> gcc-ar-8
lrwxrwxrwx 1 root root 26 Apr 6 2019 /usr/bin/gcc-ar-8 -> aarch64-linux-gnu-gcc-ar-8
lrwxrwxrwx 1 root root 8 Feb 25 2019 /usr/bin/gcc-nm -> gcc-nm-8
lrwxrwxrwx 1 root root 26 Apr 6 2019 /usr/bin/gcc-nm-8 -> aarch64-linux-gnu-gcc-nm-8
lrwxrwxrwx 1 root root 12 Feb 25 2019 /usr/bin/gcc-ranlib -> gcc-ranlib-8
lrwxrwxrwx 1 root root 30 Apr 6 2019 /usr/bin/gcc-ranlib-8 -> aarch64-linux-gnu-gcc-ranlib-8

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.

here is newer

Thanks!

I did
wget https://github.com/morrownr/8812au-20210629/archive/refs/heads/main.zip

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.

there is also a kernel 4.4.194 but with a lot of wifi drivers.

  • Wireless drivers for Realtek 8189ES chipsets
  • Wireless drivers for Realtek 8189FS chipsets
  • Wireless drivers for Realtek 8192EU chipsets
  • Wireless drivers for Realtek 8811, 8812, 8814 and 8821 chipsets
  • Wireless drivers for Xradio XR819 chipsets
  • Wireless drivers for Realtek RTL8811CU and RTL8821C chipsets
  • Wireless drivers for Realtek 8188EU 8188EUS and 8188ETV chipsets
  • Wireless drivers for Realtek 88x2bu chipsets
  • Wireless drivers for Realtek 88x2cs chipsets
  • Wireless drivers for Realtek 8723DS chipsets
  • Wireless drivers for Realtek 8723DU chipsets
  • Wireless drivers for Realtek 8814AU chipsets

mara,
Thanks!

But, I am unable to change the boot image, as I said here,

[How may I change the default boot image?] - How may I change the default boot image?

No one has replied to my post.
If you (or anyone) would be kind enough to tell me how you managed to change your boot image, I would be very grateful.

For convenience and completeness, I ask that you or any other respondant reply both here and there.

Very Truly Yours,
oliphant