Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninline Mutex::Dtor also on linux #76

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@ source:
url: https://github.com/abseil/abseil-cpp/archive/refs/tags/{{ version }}.tar.gz
sha256: 3c743204df78366ad2eaf236d6631d83f6bc928d1705dd0000b872e53b73dc6a
patches:
- patches/0001-patch-out-the-build-issue-on-clang4-osx.patch
- patches/0002-remove-ignore-4221-from-ABSL_MSVC_LINKOPTS.patch
- patches/0003-add-missing-osx-workaround.patch
# Helps downstream packages import the dll without an extra define
# https://github.com/conda-forge/abseil-cpp-feedstock/issues/43#issuecomment-1242969515
- patches/0004-default-dll-import-for-windows.patch
- patches/0001-default-dll-import-for-windows.patch
# avoid that compilation in C++20 mode changes the ABI vs. C++17
- patches/0005-don-t-use-C-20-stdlib-features-which-change-ABI-comp.patch
- patches/0002-don-t-use-C-20-stdlib-features-which-change-ABI-comp.patch
# workaround for https://github.com/abseil/abseil-cpp/issues/1624
- patches/0003-unconditionally-export-Mutex-Destructor.patch

build:
number: 0
number: 1

outputs:
# default behaviour is shared; however note that upstream does not support
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a023e403af16c99eb25ba5c476bb19edc0df6d6f Mon Sep 17 00:00:00 2001
From 3b5410d4e955b5b6a6c90abd3a6f02c045a43326 Mon Sep 17 00:00:00 2001
From: Mark Harfouche <mark.harfouche@gmail.com>
Date: Sun, 11 Sep 2022 10:32:19 -0400
Subject: [PATCH 4/5] default dll import for windows
Subject: [PATCH 1/3] default dll import for windows

---
absl/base/config.h | 5 ++---
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c27c0ea092f6a67160f5398a1a85e95969ed153f Mon Sep 17 00:00:00 2001
From 9981632d5efba83f55ed357650b3a88ec6d7acaf Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Wed, 7 Feb 2024 17:07:42 +0100
Subject: [PATCH 5/5] don't use C++20 stdlib-features which change ABI compared
Subject: [PATCH 2/3] don't use C++20 stdlib-features which change ABI compared
to C++17 baseline

---
Expand Down

This file was deleted.

24 changes: 0 additions & 24 deletions recipe/patches/0003-add-missing-osx-workaround.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From 647571e5e81f28e39fec55bf41ace4114a96d76b Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Tue, 13 Feb 2024 08:43:06 +0100
Subject: [PATCH 3/3] unconditionally export Mutex Destructor

---
absl/synchronization/mutex.cc | 2 --
absl/synchronization/mutex.h | 5 -----
2 files changed, 7 deletions(-)

diff --git a/absl/synchronization/mutex.cc b/absl/synchronization/mutex.cc
index cb3c7e74..76d561df 100644
--- a/absl/synchronization/mutex.cc
+++ b/absl/synchronization/mutex.cc
@@ -731,12 +731,10 @@ static unsigned TsanFlags(Mutex::MuHow how) {
}
#endif

-#if defined(__APPLE__) || defined(ABSL_BUILD_DLL)
// When building a dll symbol export lists may reference the destructor
// and want it to be an exported symbol rather than an inline function.
// Some apple builds also do dynamic library build but don't say it explicitly.
Mutex::~Mutex() { Dtor(); }
-#endif

#if !defined(NDEBUG) || defined(ABSL_HAVE_THREAD_SANITIZER)
void Mutex::Dtor() {
diff --git a/absl/synchronization/mutex.h b/absl/synchronization/mutex.h
index d53a22bb..2cd5a1e4 100644
--- a/absl/synchronization/mutex.h
+++ b/absl/synchronization/mutex.h
@@ -1064,11 +1064,6 @@ inline Mutex::Mutex() : mu_(0) {

inline constexpr Mutex::Mutex(absl::ConstInitType) : mu_(0) {}

-#if !defined(__APPLE__) && !defined(ABSL_BUILD_DLL)
-ABSL_ATTRIBUTE_ALWAYS_INLINE
-inline Mutex::~Mutex() { Dtor(); }
-#endif
-
#if defined(NDEBUG) && !defined(ABSL_HAVE_THREAD_SANITIZER)
// Use default (empty) destructor in release build for performance reasons.
// We need to mark both Dtor and ~Mutex as always inline for inconsistent