mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Adding -fstrict-volatile-bitfields to the CFLAGS/CXXFLAGS. Without this, gcc tries to access bitfields using the smallest possible methods (eg l8i to
grab an 8-bit field from a 32-bit). Our hardware does not like that. This flag tells gcc that if a bitfield is volatile, it should always use the type the field is defined at (uint32_t in our case) to size its access to the field. This fixes accessing the hardware through the xxx_struct.h headers.
This commit is contained in:
parent
489b4f31a9
commit
f703acd344
@ -158,13 +158,14 @@ LDFLAGS ?= -nostdlib \
|
||||
# files, set CFLAGS += in your component's Makefile.projbuild
|
||||
|
||||
# CPPFLAGS used by an compile pass that uses the C preprocessor
|
||||
CPPFLAGS = -DESP_PLATFORM -Og -g3 -Wpointer-arith -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wall -ffunction-sections -fdata-sections -mlongcalls -nostdlib -MMD -MP
|
||||
CPPFLAGS = -DESP_PLATFORM -Og -g3 -Wpointer-arith -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable \
|
||||
-Wno-error=unused-variable -Wall -ffunction-sections -fdata-sections -mlongcalls -nostdlib -MMD -MP
|
||||
|
||||
# C flags use by C only
|
||||
CFLAGS = $(CPPFLAGS) -std=gnu99 -g3 -fno-inline-functions
|
||||
CFLAGS = $(CPPFLAGS) -std=gnu99 -g3 -fstrict-volatile-bitfields
|
||||
|
||||
# CXXFLAGS uses by C++ only
|
||||
CXXFLAGS = $(CPPFLAGS) -Og -std=gnu++11 -g3 -fno-exceptions
|
||||
CXXFLAGS = $(CPPFLAGS) -Og -std=gnu++11 -g3 -fno-exceptions -fstrict-volatile-bitfields
|
||||
|
||||
export CFLAGS CPPFLAGS CXXFLAGS
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user