abseil-cpp: fix missing thread_local symbol in cordz

This commit is contained in:
Jerome Duval
2022-05-20 09:51:09 +02:00
parent 49b20c1fb9
commit 68476160d0
2 changed files with 39 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ C++11) designed to augment the C++ standard library."
HOMEPAGE="https://abseil.io"
COPYRIGHT="2017-2021 The Abseil Authors"
LICENSE="Apache v2"
REVISION="1"
REVISION="2"
SOURCE_URI="http://github.com/abseil/abseil-cpp/archive/$portVersion/abseil-$portVersion.tar.gz"
CHECKSUM_SHA256="dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4"
SOURCE_DIR="abseil-cpp-$portVersion"
@@ -41,6 +41,7 @@ for lib in $libs; do
done
REQUIRES="
haiku$secondaryArchSuffix
lib:libstdc++$secondaryArchSuffix
"
PROVIDES_devel="

View File

@@ -1,4 +1,4 @@
From 1c0c5b773743002bddd25fd838a152ae807eadfd Mon Sep 17 00:00:00 2001
From f3b4fcd4a4708043c17561d0a0125b1836e1ed40 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 2 Feb 2022 15:04:07 +1000
Subject: Disable dynamic symbol lookup for in-memory Elf images
@@ -20,3 +20,39 @@ index a894bd4..949aef7 100644
--
2.30.2
From 9489bf748dbfa4f6fde91c4a6ca063f21df0ba9c Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 20 May 2022 09:39:12 +0200
Subject: use __thread instead of thread_local
diff --git a/absl/strings/internal/cordz_functions.cc b/absl/strings/internal/cordz_functions.cc
index 20d314f..b1e6cc3 100644
--- a/absl/strings/internal/cordz_functions.cc
+++ b/absl/strings/internal/cordz_functions.cc
@@ -40,7 +40,7 @@ std::atomic<int> g_cordz_mean_interval(50000);
// Special negative 'not initialized' per thread value for cordz_next_sample.
static constexpr int64_t kInitCordzNextSample = -1;
-ABSL_CONST_INIT thread_local int64_t cordz_next_sample = kInitCordzNextSample;
+ABSL_CONST_INIT __thread int64_t cordz_next_sample = kInitCordzNextSample;
// kIntervalIfDisabled is the number of profile-eligible events need to occur
// before the code will confirm that cordz is still disabled.
diff --git a/absl/strings/internal/cordz_functions.h b/absl/strings/internal/cordz_functions.h
index c9ba145..17f6535 100644
--- a/absl/strings/internal/cordz_functions.h
+++ b/absl/strings/internal/cordz_functions.h
@@ -53,7 +53,7 @@ void set_cordz_mean_interval(int32_t mean_interval);
// the value is 1 or less, the code will check on the next event if cordz is
// enabled, and if so, will sample the Cord. cordz is only enabled when we can
// use thread locals.
-ABSL_CONST_INIT extern thread_local int64_t cordz_next_sample;
+ABSL_CONST_INIT extern __thread int64_t cordz_next_sample;
// Determines if the next sample should be profiled. If it is, the value pointed
// at by next_sample will be set with the interval until the next sample.
--
2.30.2