Build error: RAMIPS MT76x8 build fails on MT7603 driver

I'm working on getting OpenWRT to support a chinese device (COMFAST) and the chipset is a MT7628. I am working on the master (development) branch of OpenWRT (mostlly because it has support for the flash chip on the device without me having to hack it in). GIT was updated today, and this isn't the first time I've had this issue.

I've enabled the MT7603 kernel driver, and I get the following compile error:

6734/mt76x02-lib.o
  CC [M]  /home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/mt76x02_usb_mcu.o
  CC [M]  /home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/mt76x02_usb_core.o
  LD [M]  /home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/mt76x02-usb.o
  CC [M]  /home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/usb.o
  CC [M]  /home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/usb_trace.o
  LD [M]  /home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/mt76-usb.o
  CC [M]  /home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/mt7603/pci.o
<command-line>:0:37: error: redeclaration of enumerator 'IEEE80211_HW_REPORTS_TX_ACK_STATUS'
<command-line>:0:37: note: in definition of macro 'IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN'
In file included from /home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/mt7603/../mt76.h:27:0,
                 from /home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/mt7603/mt7603.h:8,
                 from /home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/mt7603/pci.c:7:
/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include/mac80211/net/mac80211.h:2167:2: note: previous definition of 'IEEE80211_HW_REPORTS_TX_ACK_STATUS' was here
  IEEE80211_HW_REPORTS_TX_ACK_STATUS,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/Makefile.build:326: recipe for target '/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/mt7603/pci.o' failed
make[6]: *** [/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/mt7603/pci.o] Error 1
scripts/Makefile.build:585: recipe for target '/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/mt7603' failed
make[5]: *** [/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/mt7603] Error 2
Makefile:1533: recipe for target '_module_/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734' failed
make[4]: *** [_module_/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734] Error 2
make[4]: Leaving directory '/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/linux-4.14.113'
Makefile:236: recipe for target '/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/.built' failed
make[3]: *** [/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/mt76-2019-03-27-a11b6734/.built] Error 2
make[3]: Leaving directory '/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/package/kernel/mt76'
time: package/kernel/mt76/compile#9.57#1.39#10.63
package/Makefile:107: recipe for target 'package/kernel/mt76/compile' failed
make[2]: *** [package/kernel/mt76/compile] Error 2
make[2]: Leaving directory '/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt'
package/Makefile:103: recipe for target '/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile' failed
make[1]: *** [/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt'
/home/mbuckaway/src/kidswifi/openwrt-imagebuilder/builds/cf-wr754ac/openwrt/include/toplevel.mk:216: recipe for target 'world' failed
make: *** [world] Error 2

If would appear that the driver is re-defining a define already in the WIFI code.

The quick fix is to disable the MT7603 driver, and everything builds.

What's the process of submitting a "bug" report? Or is there a patch already? I have a work-around, but the issue should be corrected. If this is in a FAQ somewhere, pls point me to it.

git branch | git pull && ./scripts/feeds update etc.....
make clean/distclean
ignore errors

https://openwrt.org/docs/guide-developer/build-system/use-buildsystem

Thanks for the response.

Yes, I've done all that several times. Ignoring errors might work around the problem, but that does not mean the mt7603 driver module compiles...it just ignores the errors in the build. What I am looking to do is get it fixed and/or report the issue to the maintainer (assuming I don't manage to fix it myself).

ok, your OP was a tad ambiguous..... if you've used git branch... the source works, then stops working.... to my understanding, we are missing a step in your chain here....

  1. I read your initial post to mean that your "buildroot" source is working then breaks.... when updates occur...

  2. It seems that "GIT was updated today" needs to be elaborated on.

  3. Also confirm that this error occurs when using the buildroot with supported target in unmodified form.

  4. "this isn't the first time I've had this issue"

What fixed it for you last time?

This is not really a bug. One of the patches seems to have caused the issue. However, I can't be the only one. It's a simple redefinition of a define....

I read your initial post to mean that your "buildroot" source is working then breaks.... when updates occur...

I can do a make distclean or a few checkout, and the same issue happens.

It seems that "GIT was updated today" needs to be elaborated on.

I did a 'get pull" yesterday to get the latest code, ran feeds update -a, feeds update -u, etc.

Also confirm that this error occurs when using the buildroot with supported target in unmodified form.

I've made no modifications. The issue happens if and only if I enable the MT7603 driver.

"this isn't the first time I've had this issue"
Back to 1. If I disable the MT7603 driver, the build will work and compile cleanly. I've used disabled the mt7603 driver to be able to test the build on the device. However, it now appears I actually need that driver.

1 Like

ok, now i'm catching on.

COMFAST ? ( all chipset numbers or similar )
SUBTARGET you've been using?

COMFAST WR754AC. It's not currently supported, but uses a MT7628 SOC and a MT7612 chip on the PCI bus. It is running OpenWRT 15. For our project, I'm using OpenWRT 18.

I've added a subtarget to mt76x8.mk and create a DTS (based on what COMFAST sent me - I'm working with them).

Thus:
TARGET=CF-WR754AC
PLATFORM=ramips
CHIP=mt76x8

The only changes to the source tree is the two files. The rest is stock from the master branch.

Currently, the image I've generated flashes and boots....however, I'm missing a driver for the WIFI part of the MT7628. Thus, I'm attempting to include the entire MT76 driver package....and the MT7603 driver will not build.

Hello @mbuckaway. Did you manage to build OpneWRT for that device? I have that repeater and would like o install OpenWRT. Thanks.

Can I see .dts for CF-WR754AC? I want to buy this device and assemble a normal OpenWRT