From a5ff9b623532ef2a15ca0a6ba315f2f463142490 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 24 Aug 2021 20:25:53 +0200 Subject: ghdldrv: handle auxbase option in ortho/gcc. Fix #1845 Remove additional option in ghdldrv.adb, automatically set aux_base_name in ortho-lang-9.c --- src/ortho/gcc/ortho-lang-9.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/ortho') diff --git a/src/ortho/gcc/ortho-lang-9.c b/src/ortho/gcc/ortho-lang-9.c index b7dfab4f3..4059e5ac3 100644 --- a/src/ortho/gcc/ortho-lang-9.c +++ b/src/ortho/gcc/ortho-lang-9.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 (main_input_filename)); + 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); -- cgit v1.2.3