Skip to content

Commit d7ed7d6

Browse files
authored
Merge branch 'master' into issue#22945
2 parents c778406 + c04ed93 commit d7ed7d6

File tree

11,102 files changed

+27775
-21409
lines changed

Some content is hidden

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

11,102 files changed

+27775
-21409
lines changed

.github/ISSUE_TEMPLATE/good_first_issue.yml

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ body:
4343
value: |
4444
- [Contribution guide - start here!](https://github.com/openvinotoolkit/openvino/blob/master/CONTRIBUTING.md)
4545
- [Intel DevHub Discord channel](https://discord.gg/7pVRxUwdWG) - engage in discussions, ask questions and talk to OpenVINO developers
46+
- [How to link your Pull Request to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#manually-linking-a-pull-request-to-an-issue-using-the-pull-request-sidebar)
4647
validations:
4748
required: true
4849

.github/components.yml

+3
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ CPU:
3434
- TF_FE
3535
- ONNX_FE
3636
build:
37+
- AUTO
3738
- HETERO
3839
- AUTO_BATCH
3940
- TEMPLATE
4041
- IR_FE
4142

4243
GPU:
4344
build:
45+
- AUTO
4446
- HETERO
4547
- AUTO_BATCH
4648
- TEMPLATE
@@ -149,6 +151,7 @@ PyTorch_FE:
149151
C_API:
150152
build:
151153
- CPU
154+
- GPU
152155
- HETERO
153156
- AUTO_BATCH
154157
- AUTO

.github/workflows/code_style.yml

-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ jobs:
2020
sudo apt update
2121
sudo apt --assume-yes install clang-format-9
2222
23-
- name: Install dependencies
24-
run: |
25-
python3 -m pip install --upgrade pip
26-
python3 -m pip install -r ./src/bindings/python/requirements.txt
27-
2823
# Run cmake with -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT in order to enable codestyle check for ITT collector
2924
- name: CMake configure
3025
run: cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -B build

.github/workflows/coverage.yml

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
4141
python3 -m pip install --upgrade pip
4242
python3 -m pip install -r ${{ github.workspace }}/src/bindings/python/wheel/requirements-dev.txt
43-
python3 -m pip install -r ${{ github.workspace }}/src/bindings/python/requirements.txt
4443
# For running Paddle frontend unit tests
4544
python3 -m pip install -r ${{ github.workspace }}/src/frontends/paddle/tests/requirements.txt
4645
# For running ONNX frontend unit tests

.github/workflows/coverity.yml

+30-35
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,14 @@ jobs:
2727
runs-on: aks-linux-16-cores-32gb
2828
container:
2929
image: openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04
30-
volumes:
31-
- /mount/caches:/mount/caches
32-
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING
3330
env:
3431
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
3532
CMAKE_BUILD_TYPE: 'Release'
3633
CMAKE_GENERATOR: 'Ninja Multi-Config'
37-
CMAKE_CXX_COMPILER_LAUNCHER: sccache
38-
CMAKE_C_COMPILER_LAUNCHER: sccache
39-
SCCACHE_IGNORE_SERVER_IO_ERROR: 1
40-
SCCACHE_SERVER_PORT: 35555
4134
GITHUB_WORKSPACE: '/__w/openvino/openvino'
4235
OPENVINO_REPO: /__w/openvino/openvino/openvino
4336
OPENVINO_CONTRIB_REPO: /__w/openvino/openvino/openvino_contrib
4437
BUILD_DIR: /__w/openvino/openvino/openvino_build
45-
SCCACHE_AZURE_KEY_PREFIX: coverity_ubuntu20_x86_64
4638
COVERITY_TOOL_DIR: /__w/openvino/openvino/coverity_tool
4739

4840
steps:
@@ -76,11 +68,6 @@ jobs:
7668
# default-jdk - Java API
7769
apt install --assume-yes --no-install-recommends default-jdk
7870
79-
- name: Install sccache
80-
uses: mozilla-actions/sccache-action@v0.0.4
81-
with:
82-
version: "v0.7.5"
83-
8471
- name: Setup Python ${{ env.PYTHON_VERSION }}
8572
uses: ./openvino/.github/actions/setup_python
8673
with:
@@ -99,20 +86,13 @@ jobs:
9986
-G "${{ env.CMAKE_GENERATOR }}" \
10087
-DENABLE_CPPLINT=OFF \
10188
-DENABLE_STRICT_DEPENDENCIES=OFF \
102-
-DENABLE_SYSTEM_TBB=ON \
103-
-DENABLE_SYSTEM_OPENCL=ON \
10489
-DCMAKE_VERBOSE_MAKEFILE=ON \
105-
-DCPACK_GENERATOR=TGZ \
10690
-DBUILD_nvidia_plugin=OFF \
91+
-DENABLE_FASTER_BUILD=OFF \
10792
-DOPENVINO_EXTRA_MODULES=${OPENVINO_CONTRIB_REPO}/modules \
108-
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} \
109-
-DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \
11093
-S ${OPENVINO_REPO} \
11194
-B ${BUILD_DIR}
11295
113-
- name: Clean sccache stats
114-
run: ${SCCACHE_PATH} --zero-stats
115-
11696
- name: Install Coverity tool
11797
run: |
11898
rm -rf ${COVERITY_TOOL_DIR} && mkdir -p ${COVERITY_TOOL_DIR}
@@ -122,12 +102,7 @@ jobs:
122102
popd
123103
124104
- name: Cmake build - OpenVINO with Coverity
125-
run: |
126-
${COVERITY_TOOL_DIR}/cov-analysis*/bin/cov-build --dir ${BUILD_DIR}/cov-int \
127-
cmake --build ${BUILD_DIR} --parallel --config ${{ env.CMAKE_BUILD_TYPE }}
128-
129-
- name: Show sccache stats
130-
run: ${SCCACHE_PATH} --show-stats
105+
run: ${COVERITY_TOOL_DIR}/cov-analysis*/bin/cov-build --dir ${BUILD_DIR}/cov-int cmake --build ${BUILD_DIR} --parallel --config ${{ env.CMAKE_BUILD_TYPE }}
131106

132107
- name: Pack Artefacts
133108
run: |
@@ -137,24 +112,44 @@ jobs:
137112
138113
- name: Submit artefacts
139114
run: |
140-
apt-get update && apt-get install -y curl
115+
apt-get update && apt-get install -y curl jq
141116
pushd ${BUILD_DIR}
142-
curl --form token=${{ secrets.COVERITY_TOKEN }} \
143-
--form email=${{ secrets.COVERITY_USER }} \
144-
--form file=@openvino.tgz \
145-
--form version="${{ github.sha }}" \
146-
--form description="https://github.com/openvinotoolkit/openvino/runs/${{ github.run_number }}" \
147-
https://scan.coverity.com/builds?project=openvino
117+
curl -X POST -d token=${{ secrets.COVERITY_TOKEN }} \
118+
-d email=${{ secrets.COVERITY_USER }} \
119+
-d file_name="openvino.tgz" \
120+
-d version="${{ github.sha }}" \
121+
-d description="https://github.com/openvinotoolkit/openvino/runs/${{ github.run_number }}" \
122+
https://scan.coverity.com/projects/21921/builds/init | tee response
123+
124+
upload_url=$(jq -r '.url' response)
125+
build_id=$(jq -r '.build_id' response)
126+
127+
curl -X PUT \
128+
--header 'Content-Type: application/json' \
129+
--upload-file openvino.tgz \
130+
$upload_url
131+
132+
curl -X PUT \
133+
-d token=${{ secrets.COVERITY_TOKEN }} \
134+
https://scan.coverity.com/projects/21921/builds/$build_id/enqueue
148135
popd
149136
150137
- name: Show Coverity configure logs
151138
continue-on-error: true
152139
run: ${COVERITY_TOOL_DIR}/cov-analysis*/bin/cov-configure -c ${COVERITY_TOOL_DIR}/cov-analysis-linux64-2023.6.2/config/coverity_config.xml -lscc text
153140

154-
- name: Upload Coverity logs
141+
- name: Upload Coverity build log
155142
uses: actions/upload-artifact@v4
156143
if: always()
157144
with:
158145
name: coverity_logs
159146
path: ${{ env.BUILD_DIR }}/cov-int/build-log.txt
160147
if-no-files-found: 'error'
148+
149+
- name: Upload Coverity build archive
150+
uses: actions/upload-artifact@v4
151+
if: always()
152+
with:
153+
name: coverity_archive
154+
path: ${{ env.BUILD_DIR }}/openvino.tgz
155+
if-no-files-found: 'error'

.github/workflows/mac.yml

-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ jobs:
115115
run: |
116116
# For Python API
117117
python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/wheel/requirements-dev.txt
118-
python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/requirements.txt
119118
120119
# For running ONNX frontend unit tests
121120
python3 -m pip install --force-reinstall -r ${{ env.OPENVINO_REPO }}/src/frontends/onnx/tests/requirements.txt

.github/workflows/mac_arm64.yml

-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ jobs:
114114
run: |
115115
# For Python API
116116
python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/wheel/requirements-dev.txt
117-
python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/requirements.txt
118117
119118
# For running ONNX frontend unit tests
120119
python3 -m pip install --force-reinstall -r ${{ env.OPENVINO_REPO }}/src/frontends/onnx/tests/requirements.txt

.github/workflows/windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ jobs:
152152
-DBUILD_nvidia_plugin=OFF `
153153
-DBUILD_SHARED_LIBS=ON `
154154
-DENABLE_TESTS=ON `
155-
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF `
155+
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON `
156156
-DENABLE_STRICT_DEPENDENCIES=OFF `
157157
-DENABLE_PYTHON=ON `
158158
-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON `

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Use the issue description and locally built OpenVINO to complete the task. Remem
143143

144144
### 4. Submit a PR with your changes
145145

146-
Follow our [Good Pull Request guidelines](https://github.com/openvinotoolkit/openvino/blob/master/CONTRIBUTING_PR.md).
146+
Follow our [Good Pull Request guidelines](https://github.com/openvinotoolkit/openvino/blob/master/CONTRIBUTING_PR.md). Please remember about [linking your Pull Request to the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#manually-linking-a-pull-request-to-an-issue-using-the-pull-request-sidebar) it addresses.
147147

148148
### 5. Wait for a review
149149

CONTRIBUTING_PR.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Follow the [OpenVINO code style guide](https://github.com/openvinotoolkit/openvino/blob/master/docs/dev/coding_style.md).
1717
* Make your PRs small - each PR should address one issue. Remove all changes
1818
unrelated to the PR.
19+
* [Link your Pull Request to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#manually-linking-a-pull-request-to-an-issue-using-the-pull-request-sidebar) if it addresses one.
1920
* Document your contribution! If your changes may impact how the user works with
2021
OpenVINO, provide the information in proper articles. You can do it yourself,
2122
or contact one of OpenVINO documentation contributors to work together on

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ You can also check out [Awesome OpenVINO](https://github.com/openvinotoolkit/awe
160160
## System requirements
161161

162162
The system requirements vary depending on platform and are available on dedicated pages:
163-
- [Linux](https://docs.openvino.ai/2024/get-started/install-openvino-overview/install-openvino-linux-header.html)
164-
- [Windows](https://docs.openvino.ai/2024/get-started/install-openvino-overview/install-openvino-windows-header.html)
165-
- [macOS](https://docs.openvino.ai/2024/get-started/install-openvino-overview/install-openvino-macos-header.html)
163+
- [Linux](https://docs.openvino.ai/2024/get-started/install-openvino/install-openvino-linux.html)
164+
- [Windows](https://docs.openvino.ai/2024/get-started/install-openvino/install-openvino-windows.html)
165+
- [macOS](https://docs.openvino.ai/2024/get-started/install-openvino/install-openvino-macos.html)
166166

167167
## How to build
168168

cmake/arm.toolchain.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

cmake/arm64.toolchain.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

cmake/coverage.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

cmake/dependencies.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

cmake/developer_package/OpenVINODeveloperScriptsConfig.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

@@ -220,6 +220,8 @@ set(CMAKE_POLICY_DEFAULT_CMP0094 NEW)
220220
set(CMAKE_POLICY_DEFAULT_CMP0111 NEW)
221221
# CMake 3.22+ :cmake_dependent_option() supports full Condition Syntax
222222
set(CMAKE_POLICY_DEFAULT_CMP0127 NEW)
223+
# CMake 3.24+ :prefers to set the timestamps of all extracted contents to the time of the extraction
224+
set(CMAKE_POLICY_DEFAULT_CMP0135 NEW)
223225

224226
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "Don't warn about obsolete cmake versions in 3rdparty")
225227
set(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION ON CACHE BOOL "Warn about absolute paths in destination")

cmake/developer_package/add_target_helpers.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

@@ -160,7 +160,7 @@ function(ov_add_test_target)
160160
set(JS_BIN_NAME "${ARG_NAME}.js")
161161
set(JS_APP_NAME "${ARG_NAME}_js.js")
162162
set(JS_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${JS_APP_NAME}")
163-
file(WRITE ${JS_TEST_APP} "// Copyright (C) 2018-2023 Intel Corporation\n")
163+
file(WRITE ${JS_TEST_APP} "// Copyright (C) 2018-2024 Intel Corporation\n")
164164
file(APPEND ${JS_TEST_APP} "// SPDX-License-Identifier: Apache-2.0\n")
165165
file(APPEND ${JS_TEST_APP} "//\n")
166166
file(APPEND ${JS_TEST_APP} "// JS test app\n")

cmake/developer_package/api_validator/api_validator.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

cmake/developer_package/api_validator/api_validator_run.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

cmake/developer_package/clang_format/clang_format.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

cmake/developer_package/clang_format/clang_format_check.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

cmake/developer_package/clang_format/clang_format_fix.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

cmake/developer_package/compile_flags/fuzzing.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

cmake/developer_package/compile_flags/os_flags.cmake

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

@@ -75,6 +75,17 @@ macro(ov_dev_package_no_errors)
7575
endif()
7676
endif()
7777

78+
if (CMAKE_COMPILE_WARNING_AS_ERROR AND WIN32)
79+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
80+
if(CMAKE_VERSION VERSION_LESS 3.24)
81+
string(REPLACE "/WX" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
82+
string(REPLACE "/WX" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
83+
endif()
84+
string(REPLACE "/WX" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
85+
endif()
86+
set(CMAKE_COMPILE_WARNING_AS_ERROR OFF)
87+
endif()
88+
7889
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ov_c_cxx_dev_no_errors} ${ov_cxx_dev_no_errors}")
7990
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ov_c_cxx_dev_no_errors}")
8091
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ov_c_cxx_dev_no_errors} ${ov_cxx_dev_no_errors}")

cmake/developer_package/compile_flags/sanitizer.cmake

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2018-2023 Intel Corporation
1+
# Copyright (C) 2018-2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

@@ -17,12 +17,20 @@ if (ENABLE_SANITIZER)
1717
"https://github.com/openvinotoolkit/openvino/wiki/AddressSanitizer-and-LeakSanitizer")
1818
endif()
1919
elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
20-
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize=address")
20+
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize=address -fsanitize-blacklist=${OpenVINO_SOURCE_DIR}/tests/asan/ignore.txt")
21+
if(BUILD_SHARED_LIBS)
22+
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -shared-libasan")
23+
endif()
24+
2125
check_cxx_compiler_flag("-fsanitize-recover=address" SANITIZE_RECOVER_ADDRESS_SUPPORTED)
2226
if (SANITIZE_RECOVER_ADDRESS_SUPPORTED)
2327
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize-recover=address")
2428
endif()
25-
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fsanitize=address")
29+
30+
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fsanitize=address -fsanitize-blacklist=${OpenVINO_SOURCE_DIR}/tests/asan/ignore.txt")
31+
if(BUILD_SHARED_LIBS)
32+
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -shared-libasan")
33+
endif()
2634
else()
2735
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
2836
endif()
@@ -90,8 +98,16 @@ if(DEFINED SANITIZER_COMPILER_FLAGS)
9098
# prevent unloading libraries at runtime, so sanitizer can resolve their symbols
9199
if(NOT OV_COMPILER_IS_APPLECLANG)
92100
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -Wl,-z,nodelete")
93-
if(OV_COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
94-
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fuse-ld=lld")
101+
102+
if(OV_COMPILER_IS_CLANG)
103+
if(BUILD_SHARED_LIBS)
104+
# clang does not provide rpath if -shared-libasan is used
105+
# https://stackoverflow.com/questions/68571138/asan-dynamic-runtime-is-missing-on-ubuntu-18, https://bugs.llvm.org/show_bug.cgi?id=51271
106+
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS},-rpath=$(dirname $($CXX --print-file-name libclang_rt.asan-x86_64.so))")
107+
endif()
108+
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
109+
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fuse-ld=lld")
110+
endif()
95111
endif()
96112
endif()
97113
else()

0 commit comments

Comments
 (0)