[Bug libstdc++/85672] [9 Regression] error: redefinition of 'constexpr long double std::abs(long double)'

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue May 8 11:10:00 GMT 2018


--- Comment #11 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #8)
> My autotools-fu is too weak to come up with anything better but I'd be very
> happy if you can suggest something cleaner.

For the general case, the autoconf manual suggests having another file and
AH_BOTTOM([#include <post.h>])
to get it included at the end of config.h.

However, in the specific case of c++config.h in libstdc++, we are building it
manually in include/Makefile.am:

sed ... < ${glibcxx_srcdir}/include/bits/c++config > $@
sed ... < ${CONFIG_HEADER} >> $@
echo "" >> $@
echo "#endif // _GLIBCXX_CXX_CONFIG_H" >> $@

If we wanted to, it wouldn't be hard to cat whatever >> $@ after CONFIG_HEADER.

Since you have something that works now, there is no need to change it, but we
should keep this in mind for next time.

More information about the Gcc-bugs mailing list