Skip to content

Commit 3cf1da7

Browse files
Merge branch 'master' into deprecate-in-memory-parts
2 parents 27e1357 + 6c02b6b commit 3cf1da7

File tree

282 files changed

+3013
-5523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+3013
-5523
lines changed

CMakeLists.txt

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if (ENABLE_CHECK_HEAVY_BUILDS)
5757
# set CPU time limit to 1000 seconds
5858
set (RLIMIT_CPU 1000)
5959

60-
# gcc10/gcc10/clang -fsanitize=memory is too heavy
60+
# -fsanitize=memory is too heavy
6161
if (SANITIZE STREQUAL "memory")
6262
set (RLIMIT_DATA 10000000000) # 10G
6363
endif()
@@ -280,7 +280,7 @@ set (CMAKE_C_STANDARD 11)
280280
set (CMAKE_C_EXTENSIONS ON) # required by most contribs written in C
281281
set (CMAKE_C_STANDARD_REQUIRED ON)
282282

283-
# Compiler-specific coverage flags e.g. -fcoverage-mapping for gcc
283+
# Compiler-specific coverage flags e.g. -fcoverage-mapping
284284
option(WITH_COVERAGE "Profile the resulting binary/binaries" OFF)
285285

286286
if (COMPILER_CLANG)
@@ -522,6 +522,26 @@ include (cmake/print_flags.cmake)
522522

523523
if (ENABLE_RUST)
524524
add_subdirectory (rust)
525+
526+
# With LTO Rust adds few symbols with global visiblity, the most common is
527+
# rust_eh_personality. And this leads to linking errors because multiple
528+
# Rust libraries contains the same symbol.
529+
#
530+
# If it was shared library, that we could use version script for linker to
531+
# hide this symbols, but libraries are static.
532+
#
533+
# we could in theory compile everything to one library but this will be a
534+
# mess
535+
#
536+
# But this should be OK since CI has lots of other builds that are done
537+
# without LTO and it will find multiple definitions if there will be any.
538+
#
539+
# More information about this behaviour in Rust can be found here
540+
# - https://github.com/rust-lang/rust/issues/44322
541+
# - https://alanwu.space/post/symbol-hygiene/
542+
if (ENABLE_THINLTO)
543+
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--allow-multiple-definition")
544+
endif()
525545
endif()
526546

527547
add_subdirectory (base)

base/base/defines.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,6 @@
7373
# endif
7474
#endif
7575

76-
#if defined(ADDRESS_SANITIZER)
77-
# define BOOST_USE_ASAN 1
78-
# define BOOST_USE_UCONTEXT 1
79-
#endif
80-
81-
#if defined(THREAD_SANITIZER)
82-
# define BOOST_USE_TSAN 1
83-
# define BOOST_USE_UCONTEXT 1
84-
#endif
85-
86-
/// TODO: Strange enough, there is no way to detect UB sanitizer.
87-
8876
/// Explicitly allow undefined behaviour for certain functions. Use it as a function attribute.
8977
/// It is useful in case when compiler cannot see (and exploit) it, but UBSan can.
9078
/// Example: multiplication of signed integers with possibility of overflow when both sides are from user input.

base/poco/Foundation/include/Poco/Config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454

5555
// Define if no <locale> header is available (such as on WinCE)
56-
// #define POCO_NO_LOCALE
56+
#define POCO_NO_LOCALE
5757

5858

5959
// Define to desired default thread stack size

base/poco/Foundation/include/Poco/NumericString.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
#include <cctype>
3131
#include <cmath>
3232
#include <limits>
33-
#if !defined(POCO_NO_LOCALE)
34-
# include <locale>
35-
#endif
3633

3734

3835
// binary numbers are supported, thus 64 (bits) + 1 (string terminating zero)
@@ -53,23 +50,15 @@ inline char decimalSeparator()
5350
/// Returns decimal separator from global locale or
5451
/// default '.' for platforms where locale is unavailable.
5552
{
56-
#if !defined(POCO_NO_LOCALE)
57-
return std::use_facet<std::numpunct<char>>(std::locale()).decimal_point();
58-
#else
5953
return '.';
60-
#endif
6154
}
6255

6356

6457
inline char thousandSeparator()
6558
/// Returns thousand separator from global locale or
6659
/// default ',' for platforms where locale is unavailable.
6760
{
68-
#if !defined(POCO_NO_LOCALE)
69-
return std::use_facet<std::numpunct<char>>(std::locale()).thousands_sep();
70-
#else
7161
return ',';
72-
#endif
7362
}
7463

7564

base/poco/Foundation/src/Format.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
#include "Poco/Exception.h"
1717
#include "Poco/Ascii.h"
1818
#include <sstream>
19-
#if !defined(POCO_NO_LOCALE)
20-
#include <locale>
21-
#endif
2219
#include <cstddef>
2320

2421

@@ -147,9 +144,6 @@ namespace
147144
void formatOne(std::string& result, std::string::const_iterator& itFmt, const std::string::const_iterator& endFmt, std::vector<Any>::const_iterator& itVal)
148145
{
149146
std::ostringstream str;
150-
#if !defined(POCO_NO_LOCALE)
151-
str.imbue(std::locale::classic());
152-
#endif
153147
try
154148
{
155149
parseFlags(str, itFmt, endFmt);

base/poco/Foundation/src/NumberFormatter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
#include "Poco/NumberFormatter.h"
1616
#include "Poco/MemoryStream.h"
1717
#include <iomanip>
18-
#if !defined(POCO_NO_LOCALE)
19-
#include <locale>
20-
#endif
2118
#include <cstdio>
2219

2320

base/poco/Foundation/src/NumberParser.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
#include <cstdio>
2020
#include <cctype>
2121
#include <stdlib.h>
22-
#if !defined(POCO_NO_LOCALE)
23-
#include <locale>
24-
#endif
2522

2623

2724
#if defined(POCO_LONG_IS_64_BIT)

cmake/ccache.cmake

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,19 @@ if (CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache" OR CMAKE_C_COMPILER_LAUNCHER MA
99
return()
1010
endif()
1111

12-
set(ENABLE_CCACHE "default" CACHE STRING "Deprecated, use COMPILER_CACHE=(auto|ccache|sccache|disabled)")
13-
if (NOT ENABLE_CCACHE STREQUAL "default")
14-
message(WARNING "The -DENABLE_CCACHE is deprecated in favor of -DCOMPILER_CACHE")
15-
endif()
16-
1712
set(COMPILER_CACHE "auto" CACHE STRING "Speedup re-compilations using the caching tools; valid options are 'auto' (ccache, then sccache), 'ccache', 'sccache', or 'disabled'")
1813

19-
# It has pretty complex logic, because the ENABLE_CCACHE is deprecated, but still should
20-
# control the COMPILER_CACHE
21-
# After it will be completely removed, the following block will be much simpler
22-
if (COMPILER_CACHE STREQUAL "ccache" OR (ENABLE_CCACHE AND NOT ENABLE_CCACHE STREQUAL "default"))
23-
find_program (CCACHE_EXECUTABLE ccache)
24-
elseif(COMPILER_CACHE STREQUAL "disabled" OR NOT ENABLE_CCACHE STREQUAL "default")
25-
message(STATUS "Using *ccache: no (disabled via configuration)")
26-
return()
27-
elseif(COMPILER_CACHE STREQUAL "auto")
14+
if(COMPILER_CACHE STREQUAL "auto")
2815
find_program (CCACHE_EXECUTABLE ccache sccache)
16+
elseif (COMPILER_CACHE STREQUAL "ccache")
17+
find_program (CCACHE_EXECUTABLE ccache)
2918
elseif(COMPILER_CACHE STREQUAL "sccache")
3019
find_program (CCACHE_EXECUTABLE sccache)
20+
elseif(COMPILER_CACHE STREQUAL "disabled")
21+
message(STATUS "Using *ccache: no (disabled via configuration)")
22+
return()
3123
else()
32-
message(${RECONFIGURE_MESSAGE_LEVEL} "The COMPILER_CACHE must be one of (auto|ccache|sccache|disabled), given '${COMPILER_CACHE}'")
24+
message(${RECONFIGURE_MESSAGE_LEVEL} "The COMPILER_CACHE must be one of (auto|ccache|sccache|disabled), value: '${COMPILER_CACHE}'")
3325
endif()
3426

3527

contrib/boost-cmake/CMakeLists.txt

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ add_library (boost::system ALIAS _boost_system)
9292
target_include_directories (_boost_system PRIVATE ${LIBRARY_DIR})
9393

9494
# context
95+
option (BOOST_USE_UCONTEXT "Use ucontext_t for context switching of boost::fiber within boost::context" OFF)
96+
9597
enable_language(ASM)
9698
SET(ASM_OPTIONS "-x assembler-with-cpp")
9799

@@ -100,20 +102,6 @@ set (SRCS_CONTEXT
100102
"${LIBRARY_DIR}/libs/context/src/posix/stack_traits.cpp"
101103
)
102104

103-
if (SANITIZE AND (SANITIZE STREQUAL "address" OR SANITIZE STREQUAL "thread"))
104-
add_compile_definitions(BOOST_USE_UCONTEXT)
105-
106-
if (SANITIZE STREQUAL "address")
107-
add_compile_definitions(BOOST_USE_ASAN)
108-
elseif (SANITIZE STREQUAL "thread")
109-
add_compile_definitions(BOOST_USE_TSAN)
110-
endif()
111-
112-
set (SRCS_CONTEXT ${SRCS_CONTEXT}
113-
"${LIBRARY_DIR}/libs/context/src/fiber.cpp"
114-
"${LIBRARY_DIR}/libs/context/src/continuation.cpp"
115-
)
116-
endif()
117105
if (ARCH_AARCH64)
118106
set (SRCS_CONTEXT ${SRCS_CONTEXT}
119107
"${LIBRARY_DIR}/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S"
@@ -152,10 +140,27 @@ else()
152140
)
153141
endif()
154142

143+
if (SANITIZE OR BOOST_USE_UCONTEXT)
144+
list (APPEND SRCS_CONTEXT
145+
"${LIBRARY_DIR}/libs/context/src/fiber.cpp"
146+
"${LIBRARY_DIR}/libs/context/src/continuation.cpp"
147+
)
148+
endif()
149+
155150
add_library (_boost_context ${SRCS_CONTEXT})
156151
add_library (boost::context ALIAS _boost_context)
157152
target_include_directories (_boost_context PRIVATE ${LIBRARY_DIR})
158153

154+
if (SANITIZE OR BOOST_USE_UCONTEXT)
155+
target_compile_definitions(_boost_context PUBLIC BOOST_USE_UCONTEXT)
156+
endif()
157+
158+
if (SANITIZE STREQUAL "address")
159+
target_compile_definitions(_boost_context PUBLIC BOOST_USE_ASAN)
160+
elseif (SANITIZE STREQUAL "thread")
161+
target_compile_definitions(_boost_context PUBLIC BOOST_USE_TSAN)
162+
endif()
163+
159164
# coroutine
160165

161166
set (SRCS_COROUTINE

contrib/llvm-project

0 commit comments

Comments
 (0)