morrownr / 8821au-20210708

Linux Driver for USB WiFi Adapters that are based on the RTL8811AU and RTL8821AU Chipsets - v5.12.5.2
Other
740 stars 110 forks source link

Error compilation: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] #148

Open KirMozor opened 4 months ago

KirMozor commented 4 months ago

I got a compilation error, here is the full log:

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/6.4.0-150600.23.7-default/build M=/home/user/Git/8821au-20210708  modules
make[1]: Entering directory '/usr/src/linux-6.4.0-150600.23.7-obj/x86_64/default'
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_cmd.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_security.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_debug.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_io.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_ioctl_query.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_ioctl_set.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_ieee80211.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_mlme.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_mlme_ext.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_mi.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_wlan_util.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_vht.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_pwrctrl.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_rf.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_chplan.o
  CC [M]  /home/user/Git/8821au-20210708/core/monitor/rtw_radiotap.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_recv.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_sta_mgt.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_ap.o
  CC [M]  /home/user/Git/8821au-20210708/core/wds/rtw_wds.o
  CC [M]  /home/user/Git/8821au-20210708/core/mesh/rtw_mesh.o
  CC [M]  /home/user/Git/8821au-20210708/core/mesh/rtw_mesh_pathtbl.o
  CC [M]  /home/user/Git/8821au-20210708/core/mesh/rtw_mesh_hwmp.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_xmit.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_p2p.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_rson.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_tdls.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_br_ext.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_iol.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_sreset.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_btcoex_wifionly.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_btcoex.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_beamforming.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_odm.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_rm.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_rm_fsm.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_ft.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_wnm.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_mbo.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_rm_util.o
  CC [M]  /home/user/Git/8821au-20210708/core/efuse/rtw_efuse.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_roch.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/aes-internal.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/aes-internal-enc.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/aes-gcm.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/aes-ccm.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/aes-omac1.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/ccmp.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/gcmp.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/aes-siv.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/aes-ctr.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/sha256-internal.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/sha256.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/sha256-prf.o
  CC [M]  /home/user/Git/8821au-20210708/core/crypto/rtw_crypto_wrap.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_swcrypto.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/osdep_service.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/os_intfs.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/usb_intf.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/usb_ops_linux.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/ioctl_linux.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/xmit_linux.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/mlme_linux.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/recv_linux.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/ioctl_cfg80211.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/rtw_cfgvendor.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/wifi_regd.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/rtw_android.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/rtw_proc.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/nlrtw.o
  CC [M]  /home/user/Git/8821au-20210708/os_dep/linux/rtw_rhashtable.o
  CC [M]  /home/user/Git/8821au-20210708/hal/hal_intf.o
/home/user/Git/8821au-20210708/os_dep/linux/ioctl_cfg80211.c:10553:15: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .tdls_mgmt = cfg80211_rtw_tdls_mgmt,
               ^~~~~~~~~~~~~~~~~~~~~~
/home/user/Git/8821au-20210708/os_dep/linux/ioctl_cfg80211.c:10553:15: note: (near initialization for ‘rtw_cfg80211_ops.tdls_mgmt’)
  CC [M]  /home/user/Git/8821au-20210708/hal/hal_com.o
  CC [M]  /home/user/Git/8821au-20210708/hal/hal_com_phycfg.o
  CC [M]  /home/user/Git/8821au-20210708/hal/hal_phy.o
  CC [M]  /home/user/Git/8821au-20210708/hal/hal_dm.o
  CC [M]  /home/user/Git/8821au-20210708/hal/hal_dm_acs.o
  CC [M]  /home/user/Git/8821au-20210708/hal/hal_btcoex_wifionly.o
  CC [M]  /home/user/Git/8821au-20210708/hal/hal_btcoex.o
  CC [M]  /home/user/Git/8821au-20210708/hal/hal_mp.o
  CC [M]  /home/user/Git/8821au-20210708/hal/hal_mcc.o
  CC [M]  /home/user/Git/8821au-20210708/hal/hal_hci/hal_usb.o
cc1: warning: unrecognized command line option ‘-Wno-enum-conversion’
cc1: warning: unrecognized command line option ‘-Wno-stringop-overread’
cc1: warning: unrecognized command line option ‘-Wno-enum-int-mismatch’
cc1: warning: unrecognized command line option ‘-Wno-cast-function-type’
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/os_dep/linux/ioctl_cfg80211.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [../../../linux-6.4.0-150600.23.7/Makefile:2066: /home/user/Git/8821au-20210708] Error 2
make[1]: Leaving directory '/usr/src/linux-6.4.0-150600.23.7-obj/x86_64/default'
make: *** [Makefile:2498: modules] Error 2

OS: openSUSE Leap 15.6 GCC Vesion: 7.5.0

If set default gcc version - 12.3:

user@localhost ~/G/8821au-20210708 (main)> sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 50
update-alternatives: using /usr/bin/gcc-12 to provide /usr/bin/gcc (gcc) in auto mode
user@localhost ~/G/8821au-20210708 (main)> gcc --version
gcc (SUSE Linux) 12.3.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

user@localhost ~/G/8821au-20210708 (main)> sudo make clean
#make -C /lib/modules/6.4.0-150600.23.7-default/build M=/home/user/Git/8821au-20210708 clean
cd hal ; rm -fr */*/*/*.mod.c */*/*/*.mod */*/*/*.o */*/*/.*.cmd */*/*/*.ko
cd hal ; rm -fr */*/*.mod.c */*/*.mod */*/*.o */*/.*.cmd */*/*.ko
cd hal ; rm -fr */*.mod.c */*.mod */*.o */.*.cmd */*.ko
cd hal ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd core ; rm -fr */*.mod.c */*.mod */*.o */.*.cmd */*.ko
cd core ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd os_dep/linux ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd os_dep ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd platform ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order
rm -fr *.mod.c *.mod *.o .*.cmd *.ko *~
rm -fr .tmp_versions
rm -fr MOK.der MOK.priv
user@localhost ~/G/8821au-20210708 (main)> sudo make -j$(nproc)
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/6.4.0-150600.23.7-default/build M=/home/user/Git/8821au-20210708  modules
make[1]: Entering directory '/usr/src/linux-6.4.0-150600.23.7-obj/x86_64/default'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (SUSE Linux) 7.5.0
  You are using:           gcc (SUSE Linux) 12.3.0
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_cmd.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_security.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_debug.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_io.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_ioctl_query.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_ioctl_set.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_ieee80211.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_mlme.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_mlme_ext.o
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_mi.o
gcc: error: unrecognized command-line option ‘-fmin-function-alignment=16’; did you mean ‘-flimit-function-alignment’?
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_wlan_util.o
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/core/rtw_cmd.o] Error 1
make[2]: *** Waiting for unfinished jobs....
gcc: error: unrecognized command-line option ‘-fmin-function-alignment=16’; did you mean ‘-flimit-function-alignment’?
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/core/rtw_debug.o] Error 1
  CC [M]  /home/user/Git/8821au-20210708/core/rtw_vht.o
gcc: error: unrecognized command-line option ‘-fmin-function-alignment=16’; did you mean ‘-flimit-function-alignment’?
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/core/rtw_security.o] Error 1
gcc: error: unrecognized command-line option ‘-fmin-function-alignment=16’; did you mean ‘-flimit-function-alignment’?
gcc: error: unrecognized command-line option ‘-fmin-function-alignment=16’; did you mean ‘-flimit-function-alignment’?
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/core/rtw_ioctl_query.o] Error 1
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/core/rtw_io.o] Error 1
gcc: error: unrecognized command-line option ‘-fmin-function-alignment=16’; did you mean ‘-flimit-function-alignment’?
gcc: error: unrecognized command-line option ‘-fmin-function-alignment=16’; did you mean ‘-flimit-function-alignment’?
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/core/rtw_ioctl_set.o] Error 1
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/core/rtw_ieee80211.o] Error 1
gcc: error: unrecognized command-line option ‘-fmin-function-alignment=16’; did you mean ‘-flimit-function-alignment’?
gcc: error: unrecognized command-line option ‘-fmin-function-alignment=16’; did you mean ‘-flimit-function-alignment’?
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/core/rtw_mlme.o] Error 1
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/core/rtw_mlme_ext.o] Error 1
gcc: error: unrecognized command-line option ‘-fmin-function-alignment=16’; did you mean ‘-flimit-function-alignment’?
gcc: error: unrecognized command-line option ‘-fmin-function-alignment=16’; did you mean ‘-flimit-function-alignment’?
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/core/rtw_wlan_util.o] Error 1
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/core/rtw_mi.o] Error 1
gcc: error: unrecognized command-line option ‘-fmin-function-alignment=16’; did you mean ‘-flimit-function-alignment’?
make[2]: *** [/usr/src/linux-6.4.0-150600.23.7/scripts/Makefile.build:252: /home/user/Git/8821au-20210708/core/rtw_vht.o] Error 1
make[1]: *** [../../../linux-6.4.0-150600.23.7/Makefile:2066: /home/user/Git/8821au-20210708] Error 2
make[1]: Leaving directory '/usr/src/linux-6.4.0-150600.23.7-obj/x86_64/default'
make: *** [Makefile:2498: modules] Error 2
user@localhost ~/G/8821au-20210708 (main) [2]> 
morrownr commented 4 months ago

@KirMozor

I have tried to duplicate this issue without success. As I have time, I will dig deeper but this could be a problem in your system. This repo averages about 90 clones per day and I am not seeing other reports like this.

Suggestion:

Remove this driver and try the following driver:

https://github.com/morrownr/8821au-20210708/issues/133

We are planning to upstream this driver to the Linux kernel very soon. We'd like to see how it works for you.