Appending switches to CXXFLAGS in an ebuild I want to append switches to CXXFLAGS but not in CFLAGS. This:
append-flags "-fno-strict-aliasing -fno-rtti -fno-exceptions"
will append those switches to both CFLAGS as well as CXXFLAGS, which I
don't want. Any solution?
PS:
The first switch (-fno-strict-aliasing) is needed; the C++ part of the
program segfaults otherwise on some systems with -O2 and higher (not on
mine though, but I want to contribute the ebuild). It's safe with -O1
(even when using "-O1 -fstrict-aliasing); probably a compiler bug, not
sure. The C part of the program isn't affected so this switch isn't
needed in CFLAGS.
The other flags are just to "optimize" a bit; the package doesn't use
RTTI nor exceptions so I think it's a good idea to use those flags for a
slightly smaller runtime. Those flags are never in the global CXXFLAGS
since they simply break packages that do use RTTI and exceptions. |