diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-08-25 08:08:38 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-08-25 08:08:38 +0200 |
commit | 14862c4f2cb088c8274f9fb42217784db28856c3 (patch) | |
tree | adf36ca6b946825c1fc310b609ce4a6b3ddcd3c1 | |
parent | 2fbafb8b74e6eb8f1f6a0ff5d5a113f9ca0645b7 (diff) | |
download | ghdl-14862c4f2cb088c8274f9fb42217784db28856c3.tar.gz ghdl-14862c4f2cb088c8274f9fb42217784db28856c3.tar.bz2 ghdl-14862c4f2cb088c8274f9fb42217784db28856c3.zip |
ortho/gcc: adjust and propagate to all gcc versions the change for #1845
-rw-r--r-- | src/ortho/gcc/ortho-lang-49.c | 16 | ||||
-rw-r--r-- | src/ortho/gcc/ortho-lang-5.c | 16 | ||||
-rw-r--r-- | src/ortho/gcc/ortho-lang-6.c | 16 | ||||
-rw-r--r-- | src/ortho/gcc/ortho-lang-7.c | 16 | ||||
-rw-r--r-- | src/ortho/gcc/ortho-lang-8.c | 16 | ||||
-rw-r--r-- | src/ortho/gcc/ortho-lang-9.c | 2 |
6 files changed, 81 insertions, 1 deletions
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. */ |