[PATCH] ld: testsuite: Fix "PR ld/28138 (build only)" on Solaris

Jan Beulich jbeulich@suse.com
Mon Jul 28 14:29:46 GMT 2025


On 28.07.2025 15:57, Rainer Orth wrote:
> The
> 
> FAIL: PR ld/28138 (build only)
> 
> test FAILs on Solaris:
> 
> ld/tmpdir/ld/collect-ld: plugin framework: out of file descriptors. Try using fewer objects/archives
> 
> ld/tmpdir/ld/collect-ld: cannot find -lgcc: Too many open files
> [...]
> 
> I found that the test PASSes when using ulimit -n 21 instead of the
> current 20.  Looking with strace/truss, on Linux/i686 the following
> files are opened:
> 
> 301543 openat(AT_FDCWD, "tmpdir/pr28138", O_RDWR|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
> 301543 openat(AT_FDCWD, "/lib/../lib32/crt1.o", O_RDONLY|O_LARGEFILE) = 4
> 301543 openat(AT_FDCWD, "/lib/../lib32/crt1.o", O_RDONLY|O_LARGEFILE) = 5
> 301543 openat(AT_FDCWD, "/lib/../lib32/crti.o", O_RDONLY|O_LARGEFILE) = 5
> 301543 openat(AT_FDCWD, "/lib/../lib32/crti.o", O_RDONLY|O_LARGEFILE) = 6
> 301543 openat(AT_FDCWD, "lib/gcc/i686-pc-linux-gnu/12.1.0/crtbegin.o", O_RDONLY|O_LARGEFILE) = 6
> 301543 openat(AT_FDCWD, "lib/gcc/i686-pc-linux-gnu/12.1.0/crtbegin.o", O_RDONLY|O_LARGEFILE) = 7
> 301543 openat(AT_FDCWD, "tmpdir/pr28138.o", O_RDONLY|O_LARGEFILE) = 7
> 301543 openat(AT_FDCWD, "tmpdir/pr28138.o", O_RDONLY|O_LARGEFILE) = 8
> 301543 openat(AT_FDCWD, "tmpdir/pr28138.a", O_RDONLY|O_LARGEFILE) = 8
> 301543 openat(AT_FDCWD, "tmpdir/pr28138.a", O_RDONLY|O_LARGEFILE) = 9
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-7.o", O_RDONLY|O_LARGEFILE) = 9
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-7.o", O_RDONLY|O_LARGEFILE) = 10
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-6.o", O_RDONLY|O_LARGEFILE) = 10
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-6.o", O_RDONLY|O_LARGEFILE) = 11
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-5.o", O_RDONLY|O_LARGEFILE) = 11
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-5.o", O_RDONLY|O_LARGEFILE) = 12
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-4.o", O_RDONLY|O_LARGEFILE) = 12
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-4.o", O_RDONLY|O_LARGEFILE) = 13
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-3.o", O_RDONLY|O_LARGEFILE) = 13
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-3.o", O_RDONLY|O_LARGEFILE) = 3
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-2.o", O_RDONLY|O_LARGEFILE) = 3
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-2.o", O_RDONLY|O_LARGEFILE) = 4
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-1.o", O_RDONLY|O_LARGEFILE) = 4
> 301543 openat(AT_FDCWD, "tmpdir/pr28138-1.o", O_RDONLY|O_LARGEFILE) = 5
> 
> while on Solaris/i386 there are a couple more:
> 
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138", O_RDWR|O_CREAT|O_TRUNC, 0666) = 4
> 27726:	openat64(AT_FDCWD, "/usr/lib/crt1.o", O_RDONLY)	= 5
> 27726:	openat64(AT_FDCWD, "/usr/lib/crt1.o", O_RDONLY)	= 6
> 27726:	openat64(AT_FDCWD, "lib/gcc/i386-pc-solaris2.11/14.2.0/crtp.o", O_RDONLY) = 6
> 27726:	openat64(AT_FDCWD, "lib/gcc/i386-pc-solaris2.11/14.2.0/crtp.o", O_RDONLY) = 7
> 27726:	openat64(AT_FDCWD, "/usr/lib/crti.o", O_RDONLY)	= 7
> 27726:	openat64(AT_FDCWD, "/usr/lib/crti.o", O_RDONLY)	= 8
> 27726:	openat64(AT_FDCWD, "/usr/lib/values-Xa.o", O_RDONLY) = 8
> 27726:	openat64(AT_FDCWD, "/usr/lib/values-Xa.o", O_RDONLY) = 9
> 27726:	openat64(AT_FDCWD, "/usr/lib/values-xpg6.o", O_RDONLY) = 9
> 27726:	openat64(AT_FDCWD, "/usr/lib/values-xpg6.o", O_RDONLY) = 10
> 27726:	openat64(AT_FDCWD, "lib/gcc/i386-pc-solaris2.11/14.2.0/crtbegin.o", O_RDONLY) = 10
> 27726:	openat64(AT_FDCWD, "lib/gcc/i386-pc-solaris2.11/14.2.0/crtbegin.o", O_RDONLY) = 11
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138.o", O_RDONLY) = 11
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138.o", O_RDONLY) = 12
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138.a", O_RDONLY) = 12
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138.a", O_RDONLY) = 13
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-7.o", O_RDONLY) = 13
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-7.o", O_RDONLY) = 14
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-6.o", O_RDONLY) = 14
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-6.o", O_RDONLY) = 15
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-5.o", O_RDONLY) = 15
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-5.o", O_RDONLY) = 16
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-4.o", O_RDONLY) = 16
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-4.o", O_RDONLY) = 17
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-3.o", O_RDONLY) = 17
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-3.o", O_RDONLY) = 18
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-2.o", O_RDONLY) = 18
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-2.o", O_RDONLY) = 19
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-1.o", O_RDONLY) = 19
> 27726:	openat64(AT_FDCWD, "tmpdir/pr28138-1.o", O_RDONLY) Err#24 EMFILE
> 
> While it seems weird that the same files are opened twice for reading,
> it's no wonder that 20 fds aren't enough on Solaris.

The double opening is odd, but looks to be unrelated to the issue at hand
though?

> To avoid this, I've raised the limit to 25, hoping that this will be
> enough on more targets.

That's okay, yes, but the patch description wants to be non-empty. (The way
you submit patches it remains unclear how the final patch that you mean to
commit would look like.)

Jan


More information about the Binutils mailing list