<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[120450] trunk/dports/devel/ld64</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/120450">120450</a></dd>
<dt>Author</dt> <dd>jeremyhu@macports.org</dd>
<dt>Date</dt> <dd>2014-05-28 11:02:14 -0700 (Wed, 28 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>ld64: Revert to ld64-136 on Snow Leopard</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsdevelld64Portfile">trunk/dports/devel/ld64/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportsdevelld64filesld64136hash_setpatch">trunk/dports/devel/ld64/files/ld64-136-hash_set.patch</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsdevelld64Portfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/devel/ld64/Portfile (120449 => 120450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/devel/ld64/Portfile        2014-05-28 17:18:14 UTC (rev 120449)
+++ trunk/dports/devel/ld64/Portfile        2014-05-28 18:02:14 UTC (rev 120450)
</span><span class="lines">@@ -6,6 +6,7 @@
</span><span class="cx"> # revbump cctools whenever this port updates
</span><span class="cx"> 
</span><span class="cx"> name                    ld64
</span><ins>+epoch                   1
</ins><span class="cx"> # XCode 5.1
</span><span class="cx"> version                 236.3
</span><span class="cx"> revision                1
</span><span class="lines">@@ -128,9 +129,20 @@
</span><span class="cx"> 
</span><span class="cx">     patchfiles-delete   ld64-133-no-CrashReporterClient.h.patch ld64-136-i386-badAddress.patch PR-16935960.patch PR-16936488.patch
</span><span class="cx">     patchfiles-append   ld64-127-any-cctools.patch
</span><ins>+} elseif {${os.major} &lt; 11} {
+    # XCode 4.6
+    # Until we figure out a way to better bootstrap ld64-236 on SnowLeopard or fix its build failure
+    version             136
+    revision            2
+    checksums           rmd160  4a2930ccdd398b63a108810e90293ab96dc154a0 \
+                        sha256  99d6c4acb6d4cdf45772951dd2308222aa966763170137459a9d276674645d9e

+    supported_archs     i386 x86_64
+
+    patchfiles-delete   PR-16935960.patch PR-16936488.patch
+    patchfiles-append   ld64-136-hash_set.patch
</ins><span class="cx"> } else {
</span><span class="cx">     # http://trac.macports.org/ticket/43737
</span><del>-    # TODO: Figure out a better way to bootstrap this...
</del><span class="cx">     compiler.blacklist-append *gcc*
</span><span class="cx"> 
</span><span class="cx">     if {${cxxstdlib} eq &quot;libstdc++&quot;} {
</span></span></pre></div>
<a id="trunkdportsdevelld64filesld64136hash_setpatch"></a>
<div class="addfile"><h4>Added: trunk/dports/devel/ld64/files/ld64-136-hash_set.patch (0 => 120450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/devel/ld64/files/ld64-136-hash_set.patch                                (rev 0)
+++ trunk/dports/devel/ld64/files/ld64-136-hash_set.patch        2014-05-28 18:02:14 UTC (rev 120450)
</span><span class="lines">@@ -0,0 +1,606 @@
</span><ins>+commit 8fe69df46f26076e7a5339f6ae505e19302a19d2
+Author: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
+Date:   Mon May 27 10:24:39 2013 -0700
+
+    Don't use unordered_set without libc++
+
+diff --git a/src/ld/InputFiles.cpp b/src/ld/InputFiles.cpp
+index 7bf136b..6a81db2 100644
+--- src/ld/InputFiles.cpp
++++ src/ld/InputFiles.cpp
+@@ -49,6 +49,8 @@
+ #include &lt;vector&gt;
+ #include &lt;list&gt;
+ #include &lt;algorithm&gt;
++#include &lt;ext/hash_map&gt;
++#include &lt;ext/hash_set&gt;
+ #include &lt;dlfcn.h&gt;
+ #include &lt;AvailabilityMacros.h&gt;

+diff --git a/src/ld/InputFiles.h b/src/ld/InputFiles.h
+index 9b969ee..ff4fd86 100644
+--- src/ld/InputFiles.h
++++ src/ld/InputFiles.h
+@@ -103,7 +103,11 @@ private:
+         static void                                        parseWorkerThread(InputFiles *inputFiles);
+         void                                                startThread(void (*threadFunc)(InputFiles *)) const;

+-        typedef std::unordered_map&lt;const char*, ld::dylib::File*, CStringHash, CStringEquals&gt;        InstallNameToDylib;
++        class CStringEquals {
++        public:
++                bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
++        };
++        typedef __gnu_cxx::hash_map&lt;const char*, ld::dylib::File*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt;        InstallNameToDylib;

+         const Options&amp;                                _options;
+         std::vector&lt;ld::File*&gt;                _inputFiles;
+diff --git a/src/ld/LinkEditClassic.hpp b/src/ld/LinkEditClassic.hpp
+index 60a4fa9..4df2d5f 100644
+--- src/ld/LinkEditClassic.hpp
++++ src/ld/LinkEditClassic.hpp
+@@ -32,7 +32,6 @@
+ #include &lt;unistd.h&gt;

+ #include &lt;vector&gt;
+-#include &lt;unordered_map&gt;

+ #include &quot;Options.h&quot;
+ #include &quot;ld.hpp&quot;
+@@ -91,8 +90,13 @@ public:
+         uint32_t                                                                        currentOffset();

+ private:
++        class CStringEquals
++        {
++        public:
++                bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
++        };
+         enum { kBufferSize = 0x01000000 };
+-        typedef std::unordered_map&lt;const char*, int32_t, CStringHash, CStringEquals&gt; StringToOffset;
++        typedef __gnu_cxx::hash_map&lt;const char*, int32_t, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt; StringToOffset;

+         const uint32_t                                                        _pointerSize;
+         std::vector&lt;char*&gt;                                                _fullBuffers;
+diff --git a/src/ld/Options.h b/src/ld/Options.h
+index 41e5653..4289e68 100644
+--- src/ld/Options.h
++++ src/ld/Options.h
+@@ -30,8 +30,8 @@
+ #include &lt;mach/machine.h&gt;

+ #include &lt;vector&gt;
+-#include &lt;unordered_set&gt;
+-#include &lt;unordered_map&gt;
++#include &lt;ext/hash_set&gt;
++#include &lt;ext/hash_map&gt;

+ #include &quot;ld.hpp&quot;
+ #include &quot;Snapshot.h&quot;
+@@ -342,8 +342,13 @@ public:
+     const char*                                        pipelineFifo() const { return fPipelineFifo; }
+         
+ private:
+-        typedef std::unordered_map&lt;const char*, unsigned int, ld::CStringHash, ld::CStringEquals&gt; NameToOrder;
+-        typedef std::unordered_set&lt;const char*, ld::CStringHash, ld::CStringEquals&gt;  NameSet;
++        class CStringEquals
++        {
++        public:
++                bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
++        };
++        typedef __gnu_cxx::hash_map&lt;const char*, unsigned int, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt; NameToOrder;
++        typedef __gnu_cxx::hash_set&lt;const char*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt;  NameSet;
+         enum ExportMode { kExportDefault, kExportSome, kDontExportSome };
+         enum LibrarySearchMode { kSearchDylibAndArchiveInEachDir, kSearchAllDirsForDylibsThenAllDirsForArchives };
+         enum InterposeMode { kInterposeNone, kInterposeAllExternal, kInterposeSome };
+diff --git a/src/ld/OutputFile.cpp b/src/ld/OutputFile.cpp
+index 16fdd66..bacee09 100644
+--- src/ld/OutputFile.cpp
++++ src/ld/OutputFile.cpp
+@@ -50,7 +50,8 @@
+ #include &lt;vector&gt;
+ #include &lt;list&gt;
+ #include &lt;algorithm&gt;
+-#include &lt;unordered_set&gt;
++#include &lt;ext/hash_map&gt;
++#include &lt;ext/hash_set&gt;

+ #include &lt;CommonCrypto/CommonDigest.h&gt;
+ #include &lt;AvailabilityMacros.h&gt;
+@@ -3420,6 +3421,12 @@ public:
+ };


++class CStringEquals
++{
++public:
++        bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
++};
++
+ const char* OutputFile::assureFullPath(const char* path)
+ {
+         if ( path[0] == '/' )
+@@ -3505,7 +3512,7 @@ void OutputFile::synthesizeDebugNotes(ld::Internal&amp; state)
+         const char* filename = NULL;
+         bool wroteStartSO = false;
+         state.stabs.reserve(atomsNeedingDebugNotes.size()*4);
+-        std::unordered_set&lt;const char*, CStringHash, CStringEquals&gt;  seenFiles;
++        __gnu_cxx::hash_set&lt;const char*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt;  seenFiles;
+         for (std::vector&lt;const ld::Atom*&gt;::iterator it=atomsNeedingDebugNotes.begin(); it != atomsNeedingDebugNotes.end(); it++) {
+                 const ld::Atom* atom = *it;
+                 const ld::File* atomFile = atom-&gt;file();
+diff --git a/src/ld/Resolver.cpp b/src/ld/Resolver.cpp
+index ad4b22d..4d80af8 100644
+--- src/ld/Resolver.cpp
++++ src/ld/Resolver.cpp
+@@ -47,6 +47,8 @@
+ #include &lt;vector&gt;
+ #include &lt;list&gt;
+ #include &lt;algorithm&gt;
++#include &lt;ext/hash_map&gt;
++#include &lt;ext/hash_set&gt;
+ #include &lt;dlfcn.h&gt;
+ #include &lt;AvailabilityMacros.h&gt;

+diff --git a/src/ld/Resolver.h b/src/ld/Resolver.h
+index 32d1d50..d71aed3 100644
+--- src/ld/Resolver.h
++++ src/ld/Resolver.h
+@@ -42,7 +42,6 @@
+ #include &lt;mach-o/dyld.h&gt;

+ #include &lt;vector&gt;
+-#include &lt;unordered_set&gt;

+ #include &quot;Options.h&quot;
+ #include &quot;ld.hpp&quot;
+@@ -100,7 +99,11 @@ private:
+         bool                                        printReferencedBy(const char* name, SymbolTable::IndirectBindingSlot slot);
+         void                                        tweakWeakness();

+-        typedef std::unordered_set&lt;const char*, CStringHash, CStringEquals&gt;  StringSet;
++        class CStringEquals {
++        public:
++                bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
++        };
++        typedef __gnu_cxx::hash_set&lt;const char*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt;  StringSet;

+         class NotLive {
+         public:
+diff --git a/src/ld/SymbolTable.cpp b/src/ld/SymbolTable.cpp
+index 2ea690f..406556a 100644
+--- src/ld/SymbolTable.cpp
++++ src/ld/SymbolTable.cpp
+@@ -41,6 +41,8 @@
+ #include &lt;set&gt;
+ #include &lt;vector&gt;
+ #include &lt;algorithm&gt;
++#include &lt;ext/hash_map&gt;
++#include &lt;ext/hash_set&gt;

+ #include &quot;Options.h&quot;

+@@ -746,7 +748,7 @@ void SymbolTable::printStatistics()
+                 count[b] = 0;
+         }
+         for(unsigned int i=0; i &lt; _cstringTable.bucket_count(); ++i) {
+-                unsigned int n = _cstringTable.bucket_size(i);
++                unsigned int n = _cstringTable.elems_in_bucket(i);
+                 if ( n &lt; 10 ) 
+                         count[n] += 1;
+                 else
+diff --git a/src/ld/SymbolTable.h b/src/ld/SymbolTable.h
+index 5575f31..451d064 100644
+--- src/ld/SymbolTable.h
++++ src/ld/SymbolTable.h
+@@ -42,7 +42,7 @@
+ #include &lt;mach-o/dyld.h&gt;

+ #include &lt;vector&gt;
+-#include &lt;unordered_map&gt;
++#include &lt;ext/hash_map&gt;

+ #include &quot;Options.h&quot;
+ #include &quot;ld.hpp&quot;
+@@ -57,38 +57,42 @@ public:
+         typedef uint32_t IndirectBindingSlot;

+ private:
+-        typedef std::unordered_map&lt;const char*, IndirectBindingSlot, CStringHash, CStringEquals&gt; NameToSlot;
++        class CStringEquals {
++        public:
++                bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
++        };
++        typedef __gnu_cxx::hash_map&lt;const char*, IndirectBindingSlot, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt; NameToSlot;

+         class ContentFuncs {
+         public:
+                 size_t        operator()(const ld::Atom*) const;
+                 bool        operator()(const ld::Atom* left, const ld::Atom* right) const;
+         };
+-        typedef std::unordered_map&lt;const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs&gt; ContentToSlot;
++        typedef __gnu_cxx::hash_map&lt;const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs&gt; ContentToSlot;

+         class ReferencesHashFuncs {
+         public:
+                 size_t        operator()(const ld::Atom*) const;
+                 bool        operator()(const ld::Atom* left, const ld::Atom* right) const;
+         };
+-        typedef std::unordered_map&lt;const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs&gt; ReferencesToSlot;
++        typedef __gnu_cxx::hash_map&lt;const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs&gt; ReferencesToSlot;

+         class CStringHashFuncs {
+         public:
+                 size_t        operator()(const ld::Atom*) const;
+                 bool        operator()(const ld::Atom* left, const ld::Atom* right) const;
+         };
+-        typedef std::unordered_map&lt;const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs&gt; CStringToSlot;
++        typedef __gnu_cxx::hash_map&lt;const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs&gt; CStringToSlot;

+         class UTF16StringHashFuncs {
+         public:
+                 size_t        operator()(const ld::Atom*) const;
+                 bool        operator()(const ld::Atom* left, const ld::Atom* right) const;
+         };
+-        typedef std::unordered_map&lt;const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs&gt; UTF16StringToSlot;
++        typedef __gnu_cxx::hash_map&lt;const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs&gt; UTF16StringToSlot;

+         typedef std::map&lt;IndirectBindingSlot, const char*&gt; SlotToName;
+-        typedef std::unordered_map&lt;const char*, CStringToSlot*, CStringHash, CStringEquals&gt; NameToMap;
++        typedef __gnu_cxx::hash_map&lt;const char*, CStringToSlot*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt; NameToMap;
+     
+     typedef std::vector&lt;const ld::Atom *&gt; DuplicatedSymbolAtomList;
+     typedef std::map&lt;const char *, DuplicatedSymbolAtomList * &gt; DuplicateSymbols;
+diff --git a/src/ld/ld.cpp b/src/ld/ld.cpp
+index a5db06e..1a234db 100644
+--- src/ld/ld.cpp
++++ src/ld/ld.cpp
+@@ -54,7 +54,8 @@ extern &quot;C&quot; double log2 ( double );
+ #include &lt;vector&gt;
+ #include &lt;list&gt;
+ #include &lt;algorithm&gt;
+-#include &lt;unordered_map&gt;
++#include &lt;ext/hash_map&gt;
++#include &lt;ext/hash_set&gt;
+ #include &lt;cxxabi.h&gt;

+ #include &quot;Options.h&quot;
+@@ -146,7 +147,7 @@ private:
+         struct SectionEquals {
+                 bool operator()(const ld::Section* left, const ld::Section* right) const;
+         };
+-        typedef std::unordered_map&lt;const ld::Section*, FinalSection*, SectionHash, SectionEquals&gt; SectionInToOut;
++        typedef __gnu_cxx::hash_map&lt;const ld::Section*, FinalSection*, SectionHash, SectionEquals&gt; SectionInToOut;
+         

+         SectionInToOut                        _sectionInToFinalMap;
+@@ -167,7 +168,7 @@ std::vector&lt;const char*&gt; InternalState::FinalSection::_s_segmentsSeen;
+ size_t InternalState::SectionHash::operator()(const ld::Section* sect) const
+ {
+         size_t hash = 0;        
+-        ld::CStringHash temp;
++        __gnu_cxx::hash&lt;const char*&gt; temp;
+         hash += temp.operator()(sect-&gt;segmentName());
+         hash += temp.operator()(sect-&gt;sectionName());
+         return hash;
+diff --git a/src/ld/ld.hpp b/src/ld/ld.hpp
+index 7be00a3..ed021ff 100644
+--- src/ld/ld.hpp
++++ src/ld/ld.hpp
+@@ -788,20 +788,6 @@ public:



+-        
+-// utility classes for using std::unordered_map with c-strings
+-struct CStringHash {
+-        size_t operator()(const char* __s) const {
+-                size_t __h = 0;
+-                for ( ; *__s; ++__s)
+-                        __h = 5 * __h + *__s;
+-                return __h;
+-        };
+-};
+-struct CStringEquals
+-{
+-        bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
+-};



+diff --git a/src/ld/parsers/archive_file.cpp b/src/ld/parsers/archive_file.cpp
+index 708f1fb..29ff25f 100644
+--- src/ld/parsers/archive_file.cpp
++++ src/ld/parsers/archive_file.cpp
+@@ -33,7 +33,7 @@
+ #include &lt;set&gt;
+ #include &lt;map&gt;
+ #include &lt;algorithm&gt;
+-#include &lt;unordered_map&gt;
++#include &lt;ext/hash_map&gt;

+ #include &quot;MachOFileAbstraction.hpp&quot;
+ #include &quot;Architectures.hpp&quot;
+@@ -112,7 +112,12 @@ private:
+         struct MemberState { ld::relocatable::File* file; const Entry *entry; bool logged; bool loaded; uint16_t index;};
+         bool                                                                                        loadMember(MemberState&amp; state, ld::File::AtomHandler&amp; handler, const char *format, ...) const;

+-        typedef std::unordered_map&lt;const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals&gt; NameToEntryMap;
++        class CStringEquals
++        {
++        public:
++                bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
++        };
++        typedef __gnu_cxx::hash_map&lt;const char*, const struct ranlib*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt; NameToEntryMap;

+         typedef typename A::P                                                        P;
+         typedef typename A::P::E                                                E;
+diff --git a/src/ld/parsers/lto_file.cpp b/src/ld/parsers/lto_file.cpp
+index 023f6e3..11b04a4 100644
+--- src/ld/parsers/lto_file.cpp
++++ src/ld/parsers/lto_file.cpp
+@@ -30,11 +30,10 @@
+ #include &lt;sys/fcntl.h&gt;
+ #include &lt;sys/stat.h&gt;
+ #include &lt;errno.h&gt;
+-#include &lt;pthread.h&gt;
+ #include &lt;mach-o/dyld.h&gt;
+ #include &lt;vector&gt;
+-#include &lt;unordered_set&gt;
+-#include &lt;unordered_map&gt;
++#include &lt;ext/hash_set&gt;
++#include &lt;ext/hash_map&gt;

+ #include &quot;MachOFileAbstraction.hpp&quot;
+ #include &quot;Architectures.hpp&quot;
+@@ -212,8 +211,13 @@ private:
+         static const char*                                tripletPrefixForArch(cpu_type_t arch);
+         static ld::relocatable::File*        parseMachOFile(const uint8_t* p, size_t len, const OptimizeOptions&amp; options);

+-        typedef        std::unordered_set&lt;const char*, ld::CStringHash, ld::CStringEquals&gt;  CStringSet;
+-        typedef std::unordered_map&lt;const char*, Atom*, ld::CStringHash, ld::CStringEquals&gt; CStringToAtom;
++        class CStringEquals
++        {
++        public:
++                bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
++        };
++        typedef        __gnu_cxx::hash_set&lt;const char*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt;  CStringSet;
++        typedef __gnu_cxx::hash_map&lt;const char*, Atom*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt; CStringToAtom;
+         
+         class AtomSyncer : public ld::File::AtomHandler {
+         public:
+diff --git a/src/ld/parsers/macho_dylib_file.cpp b/src/ld/parsers/macho_dylib_file.cpp
+index aad1a8b..77a4824 100644
+--- src/ld/parsers/macho_dylib_file.cpp
++++ src/ld/parsers/macho_dylib_file.cpp
+@@ -33,8 +33,8 @@
+ #include &lt;vector&gt;
+ #include &lt;set&gt;
+ #include &lt;algorithm&gt;
+-#include &lt;unordered_map&gt;
+-#include &lt;unordered_set&gt;
++#include &lt;ext/hash_map&gt;
++#include &lt;ext/hash_set&gt;

+ #include &quot;Architectures.hpp&quot;
+ #include &quot;MachOFileAbstraction.hpp&quot;
+@@ -178,17 +178,14 @@ private:
+         friend class ExportAtom&lt;A&gt;;
+         friend class ImportAtom&lt;A&gt;;

+-        struct CStringHash {
+-                std::size_t operator()(const char* __s) const {
+-                        unsigned long __h = 0;
+-                        for ( ; *__s; ++__s)
+-                                __h = 5 * __h + *__s;
+-                        return size_t(__h);
+-                };
++        class CStringEquals
++        {
++        public:
++                bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
+         };
+         struct AtomAndWeak { ld::Atom* atom; bool weakDef; bool tlv; pint_t address; };
+-        typedef std::unordered_map&lt;const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals&gt; NameToAtomMap;
+-        typedef std::unordered_set&lt;const char*, CStringHash, ld::CStringEquals&gt;  NameSet;
++        typedef __gnu_cxx::hash_map&lt;const char*, AtomAndWeak, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt; NameToAtomMap;
++        typedef __gnu_cxx::hash_set&lt;const char*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt;  NameSet;

+         struct Dependent { const char* path; File&lt;A&gt;* dylib; bool reExport; };

+@@ -509,14 +506,14 @@ void File&lt;A&gt;::buildExportHashTableFromSymbolTable(const macho_dysymtab_command&lt;P
+                 if ( _s_logHashtable ) fprintf(stderr, &quot;ld: building hashtable of %u toc entries for %s\n&quot;, dynamicInfo-&gt;nextdefsym(), this-&gt;path());
+                 const macho_nlist&lt;P&gt;* start = &amp;symbolTable[dynamicInfo-&gt;iextdefsym()];
+                 const macho_nlist&lt;P&gt;* end = &amp;start[dynamicInfo-&gt;nextdefsym()];
+-                _atoms.reserve(dynamicInfo-&gt;nextdefsym()); // set initial bucket count
++                _atoms.resize(dynamicInfo-&gt;nextdefsym()); // set initial bucket count
+                 for (const macho_nlist&lt;P&gt;* sym=start; sym &lt; end; ++sym) {
+                         this-&gt;addSymbol(&amp;strings[sym-&gt;n_strx()], (sym-&gt;n_desc() &amp; N_WEAK_DEF) != 0, false, sym-&gt;n_value());
+                 }
+         }
+         else {
+                 int32_t count = dynamicInfo-&gt;ntoc();
+-                _atoms.reserve(count); // set initial bucket count
++                _atoms.resize(count); // set initial bucket count
+                 if ( _s_logHashtable ) fprintf(stderr, &quot;ld: building hashtable of %u entries for %s\n&quot;, count, this-&gt;path());
+                 const struct dylib_table_of_contents* toc = (dylib_table_of_contents*)(fileContent + dynamicInfo-&gt;tocoff());
+                 for (int32_t i = 0; i &lt; count; ++i) {
+diff --git a/src/ld/passes/dtrace_dof.cpp b/src/ld/passes/dtrace_dof.cpp
+index 74328ff..175629d 100644
+--- src/ld/passes/dtrace_dof.cpp
++++ src/ld/passes/dtrace_dof.cpp
+@@ -30,8 +30,7 @@

+ #include &lt;vector&gt;
+ #include &lt;map&gt;
+-#include &lt;unordered_map&gt;
+-#include &lt;unordered_set&gt;
++#include &lt;ext/hash_map&gt;

+ #include &quot;ld.hpp&quot;
+ #include &quot;dtrace_dof.h&quot;
+@@ -104,14 +103,20 @@ Atom::Atom(File&amp; f, const char* n,  const uint8_t* content, uint64_t sz)



++class CStringEquals
++{
++public:
++        bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
++};
++
+ struct DTraceProbeInfo {
+         DTraceProbeInfo(const ld::Atom* a, uint32_t o, const char* n) : atom(a), offset(o), probeName(n) {}
+         const ld::Atom*                                        atom;
+         uint32_t                                                offset;
+         const char*                                                probeName;
+ };
+-typedef std::unordered_map&lt;const char*, std::vector&lt;DTraceProbeInfo&gt;, CStringHash, CStringEquals&gt;        ProviderToProbes;
+-typedef        std::unordered_set&lt;const char*, CStringHash, CStringEquals&gt;  CStringSet;
++typedef __gnu_cxx::hash_map&lt;const char*, std::vector&lt;DTraceProbeInfo&gt;, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt;        ProviderToProbes;
++typedef        __gnu_cxx::hash_set&lt;const char*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt;  CStringSet;



+diff --git a/src/ld/passes/got.cpp b/src/ld/passes/got.cpp
+index 3e6824f..44a5103 100644
+--- src/ld/passes/got.cpp
++++ src/ld/passes/got.cpp
+@@ -30,6 +30,7 @@

+ #include &lt;vector&gt;
+ #include &lt;map&gt;
++#include &lt;ext/hash_map&gt;

+ #include &quot;ld.hpp&quot;
+ #include &quot;got.h&quot;
+diff --git a/src/ld/passes/order.cpp b/src/ld/passes/order.cpp
+index b4be79f..6876d8f 100644
+--- src/ld/passes/order.cpp
++++ src/ld/passes/order.cpp
+@@ -31,7 +31,6 @@

+ #include &lt;vector&gt;
+ #include &lt;map&gt;
+-#include &lt;unordered_map&gt;

+ #include &quot;ld.hpp&quot;
+ #include &quot;order.h&quot;
+@@ -83,7 +82,11 @@ private:
+                 const Layout&amp;        _layout;
+         };
+                                 
+-        typedef std::unordered_map&lt;const char*, const ld::Atom*, CStringHash, CStringEquals&gt; NameToAtom;
++        class CStringEquals {
++        public:
++                bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
++        };
++        typedef __gnu_cxx::hash_map&lt;const char*, const ld::Atom*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt; NameToAtom;
+         
+         typedef std::map&lt;const ld::Atom*, const ld::Atom*&gt; AtomToAtom;
+         
+diff --git a/src/ld/passes/tlvp.cpp b/src/ld/passes/tlvp.cpp
+index 6a58fdf..eed532e 100644
+--- src/ld/passes/tlvp.cpp
++++ src/ld/passes/tlvp.cpp
+@@ -30,6 +30,7 @@

+ #include &lt;vector&gt;
+ #include &lt;map&gt;
++#include &lt;ext/hash_map&gt;

+ #include &quot;ld.hpp&quot;
+ #include &quot;tlvp.h&quot;
+diff --git a/src/other/dyldinfo.cpp b/src/other/dyldinfo.cpp
+index 71f13b8..9dbf754 100644
+--- src/other/dyldinfo.cpp
++++ src/other/dyldinfo.cpp
+@@ -33,7 +33,7 @@

+ #include &lt;vector&gt;
+ #include &lt;set&gt;
+-#include &lt;unordered_set&gt;
++#include &lt;ext/hash_set&gt;

+ #include &quot;configure.h&quot;
+ #include &quot;MachOFileAbstraction.hpp&quot;
+@@ -87,6 +87,14 @@ private:
+         typedef typename A::P::E                                E;
+         typedef typename A::P::uint_t                        pint_t;
+         
++        class CStringEquals
++        {
++        public:
++                bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
++        };
++
++        typedef __gnu_cxx::hash_set&lt;const char*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt;  StringSet;
++
+                                                                                                 DyldInfoPrinter(const uint8_t* fileContent, uint32_t fileLength, const char* path, bool printArch);
+         void                                                                                printRebaseInfo();
+         void                                                                                printRebaseInfoOpcodes();
+diff --git a/src/other/machochecker.cpp b/src/other/machochecker.cpp
+index bd585d1..274d170 100644
+--- src/other/machochecker.cpp
++++ src/other/machochecker.cpp
+@@ -33,7 +33,7 @@

+ #include &lt;vector&gt;
+ #include &lt;set&gt;
+-#include &lt;unordered_set&gt;
++#include &lt;ext/hash_set&gt;

+ #include &quot;configure.h&quot;

+@@ -110,21 +110,13 @@ private:
+         typedef typename A::P::E                                E;
+         typedef typename A::P::uint_t                        pint_t;
+         
+-        // utility classes for using std::unordered_map with c-strings
+-        struct CStringHash {
+-                size_t operator()(const char* __s) const {
+-                        size_t __h = 0;
+-                        for ( ; *__s; ++__s)
+-                                __h = 5 * __h + *__s;
+-                        return __h;
+-                };
+-        };
+-        struct CStringEquals
++        class CStringEquals
+         {
++        public:
+                 bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
+         };

+-        typedef std::unordered_set&lt;const char*, CStringHash, CStringEquals&gt;  StringSet;
++        typedef __gnu_cxx::hash_set&lt;const char*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt;  StringSet;

+                                                                                                 MachOChecker(const uint8_t* fileContent, uint32_t fileLength, const char* path);
+         void                                                                                checkMachHeader();
+diff --git a/src/other/unwinddump.cpp b/src/other/unwinddump.cpp
+index 731f2a3..9060557 100644
+--- src/other/unwinddump.cpp
++++ src/other/unwinddump.cpp
+@@ -33,7 +33,7 @@

+ #include &lt;vector&gt;
+ #include &lt;set&gt;
+-#include &lt;unordered_set&gt;
++#include &lt;ext/hash_set&gt;


+ #include &quot;MachOFileAbstraction.hpp&quot;
+@@ -71,6 +71,14 @@ private:
+         typedef typename A::P::E                                E;
+         typedef typename A::P::uint_t                        pint_t;
+         
++        class CStringEquals
++        {
++        public:
++                bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
++        };
++
++        typedef __gnu_cxx::hash_set&lt;const char*, __gnu_cxx::hash&lt;const char*&gt;, CStringEquals&gt;  StringSet;
++
+                                                                                                 UnwindPrinter(const uint8_t* fileContent, uint32_t fileLength, 
+                                                                                                                                 const char* path, bool showFunctionNames);
+         bool                                                                                findUnwindSection();
</ins></span></pre>
</div>
</div>

</body>
</html>