• Bug#1107164: /usr/bin/x86_64-linux-gnux32-ld.bfd: /bin/ld: cryptic "err

    From =?utf-8?B?0L3QsNCx?=@21:1/5 to All on Mon Jun 2 17:20:01 2025
    Package: binutils-x86-64-linux-gnux32
    Version: 2.43.90.20250127-1
    Severity: minor
    File: /usr/bin/x86_64-linux-gnux32-ld.bfd

    Dear Maintainer,

    I'd recently been hit with the following error
    $ make
    ...
    /bin/ld: error: could not close arguments file
    collect2: error: ld returned 1 exit status

    This told me approximately exactly nothing.

    Running under strace got me
    [pid 24432] execve("/bin/ld", ["/bin/ld", "-plugin", "/usr/libexec/gcc/x86_64-linux-gn"..., "-plugin-opt=/usr/libexec/gcc/x86"..., "-plugin-opt=-fresolution=/tmp/cc"..., "-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lgcc",
    "-plugin-opt=-pass-through=-lc", "-plugin-opt=-pass-through=-lgcc_"..., "-plugin-opt=-pass-through=-lgcc", "--build-id", "--eh-frame-hdr", "-m", "elf32_x86_64", "--hash-style=gnu", "--as-needed", "-dynamic-linker", "/libx32/ld-linux-x32.so.2",
    "-o", "out/cmd/sha1sum", "/usr/lib/gcc/x86_64-linux-gnux32"..., "/usr/lib/gcc/x86_64-linux-gnux32"..., "/usr/lib/gcc/x86_64-linux-gnux32"..., "-L.", "-L/usr/lib/gcc/x86_64-linux-gnux"..., "-L/usr/lib/gcc/x86_64-linux-gnux"..., "-L/usr/lib/gcc/x86_64-
    linux-gnux"..., "-L/lib/x86_64-linux-gnux32", "-L/lib/../lib", "-L/usr/lib/x86_64-linux-gnux32", "-L/usr/lib/../lib", "-L/usr/lib/gcc/x86_64-linux-gnux"..., ...], 0xffead340 /* 30 vars */) = 0
    ...
    [pid 24432] close(24</usr/lib/x86_64-linux-gnux32/crtn.o>) = 0
    [pid 24432] openat(AT_FDCWD, "/tmp/cctPrR3D.res", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 24</tmp/cctPrR3D.res>
    [pid 24432] fstat(24</tmp/cctPrR3D.res>, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
    [pid 24432] write(24</tmp/cctPrR3D.res>, "1\nout/obj/cmd/sha1sum.o 49\n1403 "..., 2983) = -1 ENOSPC (No space left on device)
    [pid 24432] close(24</tmp/cctPrR3D.res>) = 0
    [pid 24432] access("/tmp", R_OK|W_OK|X_OK) = 0
    [pid 24432] newfstatat(AT_FDCWD, "/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=120, ...}, 0) = 0
    [pid 24432] getrandom("\xb8\xaf\xb3\x9d\x12\x06\x4c\x72", 8, GRND_NONBLOCK) = 8
    [pid 24432] openat(AT_FDCWD, "/tmp/ccKgS4FG.lto_wrapper_args", O_RDWR|O_CREAT|O_EXCL, 0600) = 24</tmp/ccKgS4FG.lto_wrapper_args>
    [pid 24432] close(24</tmp/ccKgS4FG.lto_wrapper_args>) = 0
    [pid 24432] openat(AT_FDCWD, "/tmp/ccKgS4FG.lto_wrapper_args", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 24</tmp/ccKgS4FG.lto_wrapper_args>
    [pid 24432] fstat(24</tmp/ccKgS4FG.lto_wrapper_args>, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
    [pid 24432] write(24</tmp/ccKgS4FG.lto_wrapper_args>, "-fresolution=/tmp/cctPrR3D.res\n-"..., 74) = -1 ENOSPC (No space left on device)
    [pid 24432] close(24</tmp/ccKgS4FG.lto_wrapper_args>) = 0
    [pid 24432] write(2</dev/pts/0>, "/bin/ld", 7/bin/ld) = 7
    [pid 24432] write(2</dev/pts/0>, ": error: could not close argumen"..., 40: error: could not close arguments file
    ) = 40
    [pid 24432] close(3</home/nabijaczleweli/code/voreutils/out/cmd/sha1sum>) = 0
    ...
    [pid 24432] exit_group(1) = ?
    [pid 24432] +++ exited with 1 +++
    [pid 24431] <... wait4 resumed>[{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 24432
    [pid 24431] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=24432, si_uid=0, si_status=1, si_utime=5, si_stime=5} ---
    [pid 24431] write(2</dev/pts/0>, "collect2: error: ld returned 1 e"..., 43collect2: error: ld returned 1 exit status
    ) = 43
    [pid 24431] newfstatat(AT_FDCWD, "/tmp/cc6XoSso.cdtor.c", {st_mode=S_IFREG|0600, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
    [pid 24431] unlink("/tmp/cc6XoSso.cdtor.c") = 0
    [pid 24431] newfstatat(AT_FDCWD, "/tmp/ccUczhfu.cdtor.o", {st_mode=S_IFREG|0600, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
    [pid 24431] unlink("/tmp/ccUczhfu.cdtor.o") = 0
    [pid 24431] exit_group(1) = ?
    [pid 24431] +++ exited with 1 +++

    And indeed
    $ unshare -rm
    # mount -t tmpfs -o size=100k tmpfs /tmp
    # seq inf > /tmp/fill
    seq: write error: No space left on device
    # g++ -g -O3 -pipe -Wall -Wextra -fPIC -fno-math-errno -fno-threadsafe-statics -fvisibility=hidden -MD -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -flto -Wno-missing-field-initializers -DVOREUTILS_LIBGMP -fno-exceptions -fno-rtti -o out/cmd/sha1sum
    out/obj/cmd/sha1sum.o -Wl,--as-needed -L. -lgmpxx -lgmp -lcrypto
    /bin/ld: error: could not close arguments file
    collect2: error: ld returned 1 exit status
    repros this.

    Would be nice if the error showed the error instead of obfuscating it
    for no apparent reason. Had I not known how to pick this out
    out of strace I would've been SOL.

    Best,

    -- System Information:
    Debian Release: trixie/sid
    APT prefers unstable
    APT policy: (500, 'unstable')
    Architecture: x32 (x86_64)
    Foreign Architectures: amd64, i386

    Kernel: Linux 6.7.7-amd64 (SMP w/2 CPU threads; PREEMPT)
    Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_FORCED_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
    Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
    Shell: /bin/sh linked to /usr/bin/dash
    Init: systemd (via /run/systemd/system)
    LSM: AppArmor: enabled

    Versions of packages binutils-x86-64-linux-gnux32 depends on:
    ii binutils-common 2.43.90.20250127-1
    ii libbinutils 2.43.90.20250127-1
    ii libc6 2.40-6
    ii libctf-nobfd0 2.43.90.20250127-1
    ii libctf0 2.43.90.20250127-1
    ii libjansson4 2.14-2+b1
    ii libsframe1 2.43.90.20250127-1
    ii libzstd1 1.5.6+dfsg-2
    ii zlib1g 1:1.3.dfsg+really1.3.1-1+b1

    binutils-x86-64-linux-gnux32 recommends no packages.

    Versions of packages binutils-x86-64-linux-gnux32 suggests:
    pn binutils-doc <none>

    -- no debconf information

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmg9vwMACgkQvP0LAY0m WPFdBA//TT96kriRL6pwYgRgKSNLgx4vQecY71/e3N8JhKhYoYaS4O1OD4UB/KYb vZUcDSmuO4A0CvXuE/tT6MRXS0QEyL5CtGyypN54BPrsHCzETawuCLoBWeDpUOHR fvsGvqgSanyzMG/g8NPr0xrghm2rsU3EhDgKjFAAc+1AGB9KIcTJoAkE51Qd0xTk lYbyaQVXBui3Mqk21iC7A6QaItW34kqyOqIPTOLld9qnlyKaJxizam+SqGd6RJGw smn+d/wcmG6Qg33MFJakEmYnt8DtqjBtX3m53Dtk4wIMtSZ3Vzz4hJRcOyKae76p tXd284q4XOnWL4Z5qvwDA6zSHfrwXGffucV3sGn8oPGcF459+4y66hJY9IdKMnh2 Jo4Y1loJ13yENj/0A0bqgYCVItYmKMdqRMVoFvU67oW7s8Sz2cX2b4jJfZephP9/ iRSQ35kXpZmbqgSXAeozkM+efOt4rueGPjj51TAuvCRWjTnaln3IwuKaNbBsTPOA krUpqL3X7J1vmpn6qT9r9pkBZ765tuCu2Z0NPsiTmmbLs/wGFJuCuwAWMkmZrEQr fF/55g2gp8LZqePQKmtZK/Tc7omxF1sUupPqWaGc56I8aEzOQ4RCMmxSMU7TuvDx omaFKntuu1uS9/30S9qxmUO9XqO63qhGw7TSWUMKb88iP5RgZUU=
    =CPSZ
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)