diff --git a/.azure-pipelines-templates/build_check.yml b/.azure-pipelines-templates/build_check.yml deleted file mode 100644 index 278f2ebfa5c..00000000000 --- a/.azure-pipelines-templates/build_check.yml +++ /dev/null @@ -1,4 +0,0 @@ -steps: - - script: python3 ../scripts/build-check.py < build.log ${{ parameters.target }} - displayName: "Build check" - workingDirectory: build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d5bd9999db..5a769279795 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -92,13 +92,6 @@ jobs: ninja -v | tee build.log shell: bash - - name: "Check Mitigation Flags" - run: | - cd build - python3 ../scripts/build-check.py < build.log SNPCC - shell: bash - if: ${{ matrix.platform.name == 'snp' }} - - name: "Install Extended Testing Tools" run: | set -ex diff --git a/cmake/preproject.cmake b/cmake/preproject.cmake index d1d08a99b6e..16ead6a0874 100644 --- a/cmake/preproject.cmake +++ b/cmake/preproject.cmake @@ -75,11 +75,4 @@ function(add_warning_checks name) ) endfunction() -set(SPECTRE_MITIGATION_FLAGS -mllvm -x86-speculative-load-hardening) -if("${COMPILE_TARGET}" STREQUAL "snp") - if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - add_compile_options(${SPECTRE_MITIGATION_FLAGS}) - endif() -endif() - set(CMAKE_CXX_STANDARD 20) diff --git a/scripts/build-check.py b/scripts/build-check.py deleted file mode 100644 index 7108cb7b203..00000000000 --- a/scripts/build-check.py +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the Apache 2.0 License. - -import re -import sys - -PLAUSIBLE_CLANG = re.compile(r"^.*/clang((\+\+)?-\d+)?$") -NOT_IN_TCB = re.compile(".*/(tests?|perf)/.*") - - -class Checker: - def __init__(self, platform): - assert platform == "SNPCC" - self.platform = platform - self.total_lines = 0 - self.checked_lines = 0 - - def check_line(self, line): - self.total_lines += 1 - words = line.split(" ") - for index, word in enumerate(words): - if PLAUSIBLE_CLANG.match(word): - break - - # Not a build line - if index == len(words) - 1: - return - - options = words[index + 1 :] - - if any(NOT_IN_TCB.match(option) for option in options): - return - - if "-shared" in options: - pass - elif any(option for option in options if option.startswith("-l")): - pass - else: - # Compile line - if self.platform == "SNPCC": - assert ( - "-x86-speculative-load-hardening" in options - ), f"Missing -x86-speculative-load-hardening in {line}" - self.checked_lines += 1 - - def stats(self): - print(f"Checked {self.checked_lines} out of {self.total_lines} lines") - - -if __name__ == "__main__": - checker = Checker(sys.argv[1]) - for line in sys.stdin: - checker.check_line(line) - checker.stats()