Skip to content

Commit 7f182b6

Browse files
authored
Merge branch 'main' into issue-80666
2 parents 3a3b902 + 7847b75 commit 7f182b6

File tree

87 files changed

+1104
-1863
lines changed

Some content is hidden

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

87 files changed

+1104
-1863
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@
55
ARG VARIANT="6.0-jammy"
66
FROM mcr.microsoft.com/devcontainers/dotnet:0-${VARIANT}
77

8+
# Set up machine requirements to build the repo and the gh CLI
9+
# Clang-16 up is required but Ubuntu 22.04 comes with clang-14 highest, so add clang-18 sources
10+
RUN apt-get update \
11+
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - \
12+
&& apt-get install software-properties-common -y \
13+
&& add-apt-repository "deb http://apt.llvm.org/$(lsb_release -s -c)/ llvm-toolchain-$(lsb_release -s -c)-18 main" -y \
14+
&& apt-get update \
15+
&& apt-get install clang-18 -y
16+
817
# Set up machine requirements to build the repo and the gh CLI
918
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1019
&& apt-get -y install --no-install-recommends \
1120
cmake \
12-
llvm \
13-
clang \
1421
build-essential \
1522
python3 \
1623
curl \

.devcontainer/wasm-multiThreaded/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@
55
ARG VARIANT="6.0-jammy"
66
FROM mcr.microsoft.com/devcontainers/dotnet:0-${VARIANT}
77

8+
# Set up machine requirements to build the repo and the gh CLI
9+
# Clang-16 up is required but Ubuntu 22.04 comes with clang-14 highest, so add clang-18 sources
10+
RUN apt-get update \
11+
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - \
12+
&& apt-get install software-properties-common -y \
13+
&& add-apt-repository "deb http://apt.llvm.org/$(lsb_release -s -c)/ llvm-toolchain-$(lsb_release -s -c)-18 main" -y \
14+
&& apt-get update \
15+
&& apt-get install clang-18 -y
16+
817
# Set up machine requirements to build the repo and the gh CLI
918
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1019
&& apt-get -y install --no-install-recommends \
1120
cmake \
12-
llvm \
13-
clang \
1421
build-essential \
1522
python3 \
1623
curl \

.devcontainer/wasm/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ ARG VARIANT="6.0-jammy"
66
FROM mcr.microsoft.com/devcontainers/dotnet:0-${VARIANT}
77

88
# Set up machine requirements to build the repo and the gh CLI
9+
# Clang-16 up is required but Ubuntu 22.04 comes with clang-14 highest, so add clang-18 sources
10+
RUN apt-get update \
11+
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - \
12+
&& apt-get install software-properties-common -y \
13+
&& add-apt-repository "deb http://apt.llvm.org/$(lsb_release -s -c)/ llvm-toolchain-$(lsb_release -s -c)-18 main" -y \
14+
&& apt-get update \
15+
&& apt-get install clang-18 -y
16+
917
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1018
&& apt-get -y install --no-install-recommends \
1119
cmake \
12-
llvm \
13-
clang \
1420
build-essential \
1521
python3 \
1622
curl \

docs/workflow/requirements/linux-requirements.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Install the following packages for the toolchain:
3737
* CMake 3.20 or newer
3838
* llvm
3939
* lld
40-
* clang
40+
* clang 16 or newer
4141
* build-essential
4242
* python-is-python3
4343
* curl
@@ -59,6 +59,7 @@ sudo apt install -y cmake llvm lld clang build-essential \
5959
```
6060

6161
**NOTE**: As of now, Ubuntu's `apt` only has until CMake version 3.16.3 if you're using Ubuntu 20.04 LTS (less in older Ubuntu versions), and version 3.18.4 in Debian 11 (less in older Debian versions). This is lower than the required 3.20, which in turn makes it incompatible with the repo. For this case, we can use the `snap` package manager or the _Kitware APT feed_ to get a new enough version of CMake.
62+
**NOTE**: If you have Ubuntu 22.04 LTS and older and your `apt` does not have clang version 16, you can add `"deb http://apt.llvm.org/$(lsb_release -s -c)/ llvm-toolchain-$(lsb_release -s -c)-18 main"` repository to your `apt`. See how we do it for linux-based containers [here](./../../../.devcontainer/Dockerfile).
6263

6364
For snap:
6465

eng/pipelines/coreclr/templates/build-perf-sample-apps.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ steps:
3838
displayName: clean bindir
3939

4040
- ${{ if and(eq(parameters.osGroup, 'ios'), eq(parameters.nameSuffix, 'iOSMono')) }}:
41-
- script: make build-appbundle TARGET=ios MONO_ARCH=arm64 MONO_CONFIG=Release AOT=True USE_LLVM=False DEPLOY_AND_RUN=false STRIP_DEBUG_SYMBOLS=false HYBRID_GLOBALIZATION=${{ parameters.hybridGlobalization }}
41+
- script: make build-appbundle TARGET_OS=ios TARGET_ARCH=arm64 BUILD_CONFIG=Release AOT=True USE_LLVM=False DEPLOY_AND_RUN=false STRIP_DEBUG_SYMBOLS=false HYBRID_GLOBALIZATION=${{ parameters.hybridGlobalization }}
4242
env:
4343
DevTeamProvisioning: '-'
4444
workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS
@@ -60,7 +60,7 @@ steps:
6060
- script: rm -r -f $(Build.SourcesDirectory)/src/mono/sample/iOS/bin
6161
workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS
6262
displayName: Clean bindir
63-
- script: make build-appbundle TARGET=ios MONO_ARCH=arm64 MONO_CONFIG=Release AOT=True USE_LLVM=False DEPLOY_AND_RUN=false STRIP_DEBUG_SYMBOLS=true HYBRID_GLOBALIZATION=${{ parameters.hybridGlobalization }}
63+
- script: make build-appbundle TARGET_OS=ios TARGET_ARCH=arm64 BUILD_CONFIG=Release AOT=True USE_LLVM=False DEPLOY_AND_RUN=false STRIP_DEBUG_SYMBOLS=true HYBRID_GLOBALIZATION=${{ parameters.hybridGlobalization }}
6464
env:
6565
DevTeamProvisioning: '-'
6666
workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS
@@ -82,7 +82,7 @@ steps:
8282
- script: rm -r -f $(Build.SourcesDirectory)/src/mono/sample/iOS/bin
8383
workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS
8484
displayName: Clean bindir
85-
- script: make build-appbundle TARGET=ios MONO_ARCH=arm64 MONO_CONFIG=Release AOT=True USE_LLVM=True DEPLOY_AND_RUN=false STRIP_DEBUG_SYMBOLS=false HYBRID_GLOBALIZATION=${{ parameters.hybridGlobalization }}
85+
- script: make build-appbundle TARGET_OS=ios TARGET_ARCH=arm64 BUILD_CONFIG=Release AOT=True USE_LLVM=True DEPLOY_AND_RUN=false STRIP_DEBUG_SYMBOLS=false HYBRID_GLOBALIZATION=${{ parameters.hybridGlobalization }}
8686
env:
8787
DevTeamProvisioning: '-'
8888
workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS
@@ -104,7 +104,7 @@ steps:
104104
- script: rm -r -f $(Build.SourcesDirectory)/src/mono/sample/iOS/bin
105105
workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS
106106
displayName: Clean bindir
107-
- script: make build-appbundle TARGET=ios MONO_ARCH=arm64 MONO_CONFIG=Release AOT=True USE_LLVM=True DEPLOY_AND_RUN=false STRIP_DEBUG_SYMBOLS=true HYBRID_GLOBALIZATION=${{ parameters.hybridGlobalization }}
107+
- script: make build-appbundle TARGET_OS=ios TARGET_ARCH=arm64 BUILD_CONFIG=Release AOT=True USE_LLVM=True DEPLOY_AND_RUN=false STRIP_DEBUG_SYMBOLS=true HYBRID_GLOBALIZATION=${{ parameters.hybridGlobalization }}
108108
env:
109109
DevTeamProvisioning: '-'
110110
workingDirectory: $(Build.SourcesDirectory)/src/mono/sample/iOS

src/coreclr/dlls/mscordac/update.pl

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
</Project>
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System;
5+
using System.IO;
6+
using System.Text.RegularExpressions;
7+
using static Patterns;
8+
9+
if (args.Length != 1)
10+
{
11+
Console.Error.WriteLine("Usage: <file>");
12+
return 1;
13+
}
14+
15+
string filePath = args[0];
16+
17+
string fileContent = File.ReadAllText(filePath);
18+
19+
var match = GetRegexExtractMarkers().Match(fileContent);
20+
if (!match.Success)
21+
{
22+
Console.Error.WriteLine("Could not find %% markers");
23+
return 1;
24+
}
25+
26+
//string prefix = match.Groups[1].Value;
27+
string grammar = match.Groups[2].Value;
28+
29+
// Remove any text in {}
30+
var regexRemoveTextInBraces = GetRegexRemoveTextInBraces();
31+
string previousGrammar;
32+
33+
do
34+
{
35+
previousGrammar = grammar;
36+
grammar = regexRemoveTextInBraces.Replace(grammar, "$1");
37+
} while (grammar != previousGrammar);
38+
39+
// Change keyword identifiers into the string they represent (lowercase)
40+
grammar = GetRegexKeywordIdentifiers().Replace(grammar, m => $"'{m.Groups[1].Value.ToLowerInvariant()}'");
41+
42+
// Change assembler directives into their string (lowercase with a period)
43+
grammar = GetRegexAssemblerDirectives().Replace(grammar, m => $"'.{m.Groups[1].Value.ToLowerInvariant()}'");
44+
45+
// Handle special punctuation
46+
grammar = GetRegexEllipsis().Replace(grammar, "'...'");
47+
grammar = GetRegexDcolon().Replace(grammar, "'::'");
48+
49+
// Print the output header
50+
Console.Write(@"// Licensed to the .NET Foundation under one or more agreements.
51+
// The .NET Foundation licenses this file to you under the MIT license.
52+
53+
Lexical tokens
54+
ID - C style alphaNumeric identifier (e.g. Hello_There2)
55+
DOTTEDNAME - Sequence of dot-separated IDs (e.g. System.Object)
56+
QSTRING - C style quoted string (e.g. ""hi\n"")
57+
SQSTRING - C style singlely quoted string(e.g. 'hi')
58+
INT32 - C style 32 bit integer (e.g. 235, 03423, 0x34FFF)
59+
INT64 - C style 64 bit integer (e.g. -2353453636235234, 0x34FFFFFFFFFF)
60+
FLOAT64 - C style floating point number (e.g. -0.2323, 354.3423, 3435.34E-5)
61+
INSTR_* - IL instructions of a particular class (see opcode.def).
62+
HEXBYTE - 1- or 2-digit hexadecimal number (e.g., A2, F0).
63+
Auxiliary lexical tokens
64+
TYPEDEF_T - Aliased class (TypeDef or TypeRef).
65+
TYPEDEF_M - Aliased method.
66+
TYPEDEF_F - Aliased field.
67+
TYPEDEF_TS - Aliased type specification (TypeSpec).
68+
TYPEDEF_MR - Aliased field/method reference (MemberRef).
69+
TYPEDEF_CA - Aliased Custom Attribute.
70+
----------------------------------------------------------------------------------
71+
START : decls
72+
;");
73+
74+
// Print the output
75+
Console.Write(grammar);
76+
77+
return 0;
78+
79+
internal static partial class Patterns
80+
{
81+
[GeneratedRegex(@"^(.*)%%(.*)%%", RegexOptions.Singleline)]
82+
internal static partial Regex GetRegexExtractMarkers();
83+
84+
[GeneratedRegex(@"\s*([^'])\{[^{}]*\}", RegexOptions.Singleline)]
85+
internal static partial Regex GetRegexRemoveTextInBraces();
86+
87+
[GeneratedRegex(@"\b([A-Z0-9_]+)_\b", RegexOptions.Singleline)]
88+
internal static partial Regex GetRegexKeywordIdentifiers();
89+
90+
[GeneratedRegex(@"\b_([A-Z0-9]+)\b", RegexOptions.Singleline)]
91+
internal static partial Regex GetRegexAssemblerDirectives();
92+
93+
[GeneratedRegex(@"\bELLIPSIS\b", RegexOptions.Singleline)]
94+
internal static partial Regex GetRegexEllipsis();
95+
96+
[GeneratedRegex(@"\bDCOLON\b", RegexOptions.Singleline)]
97+
internal static partial Regex GetRegexDcolon();
98+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Grammar extractor for IL tools
2+
3+
Tool to extract IL grammar in `Backus-Naur Form (BNF)` from `Yet Another Compiler-Compiler (Yacc)`.
4+
5+
Usage:
6+
7+
```sh
8+
cd runtime
9+
./dotnet.sh run --project src/coreclr/ilasm/GrammarExtractor src/coreclr/ilasm/asmparse.y > src/coreclr/ilasm/prebuilt/asmparse.grammar
10+
```

src/coreclr/ilasm/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ $ docker run --rm -v$(pwd):/runtime -w /runtime/src/coreclr/ilasm alpine \
1616
sh -c 'apk add bison && yacc asmparse.y -o prebuilt/asmparse.cpp'
1717
```
1818

19+
To generate grammar, see [GrammarExtractor README](GrammarExtractor/README.md).

src/coreclr/ilasm/extractGrammar.pl

Lines changed: 0 additions & 59 deletions
This file was deleted.

src/coreclr/ilasm/prebuilt/asmparse.grammar

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ dottedName : id
7676
| dottedName '.' dottedName
7777
;
7878

79-
int32 : INT32
79+
int32 : INT32_V
8080
;
8181

82-
int64 : INT64
83-
| INT32
82+
int64 : INT64_V
83+
| INT32_V
8484
;
8585

8686
float64 : FLOAT64

0 commit comments

Comments
 (0)