How to handle clashes between options for different front ends?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My first post here, so please bear with me if this question falls short
of the mark.

I have been working on GHDL, the VHDL front end, which used to build
against gcc4.4 or so around 2010, but stopped building against newer gcc
versions.

I've mostly brought it up to date against gcc4.7.2 and working well, and
the best of my changes (and other cleanups) have been accepted into
mainstream GHDL by Tristan Gingold, the original author. 

But there's one problem where my workaround was not accepted : a clash
between a GHDL cmdline option, -P<library_path> and another use, namely
"-P :  Inhibit generation of linemarkers in the output from the
preprocessor."
My workaround was to rename the GHDL one to -LP but that involves
unpleasant changes to existing user's build scripts. 

A better one would be to allow the two uses to peacefully coexist. This
was the case until gcc4.4 or later since neither -P option is new. But
something seems to have changed in the command line parsing strategy
since then; I am looking for some idea what changed, and how to modify
GHDL to fit in with that strategy.

So, what mechanism is supposed to route -P<dir> to ghdl or ghdl1, and -P
alone to the other compilers, and how (in the GHDL front end) could it
be broken?

The following four functions in the ghdl interface (in ortho-lang.c)
look significant, and are hooked into LANG_HOOKS but that's the extent
of my knowledge.

static unsigned int ortho_option_lang_mask (void)
static bool ortho_post_options (const char **pfilename)
extern bool lang_handle_option (const char *opt, const char *arg);
static bool ortho_handle_option (...)

Rather than ask "please fix it for me" I would ask, "where should I
look, what should I be reading, which front end should I be studying?"
to resolve the name clash in a bentter way.

I have found the GCC internals description of the lang.opt file format,
but not much else.

Thanks,
- Brian




Relevant section of vhdl/lang.opt:
-----------------------------------------------------
P
vhdl Joined
-P<dir>	Add <dir> to the end of the vhdl library path
-----------------------------------------------------

Symptoms of clash: Failure of second stage build, in libstdc++, at the
following point, with "xgcc: error: missing argument to ‘-P’"
-----------------------------------------------------
/home/brian/Projects/ghdl/build472/./gcc/xgcc
-B/home/brian/Projects/ghdl/build472/./gcc/
-B/usr/local/ghdl/x86_64-unknown-linux-gnu/bin/
-B/usr/local/ghdl/x86_64-unknown-linux-gnu/lib/
-isystem /usr/local/ghdl/x86_64-unknown-linux-gnu/include
-isystem /usr/local/ghdl/x86_64-unknown-linux-gnu/sys-include    -E -P
-include ../config.h - > libstdc++-symbols.ver || (rm -f libstdc
++-symbols.ver ; exit 1)
xgcc: error: missing argument to ‘-P’
make[5]: *** [libstdc++-symbols.ver] Error 1
make[5]: Leaving directory
`/home/brian/Projects/ghdl/build472/x86_64-unknown-linux-gnu/libstdc
++-v3/src'
-----------------------------------------------------



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux