Skip to content
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

Rebuild libstdc++ with mlongcalls and include it in linker command line #1983

Closed
srwi opened this issue Apr 27, 2016 · 2 comments
Closed

Rebuild libstdc++ with mlongcalls and include it in linker command line #1983

srwi opened this issue Apr 27, 2016 · 2 comments

Comments

@srwi
Copy link

srwi commented Apr 27, 2016

Problem description

The code below gives me a weird linker error. The C++ code itself should be fine so maybe it is caused by some conflict with Arduino-ESP8266 related libraries that I'm not aware of? Are lists not supported on the ESP8266? I am compiling the sketch for the Generic ESP8266 Module.

Sketch

#include <list>

void setup () {
  std::list<int> mylist;
  mylist.push_back(0);
}

void loop() {

}

Error Message

sketch\sketch_apr28a.ino.cpp.o:(.text.setup+0x0): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'

sketch\sketch_apr28a.ino.cpp.o: In function `construct<std::_List_node<int>, int>':

[...]\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\ext/new_allocator.h:120: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'

collect2.exe: error: ld returned 1 exit status

exit status 1

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@igrr
Copy link
Member

igrr commented Apr 28, 2016

We don't link to libstdc++, but this can be addressed once newlib support is finalized and merged in (#1752).

@igrr igrr changed the title list.push_back() causes linker error Rebuild libstdc++ with mlongcalls and include it in linker command line Apr 28, 2016
@igrr igrr added this to the 2.3.0 milestone Apr 28, 2016
@srwi
Copy link
Author

srwi commented Apr 28, 2016

Alright, thanks. Until then I'll be using LinkedList then.

@igrr igrr modified the milestones: 2.3.0, 2.4.0 Jun 3, 2016
@igrr igrr modified the milestones: 2.4.0, 2.3.0 Jun 8, 2016
@igrr igrr closed this as completed Jun 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants