Skip to content

Response files are used whenever the command line length exceeds 64K characters #132183

Open
@Morilli

Description

@Morilli

I just ran into an issue where linking a program failed because ld.musl-clang, the link script, was called from clang with a response file instead of all individual arguments directly. The script was not able to handle this and caused compilation failure.

I have tried to find documentation on when response files are used and whether it's possible to configure them in any way, but I was unsuccessful. Looking at the source code, I see that on unix-like systems the command line length seems to get limited to 64 * 1024 = 65536 characters before a response file is used, regardless of what size the system can actually support. This feels very unintuitive to me, as I would expect response files to only be used once the system limit for command line length is reached.

Please correct me if I'm wrong, but as far as I can see there is no way for a user to toggle response file support (via a commandline flag for example) or set the maximum command line length that is allowed before response files are used (like xargs -s).

Would it be possible to either make response file usage optional or allow configuring the maximum command line length before response files are used? Alternatively, the code should not limit command line length to 65536 characters and instead use the full system limit (divided by 2 if you will).

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