drm/xe: xe_gen_wa_oob: replace program_invocation_short_name
authorDaniel Gomez <da.gomez@samsung.com>
Mon, 24 Feb 2025 06:23:13 +0000 (07:23 +0100)
committerLucas De Marchi <lucas.demarchi@intel.com>
Thu, 27 Feb 2025 19:01:15 +0000 (11:01 -0800)
program_invocation_short_name may not be available in other systems.
Instead, replace it with the argv[0] to pass the executable name.

Fixes build error when program_invocation_short_name is not available:

drivers/gpu/drm/xe/xe_gen_wa_oob.c:34:3: error: use of
undeclared identifier 'program_invocation_short_name'    34 |
program_invocation_short_name);       |                 ^ 1 error
generated.

Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250224-macos-build-support-xe-v3-1-d2c9ed3a27cc@samsung.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_gen_wa_oob.c

index 904cf47925aa1d5bc37983af83232d5e4697c49e..ed9183599e31cc9d76da3f22c9fb3884384a49bc 100644 (file)
        "\n" \
        "#endif\n"
 
-static void print_usage(FILE *f)
+static void print_usage(FILE *f, const char *progname)
 {
        fprintf(f, "usage: %s <input-rule-file> <generated-c-source-file> <generated-c-header-file>\n",
-               program_invocation_short_name);
+               progname);
 }
 
 static void print_parse_error(const char *err_msg, const char *line,
@@ -144,7 +144,7 @@ int main(int argc, const char *argv[])
 
        if (argc < 3) {
                fprintf(stderr, "ERROR: wrong arguments\n");
-               print_usage(stderr);
+               print_usage(stderr, argv[0]);
                return 1;
        }