File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,13 @@ def bolt_clang(self):
7878 clang_inst ,
7979 clang ,
8080 ]
81+ # When running an instrumented binary on certain platforms (namely
82+ # Apple Silicon), there may be hangs due to instrumentation in
83+ # between exclusive load and store instructions:
84+ # https://github.com/llvm/llvm-project/issues/153492
85+ # Enable conservative instrumentation to avoid this.
86+ if tc_build .utils .cpu_is_apple_silicon ():
87+ clang_inst_cmd .append ('--conservative-instrumentation' )
8188 self .run_cmd (clang_inst_cmd )
8289
8390 self .bolt_builder .bolt_instrumentation = True
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22
3+ from pathlib import Path
34import subprocess
45import sys
6+ import re
57import time
68
79
10+ def cpu_is_apple_silicon ():
11+ cpuinfo = Path ('/proc/cpuinfo' ).read_text (encoding = 'utf-8' )
12+ if match := re .search (r"implementer\s+:\s+(\w+)" , cpuinfo ):
13+ # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/include/asm/cputype.h?h=v6.17-rc4#n62
14+ return match .groups ()[0 ] == '0x61'
15+ # If we cannot prove that it is Apple Silicon, we assume it is not
16+ return False
17+
18+
819def create_gitignore (folder ):
920 folder .joinpath ('.gitignore' ).write_text ('*\n ' , encoding = 'utf-8' )
1021
You can’t perform that action at this time.
0 commit comments