Skip to content

commit #7611 breaks compiler optimisation #7698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task
5chufti opened this issue Nov 9, 2020 · 4 comments
Closed
1 task

commit #7611 breaks compiler optimisation #7698

5chufti opened this issue Nov 9, 2020 · 4 comments
Labels
waiting for feedback Waiting on additional info. If it's not received, the issue may be closed.

Comments

@5chufti
Copy link
Contributor

5chufti commented Nov 9, 2020

Basic Infos

  • [x ] This issue complies with the issue POLICY doc.
  • [x ] I have read the documentation at readthedocs and the issue is not addressed there.
  • [x ] I have tested that the issue is present in current master branch (aka latest git).
  • [x ] I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • [x ] I have filled out all fields below.

Platform

  • Hardware: []
  • Core Version: [latest git]
  • Development Env: [Arduino IDE]
  • Operating System: [Windows]

Settings in IDE

  • Module: [Generic ESP8266 Module]
  • Flash Mode: [dout]
  • Flash Size: [1MB]
  • lwip Variant: [v2 Lower Memory]
  • Reset Method: [nodemcu]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [80Mhz]
  • Upload Using: [SERIAL]
  • Upload Speed: [115200] (serial upload only)

Problem Description

referenced commmit breaks use of any optimisation above -Os
at link time there are curious missing symbols ...

MCVE Sketch

void setup() {
  Serial.begin(74880); 
  pinMode(LED_BUILTIN, OUTPUT);
  while (!Serial) ; // wait for Arduino Serial Monitor
}

void loop() {
    digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
    delay(500);
}

Debug Messages

Linking everything together...
"D:\\arduino\\portable\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.0-gnu12/bin/xtensa-lx106-elf-gcc" -CC -E -P -DVTABLES_IN_FLASH "D:\\arduino\\portable\\packages\\esp8266\\hardware\\esp8266\\3.0.0/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "C:\\Users\\me\\AppData\\Local\\Temp\\arduino_build_74451/local.eagle.app.v6.common.ld"
"D:\\arduino\\portable\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\3.0.0-gnu12/bin/xtensa-lx106-elf-gcc" -fno-exceptions -Wl,-Map "-Wl,C:\\Users\\me\\AppData\\Local\\Temp\\arduino_build_74451/sketch_nov09a.ino.map" -O3 -g -Wall -Wextra -nostdlib -Wl,--no-check-sections -u app_entry -u _printf_float -u _scanf_float -Wl,-static "-LD:\\arduino\\portable\\packages\\esp8266\\hardware\\esp8266\\3.0.0/tools/sdk/lib" "-LD:\\arduino\\portable\\packages\\esp8266\\hardware\\esp8266\\3.0.0/tools/sdk/lib/NONOSDK22x_191122" "-LD:\\arduino\\portable\\packages\\esp8266\\hardware\\esp8266\\3.0.0/tools/sdk/ld" "-LD:\\arduino\\portable\\packages\\esp8266\\hardware\\esp8266\\3.0.0/tools/sdk/libc/xtensa-lx106-elf/lib" -Teagle.flash.1m.ld -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read -o "C:\\Users\\me\\AppData\\Local\\Temp\\arduino_build_74451/sketch_nov09a.ino.elf" -Wl,--start-group "C:\\Users\\me\\AppData\\Local\\Temp\\arduino_build_74451\\sketch\\sketch_nov09a.ino.cpp.o" "C:\\Users\\me\\AppData\\Local\\Temp\\arduino_build_74451\\core\\core.a" -lhal -lphy -lpp -lnet80211 -llwip2-536 -lwpa -lcrypto -lmain -lwps -lbearssl -lespnow -lsmartconfig -lairkiss -lwpa2 -lstdc++ -lm -lc -lgcc -Wl,--end-group "-LC:\\Users\\me\\AppData\\Local\\Temp\\arduino_build_74451"
d:/arduino/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.0-gnu12/bin/../lib/gcc/xtensa-lx106-elf/10.1.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\me\AppData\Local\Temp\arduino_build_74451\core\core.a(Stream.cpp.o):(.text._ZN6Stream10readStringEv+0x4): undefined reference to `_ZN6String4initEv'
d:/arduino/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.0-gnu12/bin/../lib/gcc/xtensa-lx106-elf/10.1.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\me\AppData\Local\Temp\arduino_build_74451\core\core.a(Stream.cpp.o):(.text._ZN6Stream10readStringEv+0x1b): undefined reference to `_ZN6String4initEv'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Generic ESP8266 Module.
@mcspr
Copy link
Collaborator

mcspr commented Nov 9, 2020

Does it build after removing inline keyword here?

inline void String::init(void) {

addendum: #7553 should actually fix this, but it is in a review limbo atm :(
Right now GCC just removes the String::init() symbol from the WString.cpp.o, since it is marked as inline

@5chufti
Copy link
Contributor Author

5chufti commented Nov 9, 2020

yes, removing the "inline" seems to fix the issue.

@earlephilhower
Copy link
Collaborator

@5chufti can you please verify if #7553 (already merged) w/o any changes fixes your issue and report back?

@earlephilhower earlephilhower added the waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. label Nov 20, 2020
@5chufti
Copy link
Contributor Author

5chufti commented Nov 22, 2020

Hi, issue seems resolved with current git version.
So closing issue ...

@5chufti 5chufti closed this as completed Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Waiting on additional info. If it's not received, the issue may be closed.
Projects
None yet
Development

No branches or pull requests

3 participants