Skip to content
This repository has been archived by the owner on Dec 17, 2018. It is now read-only.

Unable to build driver #3

Open
Azulath opened this issue Aug 10, 2018 · 12 comments
Open

Unable to build driver #3

Azulath opened this issue Aug 10, 2018 · 12 comments

Comments

@Azulath
Copy link

Azulath commented Aug 10, 2018

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

@cilynx
Copy link
Owner

cilynx commented Aug 10, 2018

Can you provide the entire build log, please?

@Azulath
Copy link
Author

Azulath commented Aug 11, 2018

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

@cilynx
Copy link
Owner

cilynx commented Aug 11, 2018

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.

@Azulath
Copy link
Author

Azulath commented Aug 11, 2018

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

@cilynx
Copy link
Owner

cilynx commented Aug 11, 2018

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

cilynx commented Aug 11, 2018

What version of gcc are you using?

@Azulath
Copy link
Author

Azulath commented Aug 11, 2018

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

@Azulath
Copy link
Author

Azulath commented Aug 18, 2018

Any news on that front?

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

@MaxG87
Copy link

MaxG87 commented Sep 4, 2018

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.

@Azulath
Copy link
Author

Azulath commented Sep 21, 2018

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

@Cyb0org
Copy link

Cyb0org commented Oct 25, 2018

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

@silibot
Copy link

silibot commented Nov 3, 2018

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.

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

No branches or pull requests

5 participants