-
Notifications
You must be signed in to change notification settings - Fork 22
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
[Xtensa] Add LLD linker support (LLVM-143) #53
Conversation
d681adf
to
9574ba4
Compare
Source of the relocations: espressif/binutils-gdb@30ce8e4
Updated. I've added a lot more relocations and it is now a lot closer to link the hello_world example. The only issue remaining (I hope!) is a difference in behavior between GCC and Clang: https://godbolt.org/z/1frb731E6 (with |
Yes, I faced the same issue when cmake compiled test program during config phase. It used simple C++ programs compiled with clang++. |
Just a clarification to my comment above... /* Espressif toolcahin uses newlib. crt0.o from it refers to 'main' symbol.
In 'freestanding' mode 'main' is not marked as special symbol by clang,
so when compiling C++ program with 'clang++' 'main' gets mmangled
(if not decalred as 'extern "C"' ) and linker can not resolve it.
The problem can happen, for example, when cmake checks C++ compiler by buiding simple C++ code,
unfortunately 'main' function in that code is not decalred as 'extern "C"'. */ |
Hi @aykevl, I recently tried a custom rust build with this LLD enabled. Unfortunately, I ran into some issue trying to link our bare metal Rust Xtensa projects (not esp-idf). The link failed with the following output:
|
Hi @aykevl Thanks a lot for your help! |
This is probably not complete and there's a good chance there are bugs. But it works for me to link TinyGo programs.
I wanted to try using it for an esp-idf project but wasn't sure how to hook LLVM ld.lld into the esp-idf build system.
TODO:
Fixes #11