driver: fix -gz=none error message with missing zstd

Message ID 44ab2b97-f77c-ae8b-c701-593839c99197@suse.cz
State Committed
Commit 1d77bfdf11fb9d7f9fcce7ed8817fc2877b3ded2
Headers
Series driver: fix -gz=none error message with missing zstd |

Commit Message

Martin Liška Jan. 27, 2023, 1:59 p.m. UTC
  We wrongly report:

$ echo "int main () {}" | gcc -xc -gz=none -
gcc: error: -gz=zstd is not supported in this configuration

if zstd compression is not supported by binutils. We should emit the
error message only if -gz=zstd.

	PR driver/108572

Ready to be installed?
Thanks,
Martin

gcc/ChangeLog:

	* gcc.cc (LINK_COMPRESS_DEBUG_SPEC): Report error only for
	-gz=zstd.
---
 gcc/gcc.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Joseph Myers Jan. 27, 2023, 9:01 p.m. UTC | #1
On Fri, 27 Jan 2023, Martin Liška wrote:

> We wrongly report:
> 
> $ echo "int main () {}" | gcc -xc -gz=none -
> gcc: error: -gz=zstd is not supported in this configuration
> 
> if zstd compression is not supported by binutils. We should emit the
> error message only if -gz=zstd.
> 
> 	PR driver/108572
> 
> Ready to be installed?
> Thanks,
> Martin
> 
> gcc/ChangeLog:
> 
> 	* gcc.cc (LINK_COMPRESS_DEBUG_SPEC): Report error only for
> 	-gz=zstd.

OK.
  

Patch

diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index d8130024a8c..becc56051a8 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -842,7 +842,7 @@  proper position among the other output files.  */
 #define LINK_COMPRESS_DEBUG_SPEC \
 	" %{gz|gz=zlib:"  LD_COMPRESS_DEBUG_OPTION "=zlib}" \
 	" %{gz=none:"	  LD_COMPRESS_DEBUG_OPTION "=none}" \
-	" %{gz*:%e-gz=zstd is not supported in this configuration} " \
+	" %{gz=zstd:%e-gz=zstd is not supported in this configuration} " \
 	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
 #elif HAVE_LD_COMPRESS_DEBUG == 2
 /* ELF gABI style and ZSTD.  */