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

boost: fix layout=versioned for clang@Macos + mingw@Windows #8332

Merged
merged 2 commits into from
Dec 10, 2021
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
2 changes: 2 additions & 0 deletions recipes/boost/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,5 @@ patches:
base_path: "source_subfolder"
- patch_file: "patches/1.77.0-type_erasure-no-system.patch"
base_path: "source_subfolder"
- patch_file: "patches/1.77.0-fiber-mingw.patch"
base_path: "source_subfolder"
34 changes: 25 additions & 9 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ def _toolset_version(self):
toolset = tools.msvs_toolset(self)
match = re.match(r"v(\d+)(\d)$", toolset)
if match:
return "%s.%s" % (match.group(1), match.group(2))
return "{}.{}".format(match.group(1), match.group(2))
return ""

@property
Expand Down Expand Up @@ -1273,14 +1273,30 @@ def _toolset(self):

@property
def _toolset_tag(self):
if self._is_msvc:
return "vc{}".format(self._toolset_version.replace(".",""))
else:
# FIXME: missing toolset tags for compilers (see self._toolset)
compiler = str(self.settings.compiler)
if self.settings.compiler == "apple-clang":
compiler = "darwin"
return "{}{}".format(compiler, self.settings.compiler.version)
# compiler | compiler.version | os | toolset_tag | remark
# ---------------+------------------+-------------+----------------+-----------------------------
# apple-clang | 12 | Macos | darwin12 |
# clang | 12 | Macos | clang-darwin12 |
# gcc | 11 | Linux | gcc8 |
# gcc | 8 | Windows | mgw8 |
# Visual Studio | 17 | Windows | vc142 | depends on compiler.toolset
compiler = {
"apple-clang": "",
"msvc": "vc",
"Visual Studio": "vc",
}.get(str(self.settings.compiler), str(self.settings.compiler))
if (self.settings.compiler, self.settings.os) == ("gcc", "Windows"):
compiler = "mgw"
os_ = ""
if self.settings.os == "Macos":
os_ = "darwin"
toolset_version = str(tools.Version(self.settings.compiler.version).major)
if self.settings.compiler in ("msvc", "Visual Studio"):
toolset_version = self._toolset_version.replace(".", "")

toolset_parts = [compiler, os_]
toolset_tag = "-".join(part for part in toolset_parts if part) + toolset_version
return toolset_tag

####################################################################

Expand Down
20 changes: 20 additions & 0 deletions recipes/boost/all/patches/1.77.0-fiber-mingw.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- libs/fiber/src/numa/windows/pin_thread.cpp
+++ libs/fiber/src/numa/windows/pin_thread.cpp
@@ -23,7 +23,7 @@

BOOST_FIBERS_DECL
void pin_thread( std::uint32_t cpuid) {
- pin_thread( cpuid, ::GetCurrentThread() );
+ pin_thread( cpuid, reinterpret_cast< std::thread::native_handle_type >(::GetCurrentThread()));
}

BOOST_FIBERS_DECL
@@ -37,7 +37,7 @@
uint32_t id = cpuid % 64;
// set the bit mask of the logical CPU
affinity.Mask = static_cast< KAFFINITY >( 1) << id;
- if ( BOOST_UNLIKELY( 0 == ::SetThreadGroupAffinity( h, & affinity, nullptr) ) ) {
+ if ( BOOST_UNLIKELY( 0 == ::SetThreadGroupAffinity( reinterpret_cast< HANDLE >(h), & affinity, nullptr) ) ) {
throw std::system_error(
std::error_code( ::GetLastError(), std::system_category() ),
"::SetThreadiGroupAffinity() failed");