Is it safe to build v4.3 or earlier versions using the 2021r1 gcc?
Posted: Mon Jun 28, 2021 6:57 am
Hi,
I notice recent esp-idf update includes a new toolchain: esp-2021r1.
If I build esp-idf master with esp-2020r3, I got compile error:
/home/axel/esp/esp-idf/components/newlib/locks.c:240:23: error: invalid application of 'sizeof' to incomplete type 'struct __lock'
_Static_assert(sizeof(struct __lock) >= sizeof(StaticSemaphore_t),
^~~~~~
/home/axel/esp/esp-idf/components/newlib/locks.c:240:16: error: expression in static assertion is not an integer
_Static_assert(sizeof(struct __lock) >= sizeof(StaticSemaphore_t),
^~~~~~
/home/axel/esp/esp-idf/components/newlib/locks.c: In function '__retarget_lock_init':
/home/axel/esp/esp-idf/components/newlib/locks.c:286:11: warning: assignment to '_LOCK_T' {aka 'int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
*lock = NULL; /* In case lock's memory is uninitialized */
^
/home/axel/esp/esp-idf/components/newlib/locks.c: In function '__retarget_lock_init_recursive':
/home/axel/esp/esp-idf/components/newlib/locks.c:292:11: warning: assignment to '_LOCK_T' {aka 'int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
*lock = NULL; /* In case lock's memory is uninitialized */
^
In file included from ../../../../../components/esp_common/include/esp_err.h:18,
from ../../../../../components/hal/include/hal/cpu_hal.h:20,
from ../../../../../components/esp_hw_support/include/esp_cpu.h:22,
from ../../../../../components/esp_hw_support/include/soc/cpu.h:22,
from /home/axel/esp/esp-idf/components/newlib/locks.c:19:
/home/axel/esp/esp-idf/components/newlib/locks.c: In function 'check_lock_nonzero':
/home/axel/esp/esp-idf/components/newlib/locks.c:309:17: warning: comparison between pointer and integer
assert(lock != NULL && "Uninitialized lock used");
^~
../../../../../components/newlib/platform_include/assert.h:44:42: note: in definition of macro 'assert'
#define assert(__e) (__builtin_expect(!!(__e), 1) ? (void)0 : __assert_func (__FILE__, __LINE__, \
^~~
[560/987] Building C object esp-idf/freertos/CMakeFiles/__idf_freertos.dir/tasks.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
So I have no choice but to upgrade to esp-2021r1.
I use git to switch branches and it's not clear to me about the toolchain version v.s. esp-idf version.
My question is "Is it safe to use esp-2021r1 to build other branches? e.g. v4.3 or v4.2".
What is fixed in esp-2021r1? I cannot find release note for the toolchain update.
I notice recent esp-idf update includes a new toolchain: esp-2021r1.
If I build esp-idf master with esp-2020r3, I got compile error:
/home/axel/esp/esp-idf/components/newlib/locks.c:240:23: error: invalid application of 'sizeof' to incomplete type 'struct __lock'
_Static_assert(sizeof(struct __lock) >= sizeof(StaticSemaphore_t),
^~~~~~
/home/axel/esp/esp-idf/components/newlib/locks.c:240:16: error: expression in static assertion is not an integer
_Static_assert(sizeof(struct __lock) >= sizeof(StaticSemaphore_t),
^~~~~~
/home/axel/esp/esp-idf/components/newlib/locks.c: In function '__retarget_lock_init':
/home/axel/esp/esp-idf/components/newlib/locks.c:286:11: warning: assignment to '_LOCK_T' {aka 'int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
*lock = NULL; /* In case lock's memory is uninitialized */
^
/home/axel/esp/esp-idf/components/newlib/locks.c: In function '__retarget_lock_init_recursive':
/home/axel/esp/esp-idf/components/newlib/locks.c:292:11: warning: assignment to '_LOCK_T' {aka 'int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
*lock = NULL; /* In case lock's memory is uninitialized */
^
In file included from ../../../../../components/esp_common/include/esp_err.h:18,
from ../../../../../components/hal/include/hal/cpu_hal.h:20,
from ../../../../../components/esp_hw_support/include/esp_cpu.h:22,
from ../../../../../components/esp_hw_support/include/soc/cpu.h:22,
from /home/axel/esp/esp-idf/components/newlib/locks.c:19:
/home/axel/esp/esp-idf/components/newlib/locks.c: In function 'check_lock_nonzero':
/home/axel/esp/esp-idf/components/newlib/locks.c:309:17: warning: comparison between pointer and integer
assert(lock != NULL && "Uninitialized lock used");
^~
../../../../../components/newlib/platform_include/assert.h:44:42: note: in definition of macro 'assert'
#define assert(__e) (__builtin_expect(!!(__e), 1) ? (void)0 : __assert_func (__FILE__, __LINE__, \
^~~
[560/987] Building C object esp-idf/freertos/CMakeFiles/__idf_freertos.dir/tasks.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
So I have no choice but to upgrade to esp-2021r1.
I use git to switch branches and it's not clear to me about the toolchain version v.s. esp-idf version.
My question is "Is it safe to use esp-2021r1 to build other branches? e.g. v4.3 or v4.2".
What is fixed in esp-2021r1? I cannot find release note for the toolchain update.