Drivers/net/wireless/eswin compile error

Hi folks!

When I try to compile linux-JH7110_VF2_6.6_v5.12.0 directly on the VF2 with the gentoo system from andrew I get this error and compilation stops.

In file included from ./include/uapi/linux/posix_types.h:5,
                 from ./include/uapi/linux/types.h:14,
                 from ./include/linux/types.h:6,
                 from ./include/linux/kasan-checks.h:5,
                 from ./include/asm-generic/rwonce.h:26,
                 from ./arch/riscv/include/generated/asm/rwonce.h:1,
                 from ./include/linux/compiler.h:246,
                 from ./include/linux/build_bug.h:5,
                 from ./include/linux/container_of.h:5,
                 from ./include/linux/list.h:5,
                 from ./include/linux/module.h:12:
drivers/net/wireless/eswin/fullmac/ecrnx_main.c: In function ‘ecrnx_cfg80211_change_iface’:
./include/linux/stddef.h:8:14: error: passing argument 3 of ‘ecrnx_cfg80211_stop_ap’ makes integer from pointer without a cast [-Wint-conversion]
    8 | #define NULL ((void *)0)
      |              ^~~~~~~~~~~
      |              |
      |              void *
drivers/net/wireless/eswin/fullmac/ecrnx_main.c:1350:48: note: in expansion of macro ‘NULL’
 1350 |             ecrnx_cfg80211_stop_ap(wiphy, dev, NULL);
      |                                                ^~~~
drivers/net/wireless/eswin/fullmac/ecrnx_main.c:1325:93: note: expected ‘unsigned int’ but argument is of type ‘void *’
 1325 | static int ecrnx_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev, unsigned int link_id);
      |                                                                                ~~~~~~~~~~~~~^~~~~~~
drivers/net/wireless/eswin/fullmac/ecrnx_main.c: In function ‘ecrnx_cfg80211_connect’:
./include/linux/stddef.h:8:14: error: passing argument 3 of ‘ecrnx_cfg80211_add_key’ makes integer from pointer without a cast [-Wint-conversion]
    8 | #define NULL ((void *)0)
      |              ^~~~~~~~~~~
      |              |
      |              void *

The same kernel sources does compile very well on my x86 system. Does this have something todo with the gentoo system on my VF2? Can’t find any topic regarding this error.

On your x86 system the Compiler may be an older version than what you have on Gentoo.

In order to compile linux-JH7110_VF2_6.6_v5.12.0 on my System I edited
scripts/Makefile.compiler
scripts/Makefile.extrawarn
I removed all references to -Werror in The first file and commented it out in the second file.

EG
grep Werror Makefile.extrawarn
#KBUILD_CFLAGS += -Werror=implicit-function-declaration
#KBUILD_CFLAGS += -Werror=implicit-int
#KBUILD_CFLAGS += -Werror=return-type
#KBUILD_CFLAGS += -Werror=strict-prototypes
#KBUILD_CPPFLAGS-$(CONFIG_WERROR) += -Werror
#KBUILD_CFLAGS += -Werror=date-time
#KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)
#KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)

Additionally if you do not have the WIFI USB ECR6600U Dongle you can disable it in your .config file

CONFIG_USB_WIFI_ECR6600U=n

I left mine enabled as I have one.

Try Downgrade GCC. :face_exhaling:

To Downgrade GCC to GCC 12 which I think @bing uses you would need to do the Follow the WIKI with regards to Downgrading.

https://wiki.gentoo.org/wiki/Upgrading_GCC