rtl88x2BU_WiFi_linux_v5.2.4.4_26334.20180126_COEX20171012-5044 icon indicating copy to clipboard operation
rtl88x2BU_WiFi_linux_v5.2.4.4_26334.20180126_COEX20171012-5044 copied to clipboard

Unable to build driver

Open Azulath opened this issue 5 years ago • 12 comments

When trying to build the driver it aborts with the following error in the log:

/var/lib/dkms/rtl88x2bu/5.2.4.4/build/hal/hal:hci/hal_usb.c:28:8: error: cast between incompatible function types from 'void (*)(void *)' to 'void (*) (long unsigned int)' [-Werror=cast function type]
(void(*)(unsigned long))usb_revc_tasklet,

I'm running Fedora 28 with Linux 4.17.12

Azulath avatar Aug 10 '18 18:08 Azulath

Can you provide the entire build log, please?

cilynx avatar Aug 10 '18 21:08 cilynx

Sure thing, there you go and thanks for taking the time: https://pastebin.com/yetrUFHi

Azulath avatar Aug 11 '18 13:08 Azulath

Thanks -- I'll do some digging. I found someone else with the same issue on 4.17.5-1-zen (x86_64).

http://pastebin.calculate-linux.org/ru/show/63918

It's interesting because it builds clean for me on Debian's 4.17.8-1. I'll ping back here if I come up with anything useful.

cilynx avatar Aug 11 '18 16:08 cilynx

Thanks. Could it be because of the newer Kernel? 4.17.12-200.fc28 vs 4.17.8-1

Azulath avatar Aug 11 '18 16:08 Azulath

Normally, I'd say yes, but the fact that someone with 4.17.5-1-zen is running into the exact same error as you makes it tricky. The issue looks to be some complication around a void pointer. I'm looking around to see if anything has changed around that stuff recently and if maybe some vendors have patched early or held off.

cilynx avatar Aug 11 '18 16:08 cilynx

What version of gcc are you using?

cilynx avatar Aug 11 '18 17:08 cilynx

I'm using gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC)

Azulath avatar Aug 11 '18 19:08 Azulath

Any news on that front?

I'm asking because I could still refund this WiFi stick and if it stays unusable I probably will.

Azulath avatar Aug 18 '18 13:08 Azulath

This is not an error but an warning. It fails to compile only due to the -Werror flag. The compile should work if you comment out the line containing -Werror in the Makefile.

I could imagine that the problem arises due to different kernel patches applied by different distributions. On my system, the tasklet_init function seems to be defined in

/usr/src/linux-headers-4.17.0-3-common/include/linux/interrupt.h

and the signature is

extern void tasklet_init(struct tasklet_struct *t, void (*func)(unsigned long), unsigned long data)

which is the appropriate typing for the usage in hal_usb.c. Maybe you could check your interrupt.h. Then, at least, we would know the source of the error.

MaxG87 avatar Sep 04 '18 20:09 MaxG87

Thanks for your response, but as mentioned above I've already sent the stick back and picked a new one with an Artheros chipset.

Azulath avatar Sep 21 '18 19:09 Azulath

/usr/src/rtl88x2bu-5.2.4.4/hal/hal_hci/hal_usb.c: In function ‘usb_init_recv_priv’: /usr/src/rtl88x2bu-5.2.4.4/hal/hal_hci/hal_usb.c:28:8: warning: cast between incompatible function types from ‘void ()(void )’ to ‘void ()(long unsigned int)’ [-Wcast-function-type] (void()(unsigned long))usb_recv_tasklet, ^

/usr/src/rtl88x2bu-5.2.4.4/hal/rtl8822b/usb/rtl8822bu_xmit.c: In function ‘rtl8822bu_init_xmit_priv’: /usr/src/rtl88x2bu-5.2.4.4/hal/rtl8822b/usb/rtl8822bu_xmit.c:843:8: warning: cast between incompatible function types from ‘void ()(void )’ to ‘void ()(long unsigned int)’ [-Wcast-function-type] (void()(unsigned long))rtl8822bu_xmit_tasklet, ^

tasklet_init from "/usr/src/linux-headers-4.18.0-10/include/linux/interrupt.h":

extern void tasklet_init(struct tasklet_struct *t, void (*func)(unsigned long), unsigned long data);

Ubuntu 18.10 gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1)

I think #3 and #5 are about the same problem.

Cyb0org avatar Oct 25 '18 07:10 Cyb0org

I have Ubuntu 18.10 and kernel 4.18.0-11 and using @MaxG87's suggestion of commenting out the line containing -Werror in the Makefile I was able to build and install the module successfully. After a reboot and logging in I plugged it in and now it is working again! Thank you sir.

silibot avatar Nov 03 '18 03:11 silibot