pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lld-netbsd: Switch std::call_once to llvm:call_once



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Wed May 24 19:41:34 2017 +0200
Changeset:	bc180019809c46a5c161f8158cf66b1ed9c33ced

Modified Files:
	lld-netbsd/distinfo
Added Files:
	lld-netbsd/patches/patch-ELF_InputSection.cpp
	lld-netbsd/patches/patch-ELF_InputSection.h

Log Message:
lld-netbsd: Switch std::call_once to llvm:call_once

This fixes operation of LLD on NetBSD.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=bc180019809c46a5c161f8158cf66b1ed9c33ced

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 lld-netbsd/distinfo                           |  2 ++
 lld-netbsd/patches/patch-ELF_InputSection.cpp | 21 +++++++++++++++++++++
 lld-netbsd/patches/patch-ELF_InputSection.h   | 21 +++++++++++++++++++++
 3 files changed, 44 insertions(+)

diffs:
diff --git a/lld-netbsd/distinfo b/lld-netbsd/distinfo
index 7931384fd5..32d5e45e33 100644
--- a/lld-netbsd/distinfo
+++ b/lld-netbsd/distinfo
@@ -12,3 +12,5 @@ Size (libcxx-3.6.2.src.tar.xz) = 944020 bytes
 SHA1 (llvm-3.6.2.src.tar.xz) = 7a00257eb2bc9431e4c77c3a36b033072c54bc7e
 RMD160 (llvm-3.6.2.src.tar.xz) = 521cbc5fe2925ea3c6e90c7a31f752a04045c972
 Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
+SHA1 (patch-ELF_InputSection.cpp) = 4403850a2f2315d4761695032591df58ca0807fb
+SHA1 (patch-ELF_InputSection.h) = e327aeb44ee9cc6a693122fe7e4f3e8b6aec4755
diff --git a/lld-netbsd/patches/patch-ELF_InputSection.cpp b/lld-netbsd/patches/patch-ELF_InputSection.cpp
new file mode 100644
index 0000000000..5512daeace
--- /dev/null
+++ b/lld-netbsd/patches/patch-ELF_InputSection.cpp
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- ELF/InputSection.cpp.orig	2017-05-24 01:57:45.000000000 +0000
++++ ELF/InputSection.cpp
+@@ -23,6 +23,7 @@
+ #include "llvm/Support/Compression.h"
+ #include "llvm/Support/Endian.h"
+ #include "llvm/Support/Path.h"
++#include "llvm/Support/Threading.h"
+ #include <mutex>
+ 
+ using namespace llvm;
+@@ -866,7 +867,7 @@ const SectionPiece *MergeInputSection::g
+ // it is not just an addition to a base output offset.
+ uint64_t MergeInputSection::getOffset(uint64_t Offset) const {
+   // Initialize OffsetMap lazily.
+-  std::call_once(InitOffsetMap, [&] {
++  llvm::call_once(InitOffsetMap, [&] {
+     OffsetMap.reserve(Pieces.size());
+     for (const SectionPiece &Piece : Pieces)
+       OffsetMap[Piece.InputOff] = Piece.OutputOff;
diff --git a/lld-netbsd/patches/patch-ELF_InputSection.h b/lld-netbsd/patches/patch-ELF_InputSection.h
new file mode 100644
index 0000000000..adddeeed72
--- /dev/null
+++ b/lld-netbsd/patches/patch-ELF_InputSection.h
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- ELF/InputSection.h.orig	2017-05-24 01:57:45.000000000 +0000
++++ ELF/InputSection.h
+@@ -18,6 +18,7 @@
+ #include "llvm/ADT/DenseSet.h"
+ #include "llvm/ADT/TinyPtrVector.h"
+ #include "llvm/Object/ELF.h"
++#include "llvm/Support/Threading.h"
+ #include <mutex>
+ 
+ namespace lld {
+@@ -248,7 +249,7 @@ private:
+   std::vector<uint32_t> Hashes;
+ 
+   mutable llvm::DenseMap<uint64_t, uint64_t> OffsetMap;
+-  mutable std::once_flag InitOffsetMap;
++  mutable llvm::once_flag InitOffsetMap;
+ 
+   llvm::DenseSet<uint64_t> LiveOffsets;
+ };


Home | Main Index | Thread Index | Old Index