From 14862c4f2cb088c8274f9fb42217784db28856c3 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 25 Aug 2021 08:08:38 +0200 Subject: ortho/gcc: adjust and propagate to all gcc versions the change for #1845 --- src/ortho/gcc/ortho-lang-49.c | 16 ++++++++++++++++ src/ortho/gcc/ortho-lang-5.c | 16 ++++++++++++++++ src/ortho/gcc/ortho-lang-6.c | 16 ++++++++++++++++ src/ortho/gcc/ortho-lang-7.c | 16 ++++++++++++++++ src/ortho/gcc/ortho-lang-8.c | 16 ++++++++++++++++ src/ortho/gcc/ortho-lang-9.c | 2 +- 6 files changed, 81 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ortho/gcc/ortho-lang-49.c b/src/ortho/gcc/ortho-lang-49.c index e8b4f5643..f5586bf41 100644 --- a/src/ortho/gcc/ortho-lang-49.c +++ b/src/ortho/gcc/ortho-lang-49.c @@ -420,6 +420,22 @@ ortho_post_options (const char **pfilename) { if (*pfilename == NULL || strcmp (*pfilename, "-") == 0) *pfilename = "*stdin*"; + else if (aux_base_name == NULL) + { + /* Define auxbase. The default mechanism in toplev.c doesn't + handle extensions longer than 3 characters. */ + char *name = xstrdup (lbasename (*pfilename)); + int len; + + /* Remove extension. */ + for (len = strlen (name) - 1; len > 1; len--) + if (name[len] == '.') + { + name[len] = 0; + break; + } + aux_base_name = name; + } /* Default hook. */ lhd_post_options (pfilename); diff --git a/src/ortho/gcc/ortho-lang-5.c b/src/ortho/gcc/ortho-lang-5.c index 6a3d5cdb8..66233d49e 100644 --- a/src/ortho/gcc/ortho-lang-5.c +++ b/src/ortho/gcc/ortho-lang-5.c @@ -407,6 +407,22 @@ ortho_post_options (const char **pfilename) { if (*pfilename == NULL || strcmp (*pfilename, "-") == 0) *pfilename = "*stdin*"; + else if (aux_base_name == NULL) + { + /* Define auxbase. The default mechanism in toplev.c doesn't + handle extensions longer than 3 characters. */ + char *name = xstrdup (lbasename (*pfilename)); + int len; + + /* Remove extension. */ + for (len = strlen (name) - 1; len > 1; len--) + if (name[len] == '.') + { + name[len] = 0; + break; + } + aux_base_name = name; + } /* Default hook. */ lhd_post_options (pfilename); diff --git a/src/ortho/gcc/ortho-lang-6.c b/src/ortho/gcc/ortho-lang-6.c index d2f15cc51..15649c8ae 100644 --- a/src/ortho/gcc/ortho-lang-6.c +++ b/src/ortho/gcc/ortho-lang-6.c @@ -407,6 +407,22 @@ ortho_post_options (const char **pfilename) { if (*pfilename == NULL || strcmp (*pfilename, "-") == 0) *pfilename = "*stdin*"; + else if (aux_base_name == NULL) + { + /* Define auxbase. The default mechanism in toplev.c doesn't + handle extensions longer than 3 characters. */ + char *name = xstrdup (lbasename (*pfilename)); + int len; + + /* Remove extension. */ + for (len = strlen (name) - 1; len > 1; len--) + if (name[len] == '.') + { + name[len] = 0; + break; + } + aux_base_name = name; + } /* Default hook. */ lhd_post_options (pfilename); diff --git a/src/ortho/gcc/ortho-lang-7.c b/src/ortho/gcc/ortho-lang-7.c index 4600fc602..1bc705298 100644 --- a/src/ortho/gcc/ortho-lang-7.c +++ b/src/ortho/gcc/ortho-lang-7.c @@ -407,6 +407,22 @@ ortho_post_options (const char **pfilename) { if (*pfilename == NULL || strcmp (*pfilename, "-") == 0) *pfilename = "*stdin*"; + else if (aux_base_name == NULL) + { + /* Define auxbase. The default mechanism in toplev.c doesn't + handle extensions longer than 3 characters. */ + char *name = xstrdup (lbasename (*pfilename)); + int len; + + /* Remove extension. */ + for (len = strlen (name) - 1; len > 1; len--) + if (name[len] == '.') + { + name[len] = 0; + break; + } + aux_base_name = name; + } /* Default hook. */ lhd_post_options (pfilename); diff --git a/src/ortho/gcc/ortho-lang-8.c b/src/ortho/gcc/ortho-lang-8.c index f88cea0c1..d710c8b99 100644 --- a/src/ortho/gcc/ortho-lang-8.c +++ b/src/ortho/gcc/ortho-lang-8.c @@ -407,6 +407,22 @@ ortho_post_options (const char **pfilename) { if (*pfilename == NULL || strcmp (*pfilename, "-") == 0) *pfilename = "*stdin*"; + else if (aux_base_name == NULL) + { + /* Define auxbase. The default mechanism in toplev.c doesn't + handle extensions longer than 3 characters. */ + char *name = xstrdup (lbasename (*pfilename)); + int len; + + /* Remove extension. */ + for (len = strlen (name) - 1; len > 1; len--) + if (name[len] == '.') + { + name[len] = 0; + break; + } + aux_base_name = name; + } /* Default hook. */ lhd_post_options (pfilename); diff --git a/src/ortho/gcc/ortho-lang-9.c b/src/ortho/gcc/ortho-lang-9.c index 4059e5ac3..622bd5b38 100644 --- a/src/ortho/gcc/ortho-lang-9.c +++ b/src/ortho/gcc/ortho-lang-9.c @@ -411,7 +411,7 @@ ortho_post_options (const char **pfilename) { /* Define auxbase. The default mechanism in toplev.c doesn't handle extensions longer than 3 characters. */ - char *name = xstrdup (lbasename (main_input_filename)); + char *name = xstrdup (lbasename (*pfilename)); int len; /* Remove extension. */ -- cgit v1.2.3