From: Gaius Mulley Date: Fri, 14 Feb 2025 19:17:02 +0000 (+0000) Subject: [PATCH] PR modula2/118761: gm2 driver doesnt behave as gcc for -fhelp=BLA X-Git-Tag: releases/gcc-14.3.0~489 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c38d0a79caef1909df9f51ec8d17c5f8cfecabd;p=thirdparty%2Fgcc.git [PATCH] PR modula2/118761: gm2 driver doesnt behave as gcc for -fhelp=BLA This patch enables the gm2 driver to handle -fsyntax-only -fhelp=optimizers, for example, correctly without terminating with gm2: fatal error: no input files. gcc/m2/ChangeLog: PR modula2/118761 * gm2spec.cc (lang_specific_driver): Add case clauses for OPT__help, OPT__help_ set in_added_libraries to 0 and early return. (cherry picked from commit 3c5422e719d1fbabccaa9b63605171ea8bdfe57e) Signed-off-by: Gaius Mulley --- diff --git a/gcc/m2/gm2spec.cc b/gcc/m2/gm2spec.cc index 2a4dccf8b93..d1fefdcc27c 100644 --- a/gcc/m2/gm2spec.cc +++ b/gcc/m2/gm2spec.cc @@ -576,6 +576,12 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, args[i] |= SKIPOPT; /* We will add the option if it is needed. */ m2_path_name = decoded_options[i].arg; break; + case OPT__help: + case OPT__help_: + /* Let gcc.cc handle this, as it has a really + cool facility for handling --help and --verbose --help. */ + *in_added_libraries = 0; + return; case OPT_I: args[i] |= SKIPOPT; /* We will add the option if it is needed. */ push_back_Ipath (decoded_options[i].arg);