RinCat / RTL88x2BU-Linux-Driver

Realtek RTL88x2BU WiFi USB Driver for Linux
GNU General Public License v2.0
1.26k stars 197 forks source link

ERROR: modpost: "mcount" [RTL88x2BU-Linux-Driver/88x2bu.ko] undefined! #113

Open kisira opened 2 years ago

kisira commented 2 years ago

I cant build the driver, on Ubuntu 21.10. I has always built before on the same machine. Please help, thanks

RinCat commented 2 years ago

Hi, please post full logs.

kisira commented 2 years ago

Hi, please post full logs.

The code didn't build, as such I could not install it. When I try to install it with "sudo make install" the error I get is:

install -p -m 644 88x2bu.ko /lib/modules/5.13.0-22-generic/kernel/drivers/net/wireless/ install: cannot stat '88x2bu.ko': No such file or directory make: *** [Makefile:2460: install] Error 1

I cannot run "modprobe 88x2bu rtw_drv_log_level=5" because there is no driver installed, since it didn't build. I am also not sure how to generate build logs, if possible. I had already uninstalled te old driver when I was building this driver. I am running Ubuntu 21.10, with Kernel version 5.13.0-22-generic.

RinCat commented 2 years ago

I mean the build logs. The output when running make.

kisira commented 2 years ago

I mean the build logs. The output when running make.

Thanks for the clarification. Please point out which file or files those are. Are they in the same folder as the code? Do I have to run make with some switches?

RinCat commented 2 years ago

There is no such files, just copy the output after run make.

kisira commented 2 years ago

Please see the attached file. Thanks

I mean the build logs. The output when running make.

Thanks for the clarification. Please point out which file or files those are. Are they in the same folder as the code? Do I have to run make with some switches results_make.txt ?

RinCat commented 2 years ago

There is no log file when you manual make. So that is the correct logs.

From the logs I think there is something wrong with your compilation environment. You should try run make V=1 to show full commands, and upload the log.

kisira commented 2 years ago

Please see the attache file Thanks results_make2.txt

RinCat commented 2 years ago

-g -gdwarf-4 -pg -mrecord-mcount Your system gcc enabled debug and profile information, which usually not enabled. Try edit file Makefile and remove line EXTRA_LDFLAGS += --strip-debug

kisira commented 2 years ago

-g -gdwarf-4 -pg -mrecord-mcount Your system gcc enabled debug and profile information, which usually not enabled. Try edit file Makefile and remove line EXTRA_LDFLAGS += --strip-debug

I tried it, but I don't think it helped. Here is the resulting log file Thank results_make3.txt s

RinCat commented 2 years ago

Try add EXTRA_CFLAGS += -mfentry at the top of Makefile

kisira commented 2 years ago

Try add EXTRA_CFLAGS += -mfentry at the top of Makefile

Wow! That worked! Thank you so much

RinCat commented 2 years ago

I do recommended you to fix your local environment, as it could cause the same issue if you compile other software.

kisira commented 2 years ago

I do recommended you to fix your local environment, as it could cause the same issue if you compile other software.

Thank you for the advise. How do I do that?

RinCat commented 2 years ago

I do recommended you to fix your local environment, as it could cause the same issue if you compile other software.

Thank you for the advise. How do I do that?

I don't know, too many things could change that. You should check your linux distribution docs.

kisira commented 2 years ago

I do recommended you to fix your local environment, as it could cause the same issue if you compile other software.

Thank you for the advise. How do I do that?

I don't know, too many things could change that. You should check your linux distribution docs.

Ok, I will look into it. If you don't mind me asking, what does the EXTRA_CFLAGS += -mfentry do?

RinCat commented 2 years ago

-mfentry use a new mechanism to do profiling counter, which override mcount. So your gcc will not enable -mrecord-mcount. It not a fix but a workaround.