vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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. |
| |||
| Nikos Chantziaras wrote: > 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? - if you want this for all the packages, set CXXFLAGS in /etc/make.conf - if it's only for some packages, then put the flags in /etc/portage/env/category/package or in /etc/portage/bashrc Google for "gentoo per-package CFLAGS". See bug #44796 on bugs.gentoo.org. |
| |||
| pk <pk@pk.invalid> wrote: > Nikos Chantziaras wrote: > >> 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? > > - if you want this for all the packages, set CXXFLAGS in > /etc/make.conf > - if it's only for some packages, then put the flags > in /etc/portage/env/category/package or in /etc/portage/bashrc > > Google for "gentoo per-package CFLAGS". See bug #44796 on > bugs.gentoo.org. He wants to know how to do this in an *ebuild* -- in other words a package he can distribute, so that all clients who emerge that ebuild will get those flags added. -- *Art |
| |||
| Arthur Hagen wrote: > He wants to know how to do this in an *ebuild* -- in other words a package > he can distribute, so that all clients who emerge that ebuild will get > those flags added. Ah, well. Then the question is best discussed on the gentoo-dev mailing linst, since it seems that the flag-o-matic eclass can't help in this case (short of ugly tricks like saving CFLAGS, changing flags as needed, and restoring CFLAGS with the saved value). |
| ||||
| Nikos Chantziaras wrote: > 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? # X="abcde" ; echo $X ; X=$X"fghij" ; echo $X abcde abcdefghij -- "Theoretically, there is nothing that can stop the government from taxing 100% of income so long as the people get benefits from the government commensurate with their income which is taxed." -- Barack Obama |
| Thread Tools | |
| Display Modes | |
| |