Skip to content

Commit

Permalink
Patch Boost.SmartPtr 1.79.0 to support a specific variant of PowerPC
Browse files Browse the repository at this point in the history
This patch adds support for CodeWarrior / PowerPC platforms which support the `msync` instead of the `sync` assembly instruction.
This change has been fixed upstream in Boost.SmartPtr by boostorg/smart_ptr#95.
THe change should be included in an upcoming upstream release.
  • Loading branch information
jwillikers committed Jul 10, 2022
1 parent 7e662af commit b0b23e0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions recipes/boost/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,5 @@ patches:
base_path: "source_subfolder"
- patch_file: "patches/1.79.0-0001-json-array-erase-relocate.patch"
base_path: "source_subfolder"
- patch_file: "patches/1.79.0-smart_ptr_cw_ppc_msync.patch"
base_path: "source_subfolder"
25 changes: 25 additions & 0 deletions recipes/boost/all/patches/1.79.0-smart_ptr_cw_ppc_msync.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp b/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp
index 81387ce..58a69e6 100644
--- a/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp
+++ b/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp
@@ -35,8 +35,6 @@ BOOST_PRAGMA_MESSAGE("Using CodeWarrior/PowerPC sp_counted_base")

#endif

-BOOST_SP_OBSOLETE()
-
namespace boost
{

@@ -64,7 +62,11 @@ inline long atomic_decrement( register long * pw )

asm
{
+#if defined(__PPCZen__) || defined(__PPCe500__) || defined(__PPCe500v2__)
+ msync
+#else
sync
+#endif

loop:

0 comments on commit b0b23e0

Please sign in to comment.