Re: [DynInst_API:] dyninst does not build with Fedora 28 glibc


Date: Wed, 07 Feb 2018 14:40:02 -0500
From: Stan Cox <scox@xxxxxxxxxx>
Subject: Re: [DynInst_API:] dyninst does not build with Fedora 28 glibc
This is a just a minimal patch that gets things to build with the development version of glibc 2.26
So it seems like a more complete patch would be to rip out the rpc includes and the P_xdr_* definitions from freebsdHeaders.h, linuxHeaders.h, ntHeaders.h, vxworksHeaders.h?

On a separate note, the emitElf.C patch was to get around a problem with g++ 8.0.1

/work/dyninst/src/symtabAPI/src/emitElf.C: In member function âvoid Dyninst::SymtabAPI::emitElf<ElfTypes>::createDynamicSection(void*, unsigned int, Dyninst::SymtabAPI::emitElf<ElfTypes>::Elf_Dyn*&, unsigned int&,
unsigned int&, std::vector<std::__cxx11::basic_string<char> >&)â:
/work/dyninst/src/symtabAPI/src/emitElf.C:2516:63: error: call of overloaded âpush_back(std::pair<int,
Âint>)â is ambiguous
ÂÂÂÂÂÂÂÂÂÂÂÂ new_dynamic_entries.push_back(make_pair(DT_REL, 0));
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ^
In file included from /usr/include/c++/8/vector:64,
Âfrom /work/dyninst/src/symtabAPI/src/Object.h:46,
Âfrom /work/dyninst/src/symtabAPI/src/emitElf.h:35,
Âfrom /work/dyninst/src/symtabAPI/src/emitElf.C:33:
/usr/include/c++/8/bits/stl_vector.h:1074:7: note: candidate: âvoid std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long int, long int>; _Alloc = std::allocator<std::pair<long int, long int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<long int, long int>]â
ÂÂÂÂÂÂ push_back(const value_type& __x)
ÂÂÂÂÂÂ ^~~~~~~~~
/usr/include/c++/8/bits/stl_vector.h:1090:7: note: candidate: âvoid std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<long int, long int>; _Alloc = std::allocator<std::pair<long int, long int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<long int, long int>]â
ÂÂÂÂÂÂ push_back(value_type&& __x)
ÂÂÂÂÂÂ ^~~~~~~~~



--- a/common/src/linuxHeaders.h
+++ b/common/src/linuxHeaders.h
@@ -59,12 +59,16 @@
Â#include <sys/un.h>
Â#include <sys/syscall.h>

+#if defined(HAVE_XDR_IN_GLIBC)
Â#include <rpc/types.h>
Â#include <rpc/xdr.h>
+#endif

Â#define PDSOCKET_ERROR (-1)
Âtypedef int PDSOCKET;
+#if defined(HAVE_XDR_IN_GLIBC)
Âtypedef int (*P_xdrproc_t)(XDR*, ...);
+#endif
Â/* Not going to use on Linux Platform - already declared in /usr/include/errno.h
Âextern const char *sys_errlist[];
Â*/
@@ -264,6 +268,7 @@ extern void dedemangle( char * demangled, char * dedemangled );
Âextern COMMON_EXPORT char * P_cplus_demangle( const char * symbol, bool nativeCompiler,
ÂÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ bool includeTypes = false );

+#if defined(HAVE_XDR_IN_GLIBC)
Âinline voidÂÂ P_xdr_destroy(XDR *x) { xdr_destroy(x);}
Âinline bool_t P_xdr_u_char(XDR *x, u_char *uc) { return (xdr_u_char(x, uc));}
Âinline bool_t P_xdr_int(XDR *x, int *i) { return (xdr_int(x, i));}
@@ -286,6 +291,8 @@ inline bool_t P_xdrrec_endofrecord(XDR *x, int now) {
ÂÂ return (xdrrec_endofrecord(x, now));}
Âinline bool_t P_xdrrec_skiprecord(XDR *x) { return (xdrrec_skiprecord(x));}
Âinline bool_t P_xdrrec_eof(XDR *x) { return (xdrrec_eof(x)); }
+#endif
+
Âinline int P_mkdir(const char *pathname, mode_t mode) {
ÂÂÂÂ return mkdir(pathname, mode);
Â}

diff --git a/symtabAPI/src/emitElf.C b/symtabAPI/src/emitElf.C
index 6cb5e28c1..18c1f3bba 100644
--- a/symtabAPI/src/emitElf.C
+++ b/symtabAPI/src/emitElf.C
@@ -2513,8 +2513,8 @@ void emitElf<ElfTypes>::createDynamicSection(void *dynData, unsigned size, Elf_D

ÂÂÂÂ if (!object->hasReldyn() && !object->hasReladyn()) {
ÂÂÂÂÂÂÂÂ if (object->getRelType() == Region::RT_REL) {
-ÂÂÂÂÂÂÂÂÂÂÂ new_dynamic_entries.push_back(make_pair(DT_REL, 0));
-ÂÂÂÂÂÂÂÂÂÂÂ new_dynamic_entries.push_back(make_pair(DT_RELSZ, 0));
+ ÂÂÂ ÂÂÂ new_dynamic_entries.push_back(pair<long,long>(DT_REL, 0));
+ÂÂÂÂÂÂÂÂÂÂÂ new_dynamic_entries.push_back(pair<long,long>(DT_RELSZ, 0));

ÂÂÂÂÂÂÂÂÂÂÂÂ dynamicSecData[DT_REL].push_back(dynsecData + curpos);
ÂÂÂÂÂÂÂÂÂÂÂÂ dynsecData[curpos].d_tag = DT_NULL;

[← Prev in Thread] Current Thread [Next in Thread→]