aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/gcc/ortho-lang-5.c
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-08-25 08:08:38 +0200
committerTristan Gingold <tgingold@free.fr>2021-08-25 08:08:38 +0200
commit14862c4f2cb088c8274f9fb42217784db28856c3 (patch)
treeadf36ca6b946825c1fc310b609ce4a6b3ddcd3c1 /src/ortho/gcc/ortho-lang-5.c
parent2fbafb8b74e6eb8f1f6a0ff5d5a113f9ca0645b7 (diff)
downloadghdl-14862c4f2cb088c8274f9fb42217784db28856c3.tar.gz
ghdl-14862c4f2cb088c8274f9fb42217784db28856c3.tar.bz2
ghdl-14862c4f2cb088c8274f9fb42217784db28856c3.zip
ortho/gcc: adjust and propagate to all gcc versions the change for #1845
Diffstat (limited to 'src/ortho/gcc/ortho-lang-5.c')
-rw-r--r--src/ortho/gcc/ortho-lang-5.c16
1 files changed, 16 insertions, 0 deletions
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);