]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
win32_deps_build.sh: avoid duplicate boost definitions 51197/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 18 Aug 2023 13:10:59 +0000 (13:10 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 30 Aug 2023 14:21:21 +0000 (14:21 +0000)
Boost stacktrace defines a few UUIDs that were recently added
to mingw as well [1], causing compilation errors [2]:

  In file included from libs/stacktrace/build/../src/windbg.cpp:9:
  ./boost/stacktrace/detail/frame_msvc.ipp:31:5: error: redefinition of
    '__mingw_uuidof_s<IDebugClient>'
    __CRT_UUID_DECL(IDebugClient,0x27fe5639,...

We'll apply a fix that hasn't merged upsteam yet [3].

[1] https://github.com/mirror/mingw-w64/commit/ce5a9f624dfc691082dad2ea2af7b1985e3476b5
[2] https://github.com/boostorg/stacktrace/issues/133
[3] https://github.com/boostorg/stacktrace/pull/140

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
win32_deps_build.sh

index a4ef7f43965ec8f557dd32d1da0e2bedb54043e0..adc34a018344180aeaea201190d06e27d16ade7f 100755 (executable)
@@ -235,6 +235,27 @@ patch -N boost/thread/pthread/thread_data.hpp <<EOL
  #endif
 EOL
 
+# https://github.com/boostorg/stacktrace/pull/140
+# https://github.com/boostorg/stacktrace/issues/133
+patch -N boost/stacktrace/detail/frame_msvc.ipp <<'EOL'
+--- boost/stacktrace/detail/frame_msvc.ipp      2023-08-18 12:29:37.127229733 +0000
++++ boost/stacktrace/detail/frame_msvc.ipp.new  2023-08-18 12:28:23.713294554 +0000
+@@ -28,9 +28,13 @@
+
+
+ #ifdef __CRT_UUID_DECL // for __MINGW32__
++#if !defined(__MINGW32__) || \
++    (!defined(__clang__) && __GNUC__ < 12) || \
++    (defined(__clang__) && __clang_major__ < 16)
+     __CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8)
+     __CRT_UUID_DECL(IDebugControl,0x5182e668,0x105e,0x416e,0xad,0x92,0x24,0xef,0x80,0x04,0x24,0xba)
+     __CRT_UUID_DECL(IDebugSymbols,0x8c31e98c,0x983a,0x48a5,0x90,0x16,0x6f,0xe5,0xd6,0x67,0xa9,0x50)
++#endif
+ #elif defined(DEFINE_GUID) && !defined(BOOST_MSVC)
+     DEFINE_GUID(IID_IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8);
+     DEFINE_GUID(IID_IDebugControl,0x5182e668,0x105e,0x416e,0xad,0x92,0x24,0xef,0x80,0x04,0x24,0xba);
+EOL
+
 ./bootstrap.sh
 
 if [[ $ENABLE_SHARED == "ON" ]]; then