Search code examples
buildembedded-linuxopenwrt

make: *** [package/mac80211/compile] Error 1 in OpenWRT


I compiled my SDK several times and always I have the same result when I did make V=99, here are the errors that appear:

build_dir/linux-brcm47xx/compat-wireless-2011-05-27/drivers/net/wireless/b43/main.c:4240:3: error: implicit declaration of function 'ssb_commit_settings'
make[8]: *** [/home/rik/client/openwrt/build_dir/linux-brcm47xx/compat-wireless-2011-05-27/drivers/net/wireless/b43/main.o] Error 1

make[3]: Leaving directory `/home/rik/client/openwrt/package/mac80211'
make[2]: *** [package/mac80211/compile] Error 2
make[2]: Leaving directory `/home/rik/client/openwrt'
make[1]: *** [/home/rik/client/openwrt/staging_dir/target-mipsel_uClibc-0.9.32/stamp/.package_compile] Error 2

Solution

  • The answer for the first error can be found here: Why this "Implicit declaration of function 'X'"?

    For the other part of the question ("I compiled my SDK several times and always I have the same result when I did make V = 99" and make[1][2][3] errors) you should keep in mind that if during the cross-compilation of the package you got an error, you first need to (obviously) get rid of the error in your source code (main.c in your case) and also (important!) go to /home/rik/client/openwrt/dl and delete [name_of_your_package].tar.gz. For some reason the toolchain fetches the source file ([name_of_your_package].tar.gz) only once and does not overwrite it if you run make package/[name]/compile V=99 even after you changed your source code. I.e. you need to delete that file manually. You got those errors because the toolchain was always trying to compile the very first source code you wrote and of course the result'd be always the same.

    Simply put, the cross-compilation steps are as follows:

    1. run make menuconfig and choose the desired package
    2. run make package/[name]/compile
    3. if(!) you got a compilation error, delete [name_of_your_package].tar.gz from /home/rik/client/openwrt/dl
    4. correct the source code and repeat from step 1.

    That is, every time gcc raises an error, you first need to delete the source fetched by the toolchain before trying to compile again.