Skip to content

Enable response files when merging objects on macOS

The comment is no longer accurate: ld on macOS handles response files correctly:

$ ld @<(echo --help)
ld64: For information on command line options please use 'man ld'.

However, the ld that ships with Nixpkgs for macOS does have issues with response files, but those will be fixed when this other pull request merges:

https://github.com/NixOS/nixpkgs/pull/213831

As a precaution I haven't enabled response files for the Linux ld because I haven't yet done a survey of response file support for ld across various Linux distributions.

However, adding response file support for Linux is slightly less urgent anyway since:

  • Linux tends to have higher limits on ARG_MAX than macOS

    On macOS it is at most 1 MiB whereas on Linux it is usually at least 2 MiB

  • Linux permits increasing the ARG_MAX (unlike macOS)

    It's not easy to do (you have to recompile your kernel), but at least it's possible.

Merge request reports