8000 Switch to isolated build flags per framework (#1748) · ramante/arduino-esp32@fff1783 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fff1783

Browse files
ivankravetsme-no-dev
authored andcommitted
Switch to isolated build flags per framework (espressif#1748)
1 parent cb53ec4 commit fff1783

File tree

1 file changed

+53
-23
lines changed

1 file changed

+53
-23
lines changed

tools/platformio-build.py

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,25 @@
3434
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32")
3535
assert isdir(FRAMEWORK_DIR)
3636

37-
env.Prepend(
38-
CPPDEFINES=[
39-
("ARDUINO", 10805),
40-
"ARDUINO_ARCH_ESP32",
41-
("ARDUINO_VARIANT", '\\"%s\\"' % env.BoardConfig().get("build.variant").replace('"', "")),
42-
("ARDUINO_BOARD", '\\"%s\\"' % env.BoardConfig().get("name").replace('"', ""))
43-
],
37+
env.Append(
38+
ASFLAGS=["-x", "assembler-with-cpp"],
4439

45-
CFLAGS=["-Wno-old-style-declaration"],
40+
CFLAGS=[
41+
"-std=gnu99",
42+
"-Wno-old-style-declaration"
43+
],
4644

4745
CCFLAGS=[
46+
"-Os",
47+
"-Wall",
48+
"-nostdlib",
49+
"-Wpointer-arith",
50+
"-Wno-error=unused-but-set-variable",
51+
"-Wno-error=unused-variable",
52+
"-mlongcalls&q 8000 uot;,
53+
"-ffunction-sections",
54+
"-fdata-sections",
55+
"-fstrict-volatile-bitfields",
4856
"-Wno-error=deprecated-declarations",
4957
"-Wno-error=unused-function",
5058
"-Wno-unused-parameter",
@@ -53,6 +61,40 @@
5361
"-fexceptions"
5462
],
5563

64+
CXXFLAGS=[
65+
"-fno-rtti",
66+
"-fno-exceptions",
67+
"-std=gnu++11"
68+
],
69+
70+
LINKFLAGS=[
71+
"-nostdlib",
72+
"-Wl,-static",
73+
"-u", "call_user_start_cpu0",
74+
"-Wl,--undefined=uxTopUsedPriority",
75+
"-Wl,--gc-sections",
76+
"-Wl,-EL",
77+
"-T", "esp32.common.ld",
78+
"-T", "esp32.rom.ld",
79+
"-T", "esp32.peripherals.ld",
80+
"-T", "esp32.rom.spiram_incompatible_fns.ld",
81+
"-u", "ld_include_panic_highint_hdl",
82+
"-u", "__cxa_guard_dummy",
83+
"-u", "__cxx_fatal_exception"
84+
],
85+
86+
CPPDEFINES=[
87+
"ESP32",
88+
"ESP_PLATFORM",
89+
("F_CPU", "$BOARD_F_CPU"),
90+
"HAVE_CONFIG_H",
91+
("MBEDTLS_CONFIG_FILE", '\\"mbedtls/esp_config.h\\"'),
92+
("ARDUINO", 10805),
93+
"ARDUINO_ARCH_ESP32",
94+
("ARDUINO_VARIANT", '\\"%s\\"' % env.BoardConfig().get("build.variant").replace('"', "")),
95+
("ARDUINO_BOARD", '\\"%s\\"' % env.BoardConfig().get("name").replace('"', ""))
96+
],
97+
5698
CPPPATH=[
5799
join(FRAMEWORK_DIR, "tools", "sdk", "include", "config"),
58100
join(FRAMEWORK_DIR, "tools", "sdk", "include", "bluedroid"),
@@ -98,32 +140,20 @@
98140
join(FRAMEWORK_DIR, "tools", "sdk", "include", "wpa_supplicant"),
99141
join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core"))
100142
],
143+
101144
LIBPATH=[
102145
join(FRAMEWORK_DIR, "tools", "sdk", "lib"),
103146
join(FRAMEWORK_DIR, "tools", "sdk", "ld")
104147
],
148+
105149
LIBS=[
106150
"gcc", "openssl", "btdm_app", "fatfs", "wps", "coexist", "wear_levelling", "esp_http_client", "hal", "newlib", "driver", "bootloader_support", "pp", "mesh", "smartconfig", "jsmn", "wpa", "ethernet", "phy", "app_trace", "console", "ulp", "wpa_supplicant", "freertos", "bt", "micro-ecc", "cxx", "xtensa-debug-module", "mdns", "vfs", "soc", "core", "sdmmc", "coap", "tcpip_adapter", "c_nano", "esp-tls", "rtc", "spi_flash", "wpa2", "esp32", "app_update", "nghttp", "spiffs", "espnow", "nvs_flash", "esp_adc_cal", "log", "smartconfig_ack", "expat", "m", "c", "heap", "mbedtls", "lwip", "net80211", "pthread", "json", "stdc++"
107-
]
108-
)
109-
151+
],
110152

111-
env.Append(
112153
LIBSOURCE_DIRS=[
113154
join(FRAMEWORK_DIR, "libraries")
114155
],
115156

116-
LINKFLAGS=[
117-
"-Wl,-EL",
118-
"-T", "esp32.common.ld",
119-
"-T", "esp32.rom.ld",
120-
"-T", "esp32.peripherals.ld",
121-
"-T", "esp32.rom.spiram_incompatible_fns.ld",
122-
"-u", "ld_include_panic_highint_hdl",
123-
"-u", "__cxa_guard_dummy",
124-
"-u", "__cxx_fatal_exception"
125-
],
126-
127157
FLASH_EXTRA_IMAGES=[
128158
("0x1000", join(FRAMEWORK_DIR, "tools", "sdk", "bin", "bootloader_${BOARD_FLASH_MODE}_${__get_board_f_flash(__env__)}.bin")),
129159
("0x8000", join(env.subst("$BUILD_DIR"), "partitions.bin")),

0 commit comments

Comments
 (0)
0