Skip to content

Commit 9cb1b45

Browse files
committed
Commit oneTBB source code 95f9511
1 parent a00cc3b commit 9cb1b45

File tree

101 files changed

+3563
-1620
lines changed

Some content is hidden

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

101 files changed

+3563
-1620
lines changed

.github/labeler.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2023 Intel Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
allocator:
16+
- 'src/tbbmalloc/**/*'
17+
- 'src/tbbmalloc_proxy/**/*'
18+
- 'test/tbbmalloc/**/*'

.github/workflows/ci.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021-2022 Intel Corporation
1+
# Copyright (c) 2021-2023 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -65,6 +65,7 @@ jobs:
6565
run: |
6666
pip3 install -U Jinja2
6767
pip3 install git+https://github.com/executablebooks/sphinx-book-theme.git
68+
pip3 install sphinx-tabs
6869
echo GITHUB_SHA_SHORT=${GITHUB_SHA::8} >> $GITHUB_ENV
6970
mkdir html
7071
- name: Build documentation
@@ -126,8 +127,8 @@ jobs:
126127
cat years.diff
127128
exit 1
128129
fi
129-
python_module_test_ubuntu18-04:
130-
runs-on: [ubuntu-18.04]
130+
python_module_test_ubuntu_latest:
131+
runs-on: [ubuntu-latest]
131132
timeout-minutes: 15
132133
steps:
133134
- uses: actions/checkout@v2
@@ -146,7 +147,7 @@ jobs:
146147
fail-fast: false
147148
matrix:
148149
include:
149-
- os: ubuntu-18.04
150+
- os: ubuntu-latest
150151
c_compiler: gcc
151152
cxx_compiler: g++
152153
std: 14
@@ -246,7 +247,7 @@ jobs:
246247
fail-fast: false
247248
matrix:
248249
include:
249-
- os: ubuntu-18.04
250+
- os: ubuntu-latest
250251
c_compiler: gcc
251252
cxx_compiler: g++
252253
std: 14

.github/workflows/labeler.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2023 Intel Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
name: "Pull Request Labeler"
15+
on:
16+
- pull_request_target
17+
18+
jobs:
19+
triage:
20+
permissions:
21+
contents: read
22+
pull-requests: write
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/labeler@v4
26+

CMakeLists.txt

+23-1
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,32 @@ if (NOT DEFINED BUILD_SHARED_LIBS)
112112
endif()
113113

114114
if (NOT BUILD_SHARED_LIBS)
115-
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
115+
if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
116+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
117+
endif()
116118
message(WARNING "You are building oneTBB as a static library. This is highly discouraged and such configuration is not supported. Consider building a dynamic library to avoid unforeseen issues.")
117119
endif()
118120

121+
# Prevent searching HWLOC by pkg-config on macOS
122+
if (APPLE)
123+
set(TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH ON)
124+
endif()
125+
119126
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
120127
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type" FORCE)
121128
message(STATUS "CMAKE_BUILD_TYPE is not specified. Using default: ${CMAKE_BUILD_TYPE}")
122129
# Possible values of build type for cmake-gui
123130
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
124131
endif()
125132

133+
if (CMAKE_BUILD_TYPE)
134+
string(TOLOWER ${CMAKE_BUILD_TYPE} _tbb_build_type)
135+
if (_tbb_build_type STREQUAL "debug")
136+
set(TBB_ENABLE_IPO OFF)
137+
endif()
138+
unset(_tbb_build_type)
139+
endif()
140+
126141
# -------------------------------------------------------------------
127142
# Files and folders naming
128143
set(CMAKE_DEBUG_POSTFIX _debug)
@@ -171,6 +186,13 @@ foreach(output_type LIBRARY ARCHIVE PDB RUNTIME)
171186
endif()
172187
endforeach()
173188

189+
if (CMAKE_CONFIGURATION_TYPES)
190+
# We can't use generator expressions in a cmake variable name.
191+
set(TBB_TEST_WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${TBB_OUTPUT_DIR_BASE}_$<LOWER_CASE:$<CONFIG>>)
192+
else()
193+
set(TBB_TEST_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
194+
endif()
195+
174196
# -------------------------------------------------------------------
175197

176198
# -------------------------------------------------------------------

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Here are [Release Notes](RELEASE_NOTES.md) and [System Requirements](SYSTEM_REQU
3333
* [oneTBB Testing Approach](https://oneapi-src.github.io/oneTBB/main/intro/testing_approach.html)
3434
* [Basic support for the Bazel build system](Bazel.md)
3535
* [oneTBB Discussions](https://github.com/oneapi-src/oneTBB/discussions)
36+
* [WASM Support](WASM_Support.md)
3637

3738
## Installation
3839
See [Installation from Sources](INSTALL.md) to learn how to install oneTBB.

RELEASE_NOTES.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,32 @@
1818
This document contains changes of oneTBB compared to the last release.
1919

2020
## Table of Contents <!-- omit in toc -->
21+
- [New Features](#new-features)
2122
- [Known Limitations](#known-limitations)
2223
- [Fixed Issues](#fixed-issues)
2324
- [Open-source Contributions Integrated](#open-source-contributions-integrated)
2425

26+
## :tada: New Features
27+
- Hybrid CPU support is now a fully supported feature.
28+
2529
## :rotating_light: Known Limitations
26-
- A static assert causes compilation failures in oneTBB headers when compiling with Clang* 12.0.0 or newer if using the LLVM* standard library with -ffreestanding and C++11/14 compiler options.
30+
- A static assert will cause compilation failures in oneTBB headers when compiling with clang 12.0.0 or newer if using the LLVM standard library with -ffreestanding and C++11/14 compiler options.
2731
- An application using Parallel STL algorithms in libstdc++ versions 9 and 10 may fail to compile due to incompatible interface changes between earlier versions of Threading Building Blocks (TBB) and oneAPI Threading Building Blocks (oneTBB). Disable support for Parallel STL algorithms by defining PSTL_USE_PARALLEL_POLICIES (in libstdc++ 9) or _GLIBCXX_USE_TBB_PAR_BACKEND (in libstdc++ 10) macro to zero before inclusion of the first standard header file in each translation unit.
2832
- On Linux* OS, if oneAPI Threading Building Blocks (oneTBB) or Threading Building Blocks (TBB) are installed in a system folder like /usr/lib64, the application may fail to link due to the order in which the linker searches for libraries. Use the -L linker option to specify the correct location of oneTBB library. This issue does not affect the program execution.
2933
- The oneapi::tbb::info namespace interfaces might unexpectedly change the process affinity mask on Windows* OS systems (see https://github.com/open-mpi/hwloc/issues/366 for details) when using hwloc version lower than 2.5.
30-
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows* OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
34+
- Using a hwloc version other than 1.11, 2.0, or 2.5 may cause an undefined behavior on Windows OS. See https://github.com/open-mpi/hwloc/issues/477 for details.
3135
- The NUMA topology may be detected incorrectly on Windows OS machines where the number of NUMA node threads exceeds the size of 1 processor group.
3236
- On Windows OS on ARM64*, when compiling an application using oneTBB with the Microsoft* Compiler, the compiler issues a warning C4324 that a structure was padded due to the alignment specifier. Consider suppressing the warning by specifying /wd4324 to the compiler command line.
3337
- oneTBB does not support fork(), to work-around the issue, consider using task_scheduler_handle to join oneTBB worker threads before using fork().
3438
- C++ exception handling mechanism on Windows* OS on ARM64* might corrupt memory if an exception is thrown from any oneTBB parallel algorithm (see Windows* OS on ARM64* compiler issue: https://developercommunity.visualstudio.com/t/ARM64-incorrect-stack-unwinding-for-alig/1544293).
3539

3640
## :hammer: Fixed Issues
37-
- Memory allocator crash when allocating ~1TB on 64-bit systems (GitHub* [#838](https://github.com/oneapi-src/oneTBB/issues/838)).
38-
- Fixed thread distribution over NUMA nodes on Windows* OS systems.
39-
- For oneapi::tbb::suspend, it is guaranteed that the user-specified callable object is executed by the calling thread.
41+
- Improved robustness of thread creation algorithm on Linux* OS.
42+
- Enabled full support of Thread Sanitizer on macOS*
43+
- Fixed the issue with destructor calls for uninitialized objects in oneapi::tbb::parallel_for_each algorithm (GitHub* #691)
44+
- Fixed the issue with tbb::concurrent_lru_cache when items history capacity is zero (GitHub* #265)
45+
- Fixed compilation issues on modern GCC* versions
4046

4147
## :octocat: Open-source Contributions Integrated
42-
- Fix for full LTO* build, library and tests, on UNIX* OS systems. Contributed by Vladislav Shchapov (https://github.com/oneapi-src/oneTBB/pull/798).
48+
- Fixed the issue reported by the Address Sanitizer. Contributed by Rui Ueyama (https://github.com/oneapi-src/oneTBB/pull/959).
49+
- Fixed the input_type alias exposed by flow_graph::join_node. Contributed by Deepan (https://github.com/oneapi-src/oneTBB/pull/868).

SECURITY.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Security Policy
2+
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution,
3+
impact, severity and mitigation.
4+
5+
## Reporting a Vulnerability
6+
Please report any security vulnerabilities in this project
7+
[utilizing the guidelines here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).

SYSTEM_REQUIREMENTS.md

+33-19
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,37 @@ This document provides details about hardware, operating system, and software pr
2323
- [Supported Operating Systems](#supported-operating-systems)
2424
- [Community-Supported Platforms](#community-supported-platforms)
2525
- [Supported Compilers](#supported-compilers)
26+
- [Limitations](#limitations)
2627

2728

2829
## Supported Hardware
2930
- Intel(R) Celeron(R) processor family
3031
- Intel(R) Core* processor family
3132
- Intel(R) Xeon(R) processor family
32-
- Intel(R) Xeon Phi* processor family
3333
- Intel(R) Atom* processor family
3434
- Non-Intel(R) processors compatible with the processors listed above
3535

3636

3737
## Software
3838

3939
### Supported Operating Systems
40-
- Systems with Microsoft* Windows* operating systems
40+
- Systems with Microsoft* Windows* operating systems:
4141
- Microsoft* Windows* 10
42-
- Microsoft* Windows* Server 2016
42+
- Microsoft* Windows* 11
4343
- Microsoft* Windows* Server 2019
44-
- Systems with Linux* operating systems
45-
- Clear Linux*
46-
- Amazon* Linux 2
47-
- CentOS* 8
48-
- Debian* 10
49-
- Fedora* 34
50-
- Red Hat* Enterprise Linux* 7, 8
44+
- Microsoft* Windows* Server 2022
45+
- Systems with Linux* operating systems:
46+
- Oracle Linux* 8
47+
- Amazon* Linux* 2
48+
- Debian* 9, 10, 11
49+
- Fedora* 36, 37
50+
- Rocky* Linux* 9
51+
- Red Hat* Enterprise Linux* 8, 9
5152
- SuSE* Linux* Enterprise Server 15
52-
- Ubuntu* 18.04 LTS, 20.04, 21.04
53-
- Systems with macOS* operating systems
54-
- macOS* 10.15, 11.x
55-
- Systems with Android* operating systems
53+
- Ubuntu* 20.04, 22.04
54+
- Systems with macOS* operating systems:
55+
- macOS* 12.x, 13.x
56+
- Systems with Android* operating systems:
5657
- Android* 9
5758

5859
### Community-Supported Platforms
@@ -64,9 +65,22 @@ This document provides details about hardware, operating system, and software pr
6465
### Supported Compilers
6566
- Intel* oneAPI DPC++/C++ Compiler
6667
- Intel* C++ Compiler 19.0 and 19.1 version
67-
- Microsoft* Visual C++ 14.1 (Microsoft* Visual Studio* 2017, Windows* OS only)
6868
- Microsoft* Visual C++ 14.2 (Microsoft* Visual Studio* 2019, Windows* OS only)
69-
- For each supported Linux* operating system, the standard gcc version provided with that operating system is supported
70-
- GNU Compilers (gcc) 4.8.5 - 11.1.1
71-
- GNU C Library (glibc) version 2.17 - 2.33
72-
- Clang* 6.0.0 - 12.0.0
69+
- Microsoft* Visual C++ 14.3 (Microsoft* Visual Studio* 2022, Windows* OS only)
70+
- For each supported Linux* operating system, the standard gcc version provided with that operating system is supported:
71+
- GNU Compilers (gcc) 4.8.5 - 11.2.1
72+
- GNU C Library (glibc) version 2.17 - 2.34
73+
- Clang* 6.0.0 - 13.0.0
74+
75+
## Limitations
76+
There are some cases where we cannot provide support for your platforms. It includes:
77+
78+
1. The platform is out of official support (met end of life). When you use an unsupported platform, you can face a security risk that can be difficult to resolve.
79+
2. We do not have the infrastructure to test a platform. Therefore we cannot guarantee that oneTBB works correctly on that platform.
80+
3. Changes affect more code than just platform-specific macros.
81+
4. The platform is incompatible with oneTBB. Some platforms may have limitations that prevent oneTBB from working correctly. We cannot provide support in these cases as the issue is beyond our control.
82+
5. The platform is modified or customized. If you made significant updates to your platform, it might be hard for us to find the root cause of the issue. Therefore, we may not be able to provide support as the modification could affect the oneTBB functionality.
83+
84+
85+
We understand that these limitations can be frustrating. Thus, we suggest creating a branch specifically for the unsupported platform, allowing other users to contribute to or use your implementation.
86+

WASM_Support.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!--
2+
******************************************************************************
3+
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
*     http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*******************************************************************************/-->
16+
17+
# WASM Support
18+
19+
``WASM`` stands for WebAssembly, a low-level binary format for executing code in web browsers.
20+
It is designed to be a portable target for compilers and to be efficient to parse and execute.
21+
22+
WebAssembly aims to provide a fast, efficient, and safe way to run code in web browsers without needing plugins or other software. Code written in a variety of programming languages, including C, C++, Rust and others, can be compiled into WebAssembly format for use in web pages. This allows you to write high-performance applications that run directly in the browser.
23+
24+
We currently have an [under development branch that provides you with WASM support](https://github.com/oneapi-src/oneTBB/tree/tbb_wasm).
25+
26+
By using WASM, you can:
27+
* Create highly performant and scalable applications that can meet the demands of modern web-based systems.
28+
* Take advantage of oneTBB features to optimize the performance of your web-based applications.
29+
30+
31+

cmake/compilers/Clang.cmake

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2021 Intel Corporation
1+
# Copyright (c) 2020-2023 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ elseif (MSVC)
2727
else()
2828
set(TBB_LINK_DEF_FILE_FLAG -Wl,--version-script=)
2929
set(TBB_DEF_FILE_PREFIX lin${TBB_ARCH})
30+
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},10.0>>:-ffp-model=precise>)
3031
endif()
3132

3233
# Depfile options (e.g. -MD) are inserted automatically in some cases.
@@ -48,11 +49,14 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)")
4849
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},12.0>>:-mwaitpkg>)
4950
endif()
5051

52+
# Clang flags to prevent compiler from optimizing out security checks
53+
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security
54+
-fstack-protector-strong -fPIC)
55+
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now)
56+
5157
set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
5258

53-
if (ANDROID_PLATFORM)
54-
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
55-
endif()
59+
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>)
5660

5761
if (MINGW)
5862
list(APPEND TBB_COMMON_COMPILE_FLAGS -U__STRICT_ANSI__)

cmake/compilers/GNU.cmake

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ endif()
5252
if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Intel)
5353
# gcc 6.0 and later have -flifetime-dse option that controls elimination of stores done outside the object lifetime
5454
set(TBB_DSE_FLAG $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},6.0>>:-flifetime-dse=1>)
55+
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fstack-clash-protection>)
5556
endif()
5657

5758
# Workaround for heavy tests and too many symbols in debug (rellocation truncated to fit: R_MIPS_CALL16)
@@ -70,6 +71,11 @@ endif ()
7071

7172
# Gnu flags to prevent compiler from optimizing out security checks
7273
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv)
74+
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security
75+
-fstack-protector-strong )
76+
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now,-z,noexecstack)
77+
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2> )
78+
7379

7480
# TBB malloc settings
7581
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)

cmake/compilers/Intel.cmake

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2021 Intel Corporation
1+
# Copyright (c) 2020-2023 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -26,10 +26,8 @@ elseif (APPLE)
2626
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-ipo>)
2727
else()
2828
include(${CMAKE_CURRENT_LIST_DIR}/GNU.cmake)
29-
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -static-intel -Wl,-z,relro,-z,now,)
30-
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fstack-protector -Wformat -Wformat-security
31-
$<$<NOT:$<CONFIG:Debug>>:-qno-opt-report-embed -D_FORTIFY_SOURCE=2>
32-
$<$<EQUAL:${TBB_ARCH},32>:-falign-stack=maintain-16-byte>)
29+
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<EQUAL:${TBB_ARCH},32>:-falign-stack=maintain-16-byte>)
30+
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -static-intel)
3331
set(TBB_OPENMP_FLAG -qopenmp)
3432
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-ipo>)
3533
endif()

cmake/compilers/MSVC.cmake

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2021 Intel Corporation
1+
# Copyright (c) 2020-2023 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -35,6 +35,12 @@ endif()
3535
set(TBB_LIB_COMPILE_FLAGS -D_CRT_SECURE_NO_WARNINGS /GS)
3636
set(TBB_COMMON_COMPILE_FLAGS /volatile:iso /FS /EHsc)
3737

38+
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} /DYNAMICBASE /NXCOMPAT)
39+
40+
if (TBB_ARCH EQUAL 32)
41+
set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} /SAFESEH )
42+
endif()
43+
3844
# Ignore /WX set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
3945
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
4046
tbb_remove_compile_flag(/WX)

0 commit comments

Comments
 (0)