|
| 1 | +# Copyright 2021 The TensorFlow Authors. All Rights Reserved. |
| 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 | +# |
| 16 | +# TFLM Bazel configuration file. |
| 17 | + |
| 18 | +# Use the following C++ standard |
| 19 | +build --cxxopt -std=c++17 |
| 20 | + |
| 21 | +# When building with the address sanitizer |
| 22 | +# E.g., bazel build --config asan |
| 23 | +build:asan --repo_env CC=clang |
| 24 | +build:asan --strip=never |
| 25 | +build:asan --copt -fsanitize=address |
| 26 | +build:asan --copt -DADDRESS_SANITIZER |
| 27 | +build:asan --copt -g |
| 28 | +build:asan --copt -O3 |
| 29 | +build:asan --copt -fno-omit-frame-pointer |
| 30 | +build:asan --linkopt -fsanitize=address |
| 31 | + |
| 32 | +# When building with the memory sanitizer |
| 33 | +# E.g., bazel build --config msan |
| 34 | +build:msan --repo_env CC=clang |
| 35 | +build:msan --strip=never |
| 36 | +build:msan --copt -fsanitize=memory |
| 37 | +build:msan --copt -DADDRESS_SANITIZER |
| 38 | +build:msan --copt -g |
| 39 | +build:msan --copt -O3 |
| 40 | +build:msan --copt -fno-omit-frame-pointer |
| 41 | +build:msan --linkopt -fsanitize=memory |
| 42 | + |
| 43 | +# When building with the undefined behavior sanitizer |
| 44 | +# E.g., bazel build --config ubsan |
| 45 | +build:ubsan --repo_env CC=clang |
| 46 | +build:ubsan --strip=never |
| 47 | +build:ubsan --copt -fsanitize=undefined |
| 48 | +build:ubsan --copt -g |
| 49 | +build:ubsan --copt -O3 |
| 50 | +build:ubsan --copt -fno-omit-frame-pointer |
| 51 | +build:ubsan --linkopt -fsanitize=undefined |
| 52 | +build:ubsan --linkopt -lubsan |
0 commit comments