Lucio Andrés Illanes Albornoz (arab, vxp) 585426
From https://llvm.org/bugs/show_bug.cgi?id=24115
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
index e7ee312..b9e4779 100644
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
--- a/tools/llvm-nm/llvm-nm.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+++ b/tools/llvm-nm/llvm-nm.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -486,7 +486,7 @@ static void sortAndPrintSymbolList(SymbolicFile &Obj, bool printName,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
                                    std::string ArchiveName,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
                                    std::string ArchitectureName) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   if (!NoSort) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
-    std::function<bool(const NMSymbol &, const NMSymbol &)> Cmp;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    bool (*Cmp)(const NMSymbol &, const NMSymbol &);
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     if (NumericSort)
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       Cmp = compareSymbolAddress;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     else if (SizeSort)
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -495,8 +495,9 @@ static void sortAndPrintSymbolList(SymbolicFile &Obj, bool printName,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       Cmp = compareSymbolName;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
 
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     if (ReverseSort)
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
-      Cmp = [=](const NMSymbol &A, const NMSymbol &B) { return Cmp(B, A); };
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
-    std::sort(SymbolList.begin(), SymbolList.end(), Cmp);
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+      std::sort(SymbolList.begin(), SymbolList.end(), [=](const NMSymbol &A, const NMSymbol &B) { return Cmp(B, A); });
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    else
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+      std::sort(SymbolList.begin(), SymbolList.end(), Cmp);
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   }
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
 
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   if (!PrintFileName) {