diff --git a/tools/platformio-build-esp32.py b/tools/platformio-build-esp32.py index 6c82fce96ef..2b67e0018ce 100644 --- a/tools/platformio-build-esp32.py +++ b/tools/platformio-build-esp32.py @@ -35,26 +35,34 @@ assert isdir(FRAMEWORK_DIR) env.Append( + # common assembler flags for .s, .S, .asm, etc. ASFLAGS=[ - "-x", "assembler-with-cpp" + "-mlongcalls", + ], + + # .S flags (preprocessor) + ASPPFLAGS=[ + "-x", "assembler-with-cpp", ], + # .c flags CFLAGS=[ - "-mlongcalls", "-Wno-frame-address", "-std=gnu99", "-Wno-old-style-declaration" ], + # .cpp flags CXXFLAGS=[ - "-mlongcalls", "-Wno-frame-address", "-std=gnu++11", "-fexceptions", "-fno-rtti" ], + # common flags for .c & .cpp CCFLAGS=[ + "-mlongcalls", "-ffunction-sections", "-fdata-sections", "-Wno-error=unused-function", diff --git a/tools/platformio-build-esp32c3.py b/tools/platformio-build-esp32c3.py index 26a85a4a879..ed5e3b7401c 100644 --- a/tools/platformio-build-esp32c3.py +++ b/tools/platformio-build-esp32c3.py @@ -35,24 +35,32 @@ assert isdir(FRAMEWORK_DIR) env.Append( + # common assembler flags for .s, .S, .asm, etc. ASFLAGS=[ - "-x", "assembler-with-cpp" + "-march=rv32imc", + ], + + # .S flags + ASPPFLAGS=[ + "-x", "assembler-with-cpp", ], + # .c flags CFLAGS=[ - "-march=rv32imc", "-std=gnu99", "-Wno-old-style-declaration" ], + # .cpp flags CXXFLAGS=[ - "-march=rv32imc", "-std=gnu++11", "-fexceptions", "-fno-rtti" ], + # common flags for .c & .cpp CCFLAGS=[ + "-march=rv32imc", "-ffunction-sections", "-fdata-sections", "-Wno-error=unused-function", @@ -76,8 +84,8 @@ ], LINKFLAGS=[ + "-march=rv32imc", "-nostartfiles", - "-march=rv32imc", "--specs=nosys.specs", "-Wl,--cref", "-Wl,--gc-sections", diff --git a/tools/platformio-build-esp32s2.py b/tools/platformio-build-esp32s2.py index 7fa190bc51b..6377c72c148 100644 --- a/tools/platformio-build-esp32s2.py +++ b/tools/platformio-build-esp32s2.py @@ -35,24 +35,32 @@ assert isdir(FRAMEWORK_DIR) env.Append( + # common assembler flags for .s, .S, .asm, etc. ASFLAGS=[ - "-x", "assembler-with-cpp" + "-mlongcalls", + ], + + # .S flags (preprocessor) + ASPPFLAGS=[ + "-x", "assembler-with-cpp", ], + # .c flags CFLAGS=[ - "-mlongcalls", "-std=gnu99", "-Wno-old-style-declaration" ], + # .cpp flags CXXFLAGS=[ - "-mlongcalls", "-std=gnu++11", "-fexceptions", "-fno-rtti" ], + # common flags for .c & .cpp CCFLAGS=[ + "-mlongcalls", "-ffunction-sections", "-fdata-sections", "-Wno-error=unused-function", diff --git a/tools/platformio-build-esp32s3.py b/tools/platformio-build-esp32s3.py index ca9d6b78740..b3e8fee3b83 100644 --- a/tools/platformio-build-esp32s3.py +++ b/tools/platformio-build-esp32s3.py @@ -35,24 +35,32 @@ assert isdir(FRAMEWORK_DIR) env.Append( + # common assembler flags for .s, .S, .asm, etc. ASFLAGS=[ - "-x", "assembler-with-cpp" + "-mlongcalls", + ], + + # .S flags (preprocessor) + ASPPFLAGS=[ + "-x", "assembler-with-cpp", ], + # .c flags CFLAGS=[ - "-mlongcalls", "-std=gnu99", "-Wno-old-style-declaration" ], + # .cpp flags CXXFLAGS=[ - "-mlongcalls", "-std=gnu++11", "-fexceptions", "-fno-rtti" ], + # common flags for .c & .cpp CCFLAGS=[ + "-mlongcalls", "-ffunction-sections", "-fdata-sections", "-Wno-error=unused-function",