diff options
author | Mark W. Krentel <krentel@rice.edu> | 2018-12-19 19:24:43 -0600 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-12-19 17:24:43 -0800 |
commit | 84b33523eceec45134734a354e51e08617df71d7 (patch) | |
tree | 4a66ae327a18a0c112f1917b276a7d49d49cffc1 | |
parent | 84c547cf6e2e136e206e6a0bd477230fd5ade134 (diff) | |
download | spack-84b33523eceec45134734a354e51e08617df71d7.tar.gz spack-84b33523eceec45134734a354e51e08617df71d7.tar.bz2 spack-84b33523eceec45134734a354e51e08617df71d7.tar.xz spack-84b33523eceec45134734a354e51e08617df71d7.zip |
dyninst: patch to build dyninst with older gcc (#10160)
* dyninst: patch to build dyninst with older gcc
Add 'v9.3.2-auto.patch'. This patch changes some 'auto t: type' usage
to the older but equivalent 'type.begin()'. This allows building
dyninst 9.3.2 with gcc 4.4 which doesn't support the newer syntax.
This patch is harmless with newer gcc.
* Fix typo in patch. (My bad for sloppy cut-and-paste.)
* Restrict the patch to gcc 4.7 and earlier. gcc 4.8 supports the newer
usage and thus doesn't need the patch.
-rw-r--r-- | var/spack/repos/builtin/packages/dyninst/package.py | 1 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/dyninst/v9.3.2-auto.patch | 73 |
2 files changed, 74 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/dyninst/package.py b/var/spack/repos/builtin/packages/dyninst/package.py index 177af9bacf..7246e3519f 100644 --- a/var/spack/repos/builtin/packages/dyninst/package.py +++ b/var/spack/repos/builtin/packages/dyninst/package.py @@ -53,6 +53,7 @@ class Dyninst(CMakePackage): patch('stat_dysect.patch', when='+stat_dysect') patch('stackanalysis_h.patch', when='@9.2.0') + patch('v9.3.2-auto.patch', when='@9.3.2 %gcc@:4.7.99') # Versions 9.3.x used cotire, but have no knob to turn it off. # Cotire has no real use for one-time builds and can break diff --git a/var/spack/repos/builtin/packages/dyninst/v9.3.2-auto.patch b/var/spack/repos/builtin/packages/dyninst/v9.3.2-auto.patch new file mode 100644 index 0000000000..74fa2dfeab --- /dev/null +++ b/var/spack/repos/builtin/packages/dyninst/v9.3.2-auto.patch @@ -0,0 +1,73 @@ +Change some 'for (const auto& t: type)' usage to the older but +equivalent 'for (auto t = type.begin(); ...)'. This patch allows +dyninst 9.3.2 to build with gcc 4.4 which doesn't support the newer +syntax. + + +diff --git a/dyninstAPI/src/BPatch.C b/dyninstAPI/src/BPatch.C +index ebf7db0c4..49fe69f9a 100644 +--- a/dyninstAPI/src/BPatch.C ++++ b/dyninstAPI/src/BPatch.C +@@ -166,16 +166,16 @@ BPatch::BPatch() + stdTypes = BPatch_typeCollection::getGlobalTypeCollection(); + vector<Type *> *sTypes = Symtab::getAllstdTypes(); + BPatch_type* type = NULL; +- for(const auto& t: *sTypes) { +- stdTypes->addType(type = new BPatch_type(t)); ++ for(auto t = sTypes->begin(); t != sTypes->end(); ++t) { ++ stdTypes->addType(type = new BPatch_type(*t)); + type->decrRefCount(); + } + delete sTypes; + + builtInTypes = new BPatch_builtInTypeCollection; + sTypes = Symtab::getAllbuiltInTypes(); +- for(const auto& t: *sTypes) { +- builtInTypes->addBuiltInType(type = new BPatch_type(t)); ++ for(auto t = sTypes->begin(); t != sTypes->end(); ++t) { ++ builtInTypes->addBuiltInType(type = new BPatch_type(*t)); + type->decrRefCount(); + } + delete sTypes; +diff --git a/dyninstAPI/src/BPatch_collections.C b/dyninstAPI/src/BPatch_collections.C +index f4e2986a3..129f8b74a 100644 +--- a/dyninstAPI/src/BPatch_collections.C ++++ b/dyninstAPI/src/BPatch_collections.C +@@ -172,12 +172,12 @@ BPatch_typeCollection::~BPatch_typeCollection() + assert(refcount == 0 || + refcount == 1); + +- for(const auto& t: typesByName) { +- t.second->decrRefCount(); ++ for(auto t = typesByName.begin(); t != typesByName.end(); ++t) { ++ t->second->decrRefCount(); + } + +- for(const auto& t: typesByID) { +- t.second->decrRefCount(); ++ for(auto t = typesByID.begin(); t != typesByID.end(); ++t) { ++ t->second->decrRefCount(); + } + } + +diff --git a/symtabAPI/src/Collections.C b/symtabAPI/src/Collections.C +index 7431dd6bf..43c339f45 100644 +--- a/symtabAPI/src/Collections.C ++++ b/symtabAPI/src/Collections.C +@@ -318,12 +318,12 @@ typeCollection::typeCollection() : + typeCollection::~typeCollection() + { + // delete all of the types +- for(const auto& t: typesByName) { +- t.second->decrRefCount(); ++ for(auto t = typesByName.begin(); t != typesByName.end(); ++t) { ++ t->second->decrRefCount(); + } + +- for(const auto& t: typesByID) { +- t.second->decrRefCount(); ++ for(auto t = typesByID.begin(); t != typesByID.end(); ++t) { ++ t->second->decrRefCount(); + } + } + |