Giter Site home page Giter Site logo

Comments (9)

rojer avatar rojer commented on July 25, 2024

@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 minor
  • REGION_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.

Lapshin avatar Lapshin commented on July 25, 2024

@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.

rojer avatar rojer commented on July 25, 2024

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.

Lapshin avatar Lapshin commented on July 25, 2024

@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.

rojer avatar rojer commented on July 25, 2024

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.

Lapshin avatar Lapshin commented on July 25, 2024

@gerekon PTAL

from crosstool-ng.

gerekon avatar gerekon commented on July 25, 2024

@rojer LLD supplied with Espressif Clang toolchain supports Xtensa and RISCV archs, but it has some issues.

  1. For Xtensa it includes preliminary support and still has some issues with building IDF apps.
  2. 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.

gerekon avatar gerekon commented on July 25, 2024

@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.

rojer avatar rojer commented on July 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.