From 5ca543605bc7a286a3b41e32c8e5277d3b73b835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Fri, 14 May 2021 18:45:17 +0200 Subject: [PATCH 1/4] [core] prevent errors for impossible loops in template expansion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this gcc 10.2.0 complains about the loops condition never to be true with the following error: src/mbgl/style/expression/compound_expression.cpp: In instantiation of ‘mbgl::style::expression::EvaluationResult mbgl::style::expression::detail::Signature::applyImpl(const mbgl::style::expression::EvaluationContext&, const Args&, std::index_sequence) const [with long unsigned int ...I = {}; R = mbgl::style::expression::Result; Params = {}; mbgl::style::expression::detail::SignatureBase::Args = std::vector >; std::index_sequence = std::integer_sequence]’: src/mbgl/style/expression/compound_expression.cpp:154:25: required from ‘mbgl::style::expression::EvaluationResult mbgl::style::expression::detail::Signature::apply(const mbgl::style::expression::EvaluationContext&, const Args&) const [with R = mbgl::style::expression::Result; Params = {}; mbgl::style::expression::detail::SignatureBase::Args = std::vector >]’ src/mbgl/style/expression/compound_expression.cpp:153:22: required from here src/mbgl/style/expression/compound_expression.cpp:161:35: error: comparison of unsigned expression in ‘< 0’ is always false [-Werror=type-limits] 161 | for (std::size_t i = 0; i < sizeof...(Params); ++i) { | ~~^~~~~~~~~~~~~~~~~~~ --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad989ba8386..74314c332aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ target_compile_options( $<$:-Wno-error=maybe-uninitialized> $<$:-Wno-error=return-type> $<$:-Wno-error=unknown-pragmas> + $<$:-Wno-error=type-limits> $<$:-Wno-error=deprecated-declarations> $<$:-Wno-error=unused-parameter> $<$:-Wno-error=unused-property-ivar> From 24cf632cdbc20137b7570361dd8387e5c72410ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Fri, 14 May 2021 18:55:31 +0200 Subject: [PATCH 2/4] [core] include for exception_ptr This is needed for gcc 11.1.0 --- include/mbgl/util/string.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/mbgl/util/string.hpp b/include/mbgl/util/string.hpp index 27c3943c5f0..66ad7cfda77 100644 --- a/include/mbgl/util/string.hpp +++ b/include/mbgl/util/string.hpp @@ -3,6 +3,7 @@ #include #include #include +#include // Polyfill needed by Qt when building for Android with GCC #if defined(__ANDROID__) && defined(__GLIBCXX__) From b95a3d9444e968b7750e24aa98998459033439c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Fri, 14 May 2021 19:02:52 +0200 Subject: [PATCH 3/4] [build] Bump benchmark to v1.5.3 Fixes the compilation with gcc 11.1.0 --- vendor/benchmark | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/benchmark b/vendor/benchmark index 090faecb454..c05843a9f62 160000 --- a/vendor/benchmark +++ b/vendor/benchmark @@ -1 +1 @@ -Subproject commit 090faecb454fbd6e6e17a75ef8146acb037118d4 +Subproject commit c05843a9f622db08ad59804c190f98879b76beba From 647e53bccc9803320897c60a444c0fa75069e4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Fri, 14 May 2021 19:33:01 +0200 Subject: [PATCH 4/4] [build] explicitly link with pthreads This fixes the following error encountered with gcc 11.1.0: /usr/bin/ld: ../libmbgl-core.a(thread.cpp.o): undefined reference to symbol 'pthread_setname_np@@GLIBC_2.12' /usr/bin/ld: /usr/lib/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status --- CMakeLists.txt | 3 +++ scripts/license.cmake | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 74314c332aa..c8b3ebf056c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -973,6 +973,8 @@ include(${PROJECT_SOURCE_DIR}/vendor/unique_resource.cmake) include(${PROJECT_SOURCE_DIR}/vendor/vector-tile.cmake) include(${PROJECT_SOURCE_DIR}/vendor/wagyu.cmake) +find_package(Threads REQUIRED) + target_link_libraries( mbgl-core PRIVATE @@ -992,6 +994,7 @@ target_link_libraries( mbgl-vendor-unique_resource mbgl-vendor-vector-tile mbgl-vendor-wagyu + Threads::Threads PUBLIC Mapbox::Base Mapbox::Base::Extras::expected-lite diff --git a/scripts/license.cmake b/scripts/license.cmake index e3a7d2aaa48..8c03fb205c5 100644 --- a/scripts/license.cmake +++ b/scripts/license.cmake @@ -2,7 +2,7 @@ function(mbgl_generate_license param) # Fake targets or non relevant. - set(BLACKLIST "mbgl-compiler-options") + set(BLACKLIST "mbgl-compiler-options" "Threads::Threads") get_target_property(LIBRARIES ${param} LINK_LIBRARIES) list(INSERT LIBRARIES 0 ${param})