earlephilhower / esp-quick-toolchain

GCC toolchain for esp8266/arduino on MacOS, Linux, ARM64, Raspberry Pi, and Windows
87 stars 24 forks source link

Makefile: instruct GCC to perform more aggressive optimization #24

Closed jjsuwa-sys3175 closed 3 years ago

jjsuwa-sys3175 commented 3 years ago

see https://github.com/arendst/Tasmota/pull/9749 and https://github.com/arendst/Tasmota/commit/e7cff928eef1f875819430f98e2b896b16b05b9b.

earlephilhower commented 3 years ago

@jjsuwa-sys3175 I was wondering if these make any difference in this specific build?

We don't do any final links in the toolchain. We just compile object files and then combine them into a .a in a non-GCC step.

My reading of the gcc man pages leads me to believe these are done only during a linking pass (and thus won't be executed here)...

jjsuwa-sys3175 commented 3 years ago

CFLAGS_FOR_TARGET / CXXFLAGS_FOR_TARGET envvals affect compiling target (Xtensa) libraries indeed.

as an example, here it is diff -u3 of objdump -d libgcc.a between without -free -fipa-pta and with ones; a few insns are eliminated.