Comments (9)
@igrr how feasible is this?
i took a quick stab at gold
support and found:
--dynconfig
is not supported - not sure how big of a deal this is at linking stage--no-warn-rwx-segments
is not supported - probably minorREGION_ALIAS
linker script function is not supported. a bit annoying, but can be worked around with some linker script changes.
after that i ran into "unsupported ELF machine" error (i was using an amd64 build of gold, so not surpirsing)
from crosstool-ng.
@rojer , gold has no xtensa support yet. It could not process required xtensa-specific relocations until not implemented. It will likely not get it due to very low priority.
from crosstool-ng.
ok, what about lld
? for our app, it's not uncommon for linking to take 5-15 seconds (depending on hardware). fast incremental builds (1 source file change) are important for developer productivity and currently linking is the biggest factor here.
from crosstool-ng.
@rojer , you can refer to LLVM project (but it is not stable yet). Seems LLD is supported for versions greater than esp-15.0.0-20221201. (See espressif/llvm-project#53)
from crosstool-ng.
ok, does this mean that it can be integrated into IDF as an option, or even the default? i'm looking at the toolchain distribution archive and not sure if the xtensa or risc-v variant is included, i only see amd64 and wasm variants (ld64.lld
and wasm-ld
):
[rojer@nbf ~/allterco/esp-idf 5.2.1-s2]$ tar tvf llvm-esp-16.0.0-20230516-linux-amd64.tar.xz | grep 'lld'
lrwxrwxrwx root/root 0 2023-05-17 10:58 esp-clang/bin/ld.lld -> lld
-rwxr-xr-x root/root 5296448 2023-05-17 10:58 esp-clang/bin/lld
lrwxrwxrwx root/root 0 2023-05-17 10:58 esp-clang/bin/lld-link -> lld
lrwxrwxrwx root/root 0 2023-05-17 10:58 esp-clang/bin/wasm-ld -> lld
lrwxrwxrwx root/root 0 2023-05-17 10:58 esp-clang/bin/ld64.lld -> lld
[rojer@nbf ~/allterco/esp-idf 5.2.1-s2]$ tar tvf clang-esp-17.0.1_20240419-x86_64-linux-gnu.tar.xz | grep 'lld'
lrwxrwxrwx root/root 0 2024-04-19 23:27 esp-clang/bin/lld-link -> lld
lrwxrwxrwx root/root 0 2024-04-19 23:27 esp-clang/bin/ld.lld -> lld
-rwxr-xr-x root/root 67654984 2024-04-19 22:54 esp-clang/bin/lld
lrwxrwxrwx root/root 0 2024-04-19 23:27 esp-clang/bin/ld64.lld -> lld
lrwxrwxrwx root/root 0 2024-04-19 23:27 esp-clang/bin/wasm-ld -> lld
from crosstool-ng.
@gerekon PTAL
from crosstool-ng.
@rojer LLD supplied with Espressif Clang toolchain supports Xtensa and RISCV archs, but it has some issues.
- For Xtensa it includes preliminary support and still has some issues with building IDF apps.
- RISCV support comes from the upstream, but again there are some issues with building IDF apps.
Currently we are working on fixing IDF builds with LLD for RISCV chips. Hopefully it will get into the next release.
After that we will start working on issues related to IDF builds with LLD for Xtensa chips.
from crosstool-ng.
@rojer But note, that Xtensa support in Clang itself is not optimal as of now (code size and perf), e.g. direct calls are not implemented yet. espressif/llvm-project#90. So it seems to be early to switch to Clang toolchain completely. May be we can find a way to use LLD with GCC as an option.
from crosstool-ng.
oh yes, clang is hopeless in -Os
mode, 30% bigger code or so last i checked.
what i was hoping for was to compile gcc and link with lld.
ok, thank you for the update, please know that this is eagerly awaited :)
from crosstool-ng.
Related Issues (20)
- Please upload esp-12.2.0 to platformio registry HOT 26
- Add 8.4.0+2021r2-patch3 back to PlatformIO registry HOT 1
- esp-12.2.0_20230208 missing gdb HOT 4
- git clone modules not found `esp-toolchain-bin-wrappers`and `xtensa-dynconfig` HOT 3
- xtensa-esp32s2-elf-gcc: internal compiler error: Segmentation fault signal terminated program cc1 HOT 2
- GH Actions Build HOT 3
- Support for C++20 ranges HOT 7
- fatal error: type_traits: No such file or directory HOT 2
- xtensa-esp-elf: how to influence endianness ? HOT 4
- 我使用Arduion编译Esp32项目时出错,换用2.0.11\2.0.12\2.0.14\3.0.0 Alpha版本的库和多个IDE版本均报错"\bits\allocator.h:46:10: fatal error: bits/c++allocator.h: No such file or directory" HOT 2
- xtensa: Size optimization regression between GCC 8.4.0 and 13.2.0 HOT 21
- Assembly code macros not working HOT 11
- Build error on google colab HOT 1
- Possible bug in xtensa-esp32-elf-g++ (crosstool-NG esp-2021r2-patch5) 8.4.0 HOT 9
- Update platformio toolchain package registry with latest releases HOT 1
- Linker from esp-13.2.0-20230928 cannot locate objects or libraries that are specified with absolute paths HOT 3
- Bizarre GCC ICE in IRA RTL pass on 13.2.0 (20230928) and 13.2.0 (20240530) with -Os/Og/O1/O2/O3 HOT 1
- [Feature Request] Update version in PlatformIO registry HOT 1
- Support for Windows ARM64
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crosstool-ng.