This is the mail archive of the ecos-devel@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C vs C++ compilations


>>>>> "Jifl" == Jonathan Larmour <jifl@eCosCentric.com> writes:

    Jifl> 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.

    Jifl> See bug 1000035. The long term solution definitely doesn't
    Jifl> involve anything like a CYGBLD_GLOBAL_CFLAGS. Flags to deal
    Jifl> with warnings, optimisation, debugging etc. should be
    Jifl> brought out separately - there's no reason for most of them
    Jifl> to be anywhere near a platform HAL.

Hang on, that has not been decided. Back in the days of pkgconf.tcl
the handling of compiler flags was designed by committee and we ended
up with something like 25 different sets of compiler flags. In
practice this functionality was never really used, it just added a lot
of complexity to the system for no real gain. The existing simple
GLOBAL_CFLAGS and GLOBAL_LDFLAGS, plus per-package overrides for just
those, has worked rather well for some years now.

OK, the gcc folks have added some complications, and it looks like
they'll be adding some more in future. It may well be easier to cope
with these complications in a single place, pkgconf/rules.mak, rather
than trying to update lots of default settings in lots of platform HAL
packages every time gcc changes.

In particular, at some point it may prove necessary for the make
system to do a $(shell $(COMMAND_PREFIX)gcc --version) and adapt at
build time to the version of the compiler being used. It would be
possible to do this at the CDL level using a calculated option and
embedding a Tcl exec command, but I am not sure I want to see CDL
scripts doing that sort of thing.

Also there are other compiler flag issues that need to be addressed,
e.g. I believe there is a real need to be able to override flags on a
per-file basis rather than a per-package basis when doing funky HAL
stuff, or when working on packages that are closely tied to the
compiler like gprof and gcov.

Bart


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]