[DynInst_API:] Dyninst build failure with gcc 5.3


Date: Sun, 01 May 2016 12:44:45 -0400
From: Peter Foley <pefoley2@xxxxxxxxxxx>
Subject: [DynInst_API:] Dyninst build failure with gcc 5.3
When building dyninst from head using gcc 5.3 and
CMAKE_BUILD_TYPE=Debug, I get the below build failure:

[ 65%] Linking CXX shared library libdyninstAPI.so
CMakeFiles/dyninstAPI.dir/src/ast.C.o: In function
`AstSnippetNode::generateCode_phase2(codeGen&, bool, unsigned long&,
unsigned int&)':
/home/peter/dyninst/dyninstAPI/src/ast.C:3714: undefined reference to
`boost::shared_ptr<Dyninst::PatchAPI::Snippet>::operator->() const'
CMakeFiles/dyninstAPI.dir/src/dynProcess.C.o: In function
`PCProcess::createProcess(std::string, std::vector<std::string,
std::allocator<std::string> >&, BPatch_hybridMode,
std::vector<std::string, std::allocator<std::string> >&, std::st
ring, int, int, int)':
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:106: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Process>::operator!()
const'
CMakeFiles/dyninstAPI.dir/src/dynProcess.C.o: In function
`PCProcess::attachProcess(std::string const&, int,
BPatch_hybridMode)':
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:143: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Process>::operator!()
const'
CMakeFiles/dyninstAPI.dir/src/dynProcess.C.o: In function
`PCProcess::isStopped() const':
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:1098: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Process>::shared_ptr()'
CMakeFiles/dyninstAPI.dir/src/dynProcess.C.o: In function
`PCProcess::isTerminated() const':
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:1103: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Process>::shared_ptr()'
CMakeFiles/dyninstAPI.dir/src/dynProcess.C.o: In function
`PCProcess::hasExitedNormally() const':
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:1108: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Process>::shared_ptr()'
CMakeFiles/dyninstAPI.dir/src/dynProcess.C.o: In function
`PCProcess::markExited()':
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:1145: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Process>::operator
bool() const'
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:1145: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Process>::shared_ptr()'
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:1145: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Process>::operator=(boost::shared_ptr<Dyninst::ProcControlAPI::Process>&&)'
CMakeFiles/dyninstAPI.dir/src/dynProcess.C.o: In function
`PCProcess::getMemoryPageSize() const':
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:1495: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Process>::operator
bool() const'
CMakeFiles/dyninstAPI.dir/src/dynProcess.C.o: In function
`PCProcess::postIRPC_internal(void*, unsigned int, unsigned int,
unsigned int, unsigned long, void*, bool, PCThread*, bool, bool, bool,
void**)':
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:2085: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Thread>::operator=(boost::shared_ptr<Dyninst::ProcControlAPI::Thread>
const&)'
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:2093: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Thread>::operator
bool() const'
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:2131: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Thread>::operator
bool() const'
CMakeFiles/dyninstAPI.dir/src/dynProcess.C.o: In function
`PCProcess::addSyncRPCThread(boost::shared_ptr<Dyninst::ProcControlAPI::Thread>)':
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:3202: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Thread>::operator
bool() const'
CMakeFiles/dyninstAPI.dir/src/dynProcess.C.o: In function
`PCProcess::removeSyncRPCThread(boost::shared_ptr<Dyninst::ProcControlAPI::Thread>)':
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:3208: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Thread>::operator
bool() const'
CMakeFiles/dyninstAPI.dir/src/dynProcess.C.o: In function
`PCProcess::continueSyncRPCThreads()':
/home/peter/dyninst/dyninstAPI/src/dynProcess.C:3217: undefined
reference to `boost::shared_ptr<Dyninst::ProcControlAPI::Thread>::operator!()
const'
CMakeFiles/dyninstAPI.dir/src/dynProcess.C.o: In function `bool
boost::operator==<Dyninst::ProcControlAPI::Process,
Dyninst::ProcControlAPI::Process>(boost::shared_ptr<Dyninst::ProcControlAPI::Process>
const&, boost::shared_ptr<Dyninst::
ProcControlAPI::Process> const&)':
/usr/include/boost/smart_ptr/shared_ptr.hpp:775: undefined reference
to `boost::shared_ptr<Dyninst::ProcControlAPI::Process>::get() const'
/usr/include/boost/smart_ptr/shared_ptr.hpp:775: undefined reference
to `boost::shared_ptr<Dyninst::ProcControlAPI::Process>::get() const'
collect2: error: ld returned 1 exit status
dyninstAPI/CMakeFiles/dyninstAPI.dir/build.make:2888: recipe for
target 'dyninstAPI/libdyninstAPI.so.9.1.0' failed
make[2]: *** [dyninstAPI/libdyninstAPI.so.9.1.0] Error 1
CMakeFiles/Makefile2:1408: recipe for target
'dyninstAPI/CMakeFiles/dyninstAPI.dir/all' failed
make[1]: *** [dyninstAPI/CMakeFiles/dyninstAPI.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

This appears to be caused by:
http://git.dyninst.org/?p=dyninst.git;a=commit;h=4c6360a9a0bf6b3cb2a54508b1b155e672ddd47e

Making the below change allowed compilation to succeed, although I
very much doubt it was the correct fix:
diff --git a/dyninstAPI/src/ast.C b/dyninstAPI/src/ast.C
index c9c59ca..a127eaa 100644
--- a/dyninstAPI/src/ast.C
+++ b/dyninstAPI/src/ast.C
@@ -41,8 +41,8 @@

 extern int dyn_debug_ast;

-extern template class boost::shared_ptr<Dyninst::PatchAPI::Snippet>;
-extern template class boost::shared_ptr<Dyninst::AST>;
+//extern template class boost::shared_ptr<Dyninst::PatchAPI::Snippet>;
+//extern template class boost::shared_ptr<Dyninst::AST>;

 #include "Instruction.h"
 using namespace Dyninst::InstructionAPI;
diff --git a/dyninstAPI/src/dynProcess.C b/dyninstAPI/src/dynProcess.C
index fd3ff41..857475f 100644
--- a/dyninstAPI/src/dynProcess.C
+++ b/dyninstAPI/src/dynProcess.C
@@ -62,8 +62,8 @@ using std::vector;
 using std::string;
 using std::stringstream;

-extern template class boost::shared_ptr<Dyninst::ProcControlAPI::Process>;
-extern template class boost::shared_ptr<Dyninst::ProcControlAPI::Thread>;
+//extern template class boost::shared_ptr<Dyninst::ProcControlAPI::Process>;
+//extern template class boost::shared_ptr<Dyninst::ProcControlAPI::Thread>;

 Dyninst::SymtabAPI::SymtabReaderFactory *PCProcess::symReaderFactory_;

Suggestions on the right way to fix this would be appreciated.

Thanks,

Peter Foley
[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] Dyninst build failure with gcc 5.3, Peter Foley <=