openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
4.05k stars 3.51k forks source link

utils/flashrom doesn't build on mips due to undefined variables #18

Closed RussellSenior closed 10 years ago

RussellSenior commented 10 years ago
mipsel-openwrt-linux-uclibc-gcc -MMD -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kec -mdsp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float  -I/home/openwrt/src/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include -I/home/openwrt/src/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/include -I/home/openwrt/src/openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/openwrt/src/openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/include  -Werror   -D'CONFIG_DEFAULT_PROGRAMMER=PROGRAMMER_INVALID' -D'CONFIG_INTERNAL=1' -D'CONFIG_SERPROG=1' -D'CONFIG_PONY_SPI=1' -D'CONFIG_BITBANG_SPI=1' -D'CONFIG_GFXNVIDIA=1' -D'CONFIG_SATASII=1' -D'CONFIG_FT2232_SPI=1' -D'CONFIG_USBBLASTER_SPI=1' -D'HAVE_FT232H=1' -D'CONFIG_DUMMY=1' -D'CONFIG_DRKAISER=1' -D'CONFIG_NICINTEL=1' -D'CONFIG_NICINTEL_SPI=1' -D'CONFIG_OGP_SPI=1' -D'CONFIG_BUSPIRATE_SPI=1' -D'CONFIG_LINUX_SPI=1' -D'NEED_PCI=1' -D'HAVE_UTSNAME=1' -D'FLASHROM_VERSION="0.9.7-r1711"' -o internal.o -c internal.c
internal.c: In function 'internal_init':
internal.c:340:52: error: 'cb_vendor' undeclared (first use in this function)
  if (board_flash_enable(board_vendor, board_model, cb_vendor, cb_model)) {
                                                    ^
internal.c:340:52: note: each undeclared identifier is reported only once for each function it appears in
internal.c:340:63: error: 'cb_model' undeclared (first use in this function)
  if (board_flash_enable(board_vendor, board_model, cb_vendor, cb_model)) {
                                                               ^
make[3]: *** [internal.o] Error 1

The cb_vendor and cb_model declarations are ifdef'd to specific architectures, not including mips/mipsel.

#if defined (__i386__) || defined (__x86_64__) || defined (__arm__)
        const char *cb_vendor = NULL;
        const char *cb_model = NULL;
#endif

I have no idea whether flashrom is useful on mips platforms, but it offended me by not building.

Noltari commented 10 years ago

It should be fixed now: https://github.com/openwrt/packages/commit/0bc41a09ae0e9c9957223f139e46514e7ccd642b

Thanks for reporting.