Add -faligned-new to CXXFLAGS when available to compile dyninst 10.1 code
Fedora 30 and 31 have Dyninst 10.1. The code added to dyninst
by commit a00056bec6a0265afb592944dde2ff461b525e8d makes some data
structures cache aligned (128 bytes). The c++ compiler ends up flagging that
as an error:
CXX stap-analysis.o
/notnfs/smakarov/stap-checkout/analysis.cxx: In constructor ‘analysis::analysis(std::string)’:
/notnfs/smakarov/stap-checkout/analysis.cxx:59:37: error: ‘new’ of type ‘Dyninst::ParseAPI::SymtabCodeSource’ with extended alignment 128 [-Werror=aligned-new=]
59 | sts = new SymtabCodeSource(name_str);
| ^
/notnfs/smakarov/stap-checkout/analysis.cxx:59:37: note: uses ‘void* operator new(std::size_t)’, which does not have an alignment parameter
/notnfs/smakarov/stap-checkout/analysis.cxx:59:37: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
cc1plus: all warnings being treated as errors
make[2]: *** [Makefile:1724: stap-analysis.o] Error 1
To make the compiler happy adding a -faligned-new option to the
CXXFLAGS when it is available. This issue does not affect later
releases of dyninst as the problem code was removed from dyninst in
git commit d233ae7596cd74201d634c2f0f7d7a0e3d628e79.
17 files changed