#1014150 gcc-snapshot: unexpected failures with no arguments or with -v

Package:
gcc-snapshot
Source:
gcc-snapshot
Description:
SNAPSHOT of the GNU Compiler Collection
Submitter:
Vincent Lefevre
Date:
2025-11-28 15:29:01 UTC
Severity:
normal
#1014150#5
Date:
2022-07-01 00:34:17 UTC
From:
To:
"gcc-snapshot" without any argument fails in a strange way:

$ gcc-snapshot
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

Compare with gcc-12:

$ gcc-12
gcc-12: fatal error: no input files
compilation terminated.

And "gcc-snapshot -v" also fails with the same error (which may
trigger a failure in scripts that use this option).

#1014150#10
Date:
2025-11-28 15:27:58 UTC
From:
To:
Control: retitle -1 gcc-snapshot: incorrect error message with -Wl options and no input files
Control: found -1 1:20251111-1

I forgot that this was a script inspired by the one given at
  /usr/share/doc/gcc-snapshot/README.Debian

So this is reproducible with any gcc version, I think.
For instance:

$ gcc-15 -Wl,-rpath -Wl,$HOME/lib
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/15/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status

The arguments are not input files, so that this error message is
unexpected.