2 Try to get more FILE's on 32bit systems, or limit itself to not cross the limit if it fails
4 --- binutils-2.43.1/bfd/cache.c.orig
5 +++ binutils-2.43.1/bfd/cache.c
8 if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
9 && rlim.rlim_cur != (rlim_t) RLIM_INFINITY)
11 +#if defined(__illumos__) && defined(_ILP32)
13 + * illumos stdio for 32-bit has an ABI-constrained limit that
14 + * the UNIX file descriptor must be 255 or less.
16 + * This can be corrected by enabling extended FILE stdio, which
17 + * we do here if the reported rlimit allows us to do so.
19 + if (rlim.rlim_cur > 256 &&
20 + enable_extended_FILE_stdio(-1, -1) == -1) {
21 + perror("Can't enable extended FILE");
22 + /* Cap it at 250 to not break stdio. */
25 +#endif /* __illumos__ */
26 max = rlim.rlim_cur / 8;