sys_stdio_mphal.c compile failure?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
gojimmypi
Posts: 36
Joined: Wed Mar 02, 2016 8:01 pm
Contact:

sys_stdio_mphal.c compile failure?

Post by gojimmypi » Mon Jun 19, 2017 5:33 pm

Greetings. The last few days, I've had a problem compiling; the problem seems to be with recent changes to sys_stdio_mphal - in particular as related to the #if MICROPY_PY_SYS_STDIO_BUFFER

I'm building on Ubuntu with all the latest code, tool and library updates as described here:

viewtopic.php?f=16&t=1720&hilit=gojimmypi

Does anyone else have this problem? Should I open a GitHub issue? (sorry I didn't take time to propose fix)

Thanks

Code: Select all

$ make V=1
python ../py/makeversionhdr.py build/genhdr/mpversion.h
CC ../lib/utils/sys_stdio_mphal.c
xtensa-lx106-elf-gcc -I../lib/berkeley-db-1.xx/PORT/include -I. -I.. -I../stmhal -Ibuild -I/home/gojimmypi/workspace/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include -Wall -Wpointer-arith -Werror -std=gnu99 -nostdlib -DUART_OS=0 -fsingle-precision-constant -Wdouble-promotion -D__ets__ -DICACHE_FLASH -fno-inline-functions -Wl,-EL -mlongcalls -mtext-section-literals -mforce-l32 -DLWIP_OPEN_SRC -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -DMICROPY_PY_USSL=1 -DMICROPY_SSL_AXTLS=1 -I../lib/axtls/ssl -I../lib/axtls/crypto -I../lib/axtls/config -D__DBINTERFACE_PRIVATE=1 -Dmpool_error=printf -Dabort=abort_ -Dvirt_fd_t=mp_obj_t "-DVIRT_FD_T_HEADER=<py/obj.h>" -DMICROPY_PY_BTREE=1 -Os -DNDEBUG  -fdata-sections -ffunction-sections -c -MD -o build/lib/utils/sys_stdio_mphal.o ../lib/utils/sys_stdio_mphal.c
In file included from ../lib/utils/sys_stdio_mphal.c:30:0:
../lib/utils/sys_stdio_mphal.c:97:19: error: 'MP_QSTR_buffer' undeclared here (not in a function)
     { MP_ROM_QSTR(MP_QSTR_buffer), MP_ROM_PTR(&stdio_buffer_obj) },
                   ^
../py/obj.h:163:56: note: in definition of macro 'MP_OBJ_NEW_QSTR'
 #define MP_OBJ_NEW_QSTR(qst) ((mp_obj_t)((((mp_uint_t)(qst)) << 3) | 0x00000006))
                                                        ^
../lib/utils/sys_stdio_mphal.c:97:7: note: in expansion of macro 'MP_ROM_QSTR'
     { MP_ROM_QSTR(MP_QSTR_buffer), MP_ROM_PTR(&stdio_buffer_obj) },
       ^
../py/mkrules.mk:47: recipe for target 'build/lib/utils/sys_stdio_mphal.o' failed
make: *** [build/lib/utils/sys_stdio_mphal.o] Error 1

stijn
Posts: 366
Joined: Thu Apr 24, 2014 9:13 am

Re: sys_stdio_mphal.c compile failure?

Post by stijn » Mon Jun 19, 2017 6:09 pm

Did you rebuild instead of just build? Missing qstr errors are more often than not due to https://github.com/micropython/micropython/issues/2982 and related issues

gojimmypi
Posts: 36
Joined: Wed Mar 02, 2016 8:01 pm
Contact:

Re: sys_stdio_mphal.c compile failure?

Post by gojimmypi » Mon Jun 19, 2017 6:34 pm

hmm... interesting.

well, indeed if I comment out the MICROPY_PY_SYS_STDIO_BUFFER in mpconfigport.h it successfully builds.

and if I put it back and do another make (no make clean) - the error returns.

I'm fairly certain I've fetched fresh code since the April date of the GitHub issue, without seeing this problem.

Thanks for the info; I'll add a comment & not create a new issue.

Post Reply