Skip to content

[Rust cargo-first builds] Build the GCC toolchains for Windows with --with-gnu-ld to avoid too-long-command-line linking errors (IDFGH-6187) #7864

@ivmarkov

Description

@ivmarkov

For various reasons which are unavoidable, the Rust builds driven via cargo do generate a very long linker command line, which goes above the 32767 character limit on Windows.

There is an escape hatch we are taking advantage of, which is to supply (most of) the link command-line arguments to the xtensa-esp32-elf-gcc.exe executable in a file. E.g. @F:\\... ...\\linker_args.txt

Unfortunately, when xtensa-esp32-elf-gcc.exe is itself calling the LD executable, it does expand the command line arguments supplied in the @ file, and thus we have the too-long-command-line problem again, but this time further down the process chain.

It seems the above file expansion does not happen, as long as the GCC toolchain for windows is compiled with the --with-gnu-ld flag enabled.

Therefore, we would like to request the GCC toolchains for Windows to always be build with --with-gnu-ld flag enabled.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions