This is the mail archive of the
ecos-devel@sources.redhat.com
mailing list for the eCos project.
Re: C vs C++ compilations
On Wed, 2003-10-15 at 13:43, Jonathan Larmour wrote:
> John Dallaway wrote:
> >
> >
> > Long-term, it seems that we will definitely need to separate C and C++
> > build flags. We could certainly introduce CYGBLD_GLOBAL_CXXFLAGS
> > (similar to CYGBLD_GLOBAL_CFLAGS) and modify the makefile generation
> > code to use it. This would not be a huge task, but modifying 100+
> > platforms HALs to accommodate the change might be. I'm not so keen on
> > the option of hacking the makefile generation code to treat 'legacy'
> > platform HALs differently.
>
> See bug 1000035. The long term solution definitely doesn't involve
> anything like a CYGBLD_GLOBAL_CFLAGS. Flags to deal with warnings,
> optimisation, debugging etc. should be brought out separately - there's no
> reason for most of them to be anywhere near a platform HAL.
>
> >> The attached version [ of the patch ] works fine on my
> >> PowerPC and ARM targets. There still are some warnings when there are
> >> special rules.
> >>
> >> What version (date) of ecosconfig has the support for the full flag set?
> >>
> >> I realize that it will be some effort to split up the CDL and handle
> >> these problems fully, but as I said I think it's something we should
> >> address. The patch could be committed now as it doesn't conflict with
> >> any other changes (e.g. using CXXFLAGS)
> >
> >
> > It seems that your proposed patch constitutes a temporary workaround to
> > silence build warnings before we address the real problem. A couple of
> > comments:
> >
> > a) Why do you modify the flags for building both C and C++ files in your
> > patch? From your description of the problem, it seems that the flags you
> > cite need only be removed when compiling C files.
>
> More interesting is why the patch worked even despite that: -fvtable-gc
> should be removed globally anyway - last I knew the GCC support was broken
> (and when it worked, it was apparently unreliable anyway, and in any case
> no core eCos code uses it). -Woverloaded-virtual is just a warning. I'm
> surprised compiles didn't fail with -fno-rtti missing though. Maybe
> luckily enough the right sections are present and correctly defined in the
> chosen targets/architectures. But yes the patch should be changed if it
> affects c++ compiles too.
>
The patch is doing the right thing - it only affects .c (and currently
.S) files, not .cxx files. I know the patch looks like it does mess
with .cxx files, but I've checked the result.
> > However, I'm wondering whether we should just bite the bullet and split
> > out the C and C++ build flags soon rather than introduce a workaround. I
> > would be interested in comments from the other maintainers.
>
> Again bug 1000035. It's tied up with the makefile generator rewrite.
>
> Jifl
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates