Subject: Re: bug#74453: running make failed when perl is installed in the very long path

From: Bruno Haible <[email-masked]>
Date: Tue, 26 Nov 2024 10:52:01 +0100

Nick Bowler wrote:
> The Linux program loader expects to find a newline in the first 128
> bytes of the file (increased to 256 in recent versions), otherwise
> you will get an ENOEXEC error from execve.

My testing indicates:

The first line which specifies the interpreter and interpreter args is limited in length:
  - max. 253 characters on Linux
  - max. 513 characters on macOS
  - max. 1025 characters on NetBSD
  - max. 125 characters on OpenBSD
  - max. 1022 characters on AIX
  - max. 1021 characters on Solaris
On Linux and AIX, characters exceeding this limit are simply cut off by the system.
On macOS, NetBSD, OpenBSD, and Solaris, the script is not executed at all if this line is too long.

Bruno