aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2025-07-28 23:00:26 +0200
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2025-07-28 23:00:26 +0200
commit89ccd18ef6ed3e7146ea4b1b89815c907caefa08 (patch)
tree784b61aabc8271a07dd65d18f617276f74bae51f
parent0937ed3f05058dd3b10aa014f0d3139146bc1b08 (diff)
downloadbinutils-89ccd18ef6ed3e7146ea4b1b89815c907caefa08.zip
binutils-89ccd18ef6ed3e7146ea4b1b89815c907caefa08.tar.gz
binutils-89ccd18ef6ed3e7146ea4b1b89815c907caefa08.tar.bz2
ld: testsuite: Fix "PR ld/28138 (build only)" on Solaris
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. To avoid this, I've raised the limit to 25, hoping that this will be enough on more targets. Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu. 2025-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> ld: * testsuite/ld-plugin/lto.exp (PR ld/28138 test): Raise fd limit to 25.
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/testsuite/ld-plugin/lto.exp2
2 files changed, 6 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index d4a0588..37c745a 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,10 @@
2025-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+ * testsuite/ld-plugin/lto.exp (PR ld/28138 test): Raise fd limit
+ to 25.
+
+2025-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
* testsuite/ld-elf/indirect.exp (Run with libpr19553c.so):
Skip on *-*-solaris2*.
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index d68e5f4..9ac3cf6 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -1009,7 +1009,7 @@ run_cc_link_tests [list \
set board_flags [get_board_flags]
set exec_output [run_host_cmd "sh" \
- "-c \"ulimit -n 20; \
+ "-c \"ulimit -n 25; \
$CC_FOR_TARGET $gcc_B_opt $CFLAGS_FOR_TARGET \
$board_flags $ld_L_opt -o tmpdir/pr28138 \
tmpdir/pr28138.o tmpdir/pr28138.a\""]