Skip to content

Commit

Permalink
Use LLVM version 11.0.1 (microsoft#1016)
Browse files Browse the repository at this point in the history
* Use LLVM version 11.0.1

Fixes microsoft#962

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Updated expected bpf2c output from LLVM 11

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
  • Loading branch information
dthaler and Alan-Jowett authored Apr 26, 2022
1 parent ecc4d2d commit 02212c8
Show file tree
Hide file tree
Showing 33 changed files with 1,243 additions and 1,285 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Install tools
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
choco install -y llvm
choco install -y llvm --version 11.0.1 --allow-downgrade
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Cache nuget packages
Expand Down
2 changes: 1 addition & 1 deletion docs/DevelopmentGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ the default Visual Studio style. See [clang-format style options](
http://releases.llvm.org/3.6.0/tools/clang/docs/ClangFormatStyleOptions.html)
for details.

If you see unexpected formatting changes in the code, verify that you are running version 10 or higher of the LLVM tool-chain.
If you see unexpected formatting changes in the code, verify that you are running version 11 or higher of the LLVM tool-chain.

### License Header

Expand Down
4 changes: 2 additions & 2 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following must be installed in order to build this project:
which must be selected as an Individual component in the VS installer
3. [Visual Studio Build Tools 2019](https://aka.ms/vs/16/release/vs_buildtools.exe)
4. [WDK for Windows 10, version 2004](https://go.microsoft.com/fwlink/?linkid=2128854)
5. [Clang for Windows 64-bit version 10.0.0](https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe) or [The latest release of Clang for Windows 64-bit](https://github.com/llvm/llvm-project/releases/latest)
5. [Clang for Windows 64-bit version 11.0.1](https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/LLVM-11.0.1-win64.exe) or [The latest release of Clang for Windows 64-bit](https://github.com/llvm/llvm-project/releases/latest)
6. [nuget.exe](https://www.nuget.org/downloads) installed to a location such as "C:\Program Files (x86)\NuGet\"

You should add the paths to `git.exe`, `cmake.exe` and `nuget.exe` to the Windows PATH environment variable after the software packages above have been installed.
Expand Down Expand Up @@ -177,7 +177,7 @@ On a defender machine with [eBPF installed](#installing-ebpf-for-windows), do th
1. Install and set up a DNS server.
2. Make sure that either test signing was enabled as discussed in
[Installing eBPF for Windows](#installing-ebpf-for-windows), or the kernel debugger (KD) is attached and running.
3. Install [clang](https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/LLVM-11.0.0-win64.exe)
3. Install [clang](https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/LLVM-11.0.1-win64.exe)
if not already installed on the defender machine.
4. Copy `droppacket.c` and `ebpf.h` to a folder (such as `c:\test`).

Expand Down
2 changes: 1 addition & 1 deletion scripts/Setup-DevEnv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ choco install visualstudio2019-workload-nativedesktop --version 1.0.1 -y
choco install visualstudio2019buildtools --version 16.11.12.0 -y
choco install windowsdriverkit10 --version 10.0.19041.685 -y
choco install windowsdriverkit11 --version 10.0.22000.1 -y
choco install llvm --version 10.0.0 -y
choco install llvm --version 11.0.1 -y
choco install nuget.commandline --version 6.1.0 -y
choco install cmake.portable --version 3.23.1 -y
Start-Process "${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Community\Common7\IDE\VSIXInstaller.exe" -ArgumentList @("/q", "/a", "${Env:ProgramFiles(x86)}\Windows Kits\10\vsix\vs2019\WDK.vsix") -Wait
2 changes: 1 addition & 1 deletion scripts/format-code
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ check_clang-format()
cf="clang-format"
fi

local required_cfver='10.0.0'
local required_cfver='11.0.1'
# shellcheck disable=SC2155
local cfver=$(${cf} --version | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
check_version "${required_cfver}" "${cfver}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/format-code.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function check_clang-format()
# Windows does not have a clang-format-7 executable


$required_cfver='10.0.01'
$required_cfver='11.0.1'

try {
$cfver=(( Invoke-Expression "clang-format --version" 2> $null ) -split " ")[2]
Expand Down
4 changes: 2 additions & 2 deletions tests/bpf2c_tests/expected/bindmonitor_dll.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ label_1:
#line 59 "sample/bindmonitor.c"
if (r0 == IMMEDIATE(0)) goto label_8;
// EBPF_OP_MOV64_REG pc=52 dst=r1 src=r0 offset=0 imm=0
#line 62 "sample/bindmonitor.c"
#line 59 "sample/bindmonitor.c"
r1 = r0;
// EBPF_OP_ADD64_IMM pc=53 dst=r1 src=r0 offset=0 imm=4
#line 62 "sample/bindmonitor.c"
#line 59 "sample/bindmonitor.c"
r1 += IMMEDIATE(4);
label_2:
// EBPF_OP_LDXDW pc=54 dst=r2 src=r6 offset=0 imm=0
Expand Down
4 changes: 2 additions & 2 deletions tests/bpf2c_tests/expected/bindmonitor_raw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ label_1:
#line 59 "sample/bindmonitor.c"
if (r0 == IMMEDIATE(0)) goto label_8;
// EBPF_OP_MOV64_REG pc=52 dst=r1 src=r0 offset=0 imm=0
#line 62 "sample/bindmonitor.c"
#line 59 "sample/bindmonitor.c"
r1 = r0;
// EBPF_OP_ADD64_IMM pc=53 dst=r1 src=r0 offset=0 imm=4
#line 62 "sample/bindmonitor.c"
#line 59 "sample/bindmonitor.c"
r1 += IMMEDIATE(4);
label_2:
// EBPF_OP_LDXDW pc=54 dst=r2 src=r6 offset=0 imm=0
Expand Down
4 changes: 2 additions & 2 deletions tests/bpf2c_tests/expected/bindmonitor_sys.txt
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,10 @@ label_1:
#line 59 "sample/bindmonitor.c"
if (r0 == IMMEDIATE(0)) goto label_8;
// EBPF_OP_MOV64_REG pc=52 dst=r1 src=r0 offset=0 imm=0
#line 62 "sample/bindmonitor.c"
#line 59 "sample/bindmonitor.c"
r1 = r0;
// EBPF_OP_ADD64_IMM pc=53 dst=r1 src=r0 offset=0 imm=4
#line 62 "sample/bindmonitor.c"
#line 59 "sample/bindmonitor.c"
r1 += IMMEDIATE(4);
label_2:
// EBPF_OP_LDXDW pc=54 dst=r2 src=r6 offset=0 imm=0
Expand Down
4 changes: 2 additions & 2 deletions tests/bpf2c_tests/expected/bindmonitor_tailcall_dll.txt
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,10 @@ label_1:
#line 95 "sample/bindmonitor_tailcall.c"
if (r0 == IMMEDIATE(0)) goto label_8;
// EBPF_OP_MOV64_REG pc=52 dst=r1 src=r0 offset=0 imm=0
#line 98 "sample/bindmonitor_tailcall.c"
#line 95 "sample/bindmonitor_tailcall.c"
r1 = r0;
// EBPF_OP_ADD64_IMM pc=53 dst=r1 src=r0 offset=0 imm=4
#line 98 "sample/bindmonitor_tailcall.c"
#line 95 "sample/bindmonitor_tailcall.c"
r1 += IMMEDIATE(4);
label_2:
// EBPF_OP_LDXDW pc=54 dst=r2 src=r6 offset=0 imm=0
Expand Down
4 changes: 2 additions & 2 deletions tests/bpf2c_tests/expected/bindmonitor_tailcall_raw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,10 @@ label_1:
#line 95 "sample/bindmonitor_tailcall.c"
if (r0 == IMMEDIATE(0)) goto label_8;
// EBPF_OP_MOV64_REG pc=52 dst=r1 src=r0 offset=0 imm=0
#line 98 "sample/bindmonitor_tailcall.c"
#line 95 "sample/bindmonitor_tailcall.c"
r1 = r0;
// EBPF_OP_ADD64_IMM pc=53 dst=r1 src=r0 offset=0 imm=4
#line 98 "sample/bindmonitor_tailcall.c"
#line 95 "sample/bindmonitor_tailcall.c"
r1 += IMMEDIATE(4);
label_2:
// EBPF_OP_LDXDW pc=54 dst=r2 src=r6 offset=0 imm=0
Expand Down
4 changes: 2 additions & 2 deletions tests/bpf2c_tests/expected/bindmonitor_tailcall_sys.txt
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,10 @@ label_1:
#line 95 "sample/bindmonitor_tailcall.c"
if (r0 == IMMEDIATE(0)) goto label_8;
// EBPF_OP_MOV64_REG pc=52 dst=r1 src=r0 offset=0 imm=0
#line 98 "sample/bindmonitor_tailcall.c"
#line 95 "sample/bindmonitor_tailcall.c"
r1 = r0;
// EBPF_OP_ADD64_IMM pc=53 dst=r1 src=r0 offset=0 imm=4
#line 98 "sample/bindmonitor_tailcall.c"
#line 95 "sample/bindmonitor_tailcall.c"
r1 += IMMEDIATE(4);
label_2:
// EBPF_OP_LDXDW pc=54 dst=r2 src=r6 offset=0 imm=0
Expand Down
Loading

0 comments on commit 02212c8

Please sign in to comment.