Skip to content

Commit 75fd3c1

Browse files
committed
[SOL] Adjustments after LLVM 20 update
1 parent 45bf9ac commit 75fd3c1

35 files changed

+246
-164
lines changed

.ci/monolithic-windows.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ echo "--- cmake"
5050
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
5151
pip install -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt
5252

53-
export CC=cl
54-
export CXX=cl
53+
export CC=clang
54+
export CXX=clang++
5555
export LD=link
5656

5757
# The CMAKE_*_LINKER_FLAGS to disable the manifest come from research

.github/workflows/premerge.yaml

Lines changed: 137 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,31 @@ concurrency:
2424
cancel-in-progress: true
2525

2626
jobs:
27-
premerge-checks-linux:
28-
if: >-
29-
false && github.repository_owner == 'llvm' &&
30-
(github.event_name != 'pull_request' || github.event.action != 'closed')
31-
runs-on: llvm-premerge-linux-runners
27+
premerge-checks-linux-clang:
28+
if: (github.event_name != 'pull_request' || github.event.action != 'closed')
29+
runs-on: ubuntu-22.04
3230
steps:
31+
- name: Free up space in Github runner
32+
uses: easimon/maximize-build-space@master
33+
with:
34+
remove-dotnet: 'true'
35+
remove-android: 'true'
36+
remove-haskell: 'true'
37+
remove-codeql: 'true'
38+
root-reserve-mb: 2048
3339
- name: Checkout LLVM
3440
uses: actions/checkout@v4
3541
with:
3642
fetch-depth: 2
3743
- name: Setup ccache
3844
uses: hendrikmuhs/[email protected]
3945
with:
40-
max-size: "2000M"
46+
max-size: "1500M"
47+
- name: Print free space
48+
run: |
49+
echo "Free space:"
50+
df -h
4151
- name: Build and Test
42-
# Mark the job as a success even if the step fails so that people do
43-
# not get notified while the new premerge pipeline is in an
44-
# experimental state.
45-
# TODO(boomanaiden154): Remove this once the pipeline is stable and we
46-
# are ready for people to start recieving notifications.
47-
continue-on-error: true
4852
run: |
4953
git config --global --add safe.directory '*'
5054
@@ -56,16 +60,66 @@ jobs:
5660
5761
. ./.ci/compute-projects.sh
5862
59-
all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl"
60-
modified_projects="$(keep-modified-projects ${all_projects})"
63+
linux_projects="clang lldb"
64+
linux_check_targets="check-clang check-lldb"
65+
linux_runtimes=""
66+
linux_runtime_check_targets=""
67+
68+
if [[ "${linux_projects}" == "" ]]; then
69+
echo "No projects to build"
70+
exit 0
71+
fi
72+
73+
echo "Building projects: ${linux_projects}"
74+
echo "Running project checks targets: ${linux_check_targets}"
75+
echo "Building runtimes: ${linux_runtimes}"
76+
echo "Running runtimes checks targets: ${linux_runtime_check_targets}"
77+
78+
export CC=clang
79+
export CXX=clang++
80+
81+
./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"
82+
83+
premerge-checks-linux-lld:
84+
if: (github.event_name != 'pull_request' || github.event.action != 'closed')
85+
runs-on: ubuntu-22.04
86+
steps:
87+
- name: Free up space in Github runner
88+
uses: easimon/maximize-build-space@master
89+
with:
90+
remove-dotnet: 'true'
91+
remove-android: 'true'
92+
remove-haskell: 'true'
93+
remove-codeql: 'true'
94+
root-reserve-mb: 2048
95+
- name: Checkout LLVM
96+
uses: actions/checkout@v4
97+
with:
98+
fetch-depth: 2
99+
- name: Setup ccache
100+
uses: hendrikmuhs/[email protected]
101+
with:
102+
max-size: "1500M"
103+
- name: Print free space
104+
run: |
105+
echo "Free space:"
106+
df -h
107+
- name: Build and Test
108+
run: |
109+
git config --global --add safe.directory '*'
110+
111+
modified_files=$(git diff --name-only HEAD~1...HEAD)
112+
modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u)
61113
62-
linux_projects_to_test=$(exclude-linux $(compute-projects-to-test 0 ${modified_projects}))
63-
linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq)
64-
linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq)
114+
echo $modified_files
115+
echo $modified_dirs
116+
117+
. ./.ci/compute-projects.sh
65118
66-
linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test})
67-
linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq)
68-
linux_runtimes=$(echo ${linux_runtimes_to_test} | sort | uniq)
119+
linux_projects="lld"
120+
linux_check_targets="check-lld"
121+
linux_runtimes=""
122+
linux_runtime_check_targets=""
69123
70124
if [[ "${linux_projects}" == "" ]]; then
71125
echo "No projects to build"
@@ -77,16 +131,72 @@ jobs:
77131
echo "Building runtimes: ${linux_runtimes}"
78132
echo "Running runtimes checks targets: ${linux_runtime_check_targets}"
79133
80-
export CC=/opt/llvm/bin/clang
81-
export CXX=/opt/llvm/bin/clang++
134+
export CC=clang
135+
export CXX=clang++
136+
137+
./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"
138+
139+
premerge-checks-linux-llvm:
140+
if: (github.event_name != 'pull_request' || github.event.action != 'closed')
141+
runs-on: ubuntu-22.04
142+
steps:
143+
- name: Free up space in Github runner
144+
uses: easimon/maximize-build-space@master
145+
with:
146+
remove-dotnet: 'true'
147+
remove-android: 'true'
148+
remove-haskell: 'true'
149+
remove-codeql: 'true'
150+
root-reserve-mb: 2048
151+
- name: Checkout LLVM
152+
uses: actions/checkout@v4
153+
with:
154+
fetch-depth: 2
155+
- name: Setup ccache
156+
uses: hendrikmuhs/[email protected]
157+
with:
158+
max-size: "1500M"
159+
- name: Print free space
160+
run: |
161+
echo "Free space:"
162+
df -h
163+
- name: Build and Test
164+
run: |
165+
git config --global --add safe.directory '*'
166+
167+
modified_files=$(git diff --name-only HEAD~1...HEAD)
168+
modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort -u)
169+
170+
echo $modified_files
171+
echo $modified_dirs
172+
173+
. ./.ci/compute-projects.sh
174+
175+
linux_projects="llvm"
176+
linux_check_targets="check-llvm"
177+
linux_runtimes=""
178+
linux_runtime_check_targets=""
179+
180+
if [[ "${linux_projects}" == "" ]]; then
181+
echo "No projects to build"
182+
exit 0
183+
fi
184+
185+
echo "Building projects: ${linux_projects}"
186+
echo "Running project checks targets: ${linux_check_targets}"
187+
echo "Building runtimes: ${linux_runtimes}"
188+
echo "Running runtimes checks targets: ${linux_runtime_check_targets}"
189+
190+
export CC=clang
191+
export CXX=clang++
82192
83193
./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"
84194
85195
premerge-checks-windows:
86196
if: >-
87-
false && github.repository_owner == 'llvm' &&
88-
(github.event_name != 'pull_request' || github.event.action != 'closed')
89-
runs-on: llvm-premerge-windows-runners
197+
false && github.repository_owner == 'llvm' &&
198+
(github.event_name != 'pull_request' || github.event.action != 'closed')
199+
runs-on: windows-2022
90200
defaults:
91201
run:
92202
shell: bash
@@ -128,12 +238,6 @@ jobs:
128238
echo "windows-projects=${windows_projects}" >> $GITHUB_OUTPUT
129239
echo "windows-check-targets=${windows_check_targets}" >> $GITHUB_OUTPUT
130240
- name: Build and Test
131-
# Mark the job as a success even if the step fails so that people do
132-
# not get notified while the new premerge pipeline is in an
133-
# experimental state.
134-
# TODO(boomanaiden154): Remove this once the pipeline is stable and we
135-
# are ready for people to start recieving notifications.
136-
continue-on-error: true
137241
if: ${{ steps.vars.outputs.windows-projects != '' }}
138242
shell: cmd
139243
run: |
@@ -144,11 +248,7 @@ jobs:
144248
145249
permerge-check-macos:
146250
runs-on: macos-14
147-
if: >-
148-
github.repository_owner == 'llvm' &&
149-
(startswith(github.ref_name, 'release/') ||
150-
startswith(github.base_ref, 'release/')) &&
151-
(github.event_name != 'pull_request' || github.event.action != 'closed')
251+
if: (github.event_name != 'pull_request' || github.event.action != 'closed')
152252
steps:
153253
- name: Checkout LLVM
154254
uses: actions/checkout@v4
@@ -170,7 +270,7 @@ jobs:
170270
171271
. ./.ci/compute-projects.sh
172272
173-
all_projects="clang clang-tools-extra lld lldb llvm mlir"
273+
all_projects="clang lld lldb llvm"
174274
modified_projects="$(keep-modified-projects ${all_projects})"
175275
176276
# We have to disable the runtimes builds due to https://github.com/llvm/llvm-project/issues/90568

clang/lib/Basic/Targets/BPF.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ ArrayRef<Builtin::Info> BPFTargetInfo::getTargetBuiltins() const {
9595

9696
bool BPFTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
9797
DiagnosticsEngine &Diags) {
98-
// TODO: The SBF back-end now provides the sbf target. Issue deprecation
99-
// warning directing use of '-target sbf' instead. Eventually remove the
100-
// +solana support from the BPF back-end.
101-
if (getTriple().getArch() != llvm::Triple::sbf && HasSolanaFeature)
102-
Diags.Report(diag::warn_drv_no_solana_with_bpf);
103-
10498
for (const auto &Feature : Features) {
10599
if (Feature == "+alu32") {
106100
HasAlu32 = true;

clang/test/Misc/warning-flags.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ CHECK-NEXT: warn_double_const_requires_fp64
4545
CHECK-NEXT: warn_drv_amdgpu_cov6
4646
CHECK-NEXT: warn_drv_assuming_mfloat_abi_is
4747
CHECK-NEXT: warn_drv_clang_unsupported
48-
CHECK-NEXT: warn_drv_no_solana_with_bpf
4948
CHECK-NEXT: warn_drv_pch_not_first_include
5049
CHECK-NEXT: warn_expected_qualified_after_typename
5150
CHECK-NEXT: warn_fe_backend_unsupported

lld/ELF/Arch/SBF.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace elf {
2525
namespace {
2626
class SBF final : public TargetInfo {
2727
public:
28-
SBF();
28+
SBF(Ctx & ctx);
2929
RelExpr getRelExpr(RelType type, const Symbol &s,
3030
const uint8_t *loc) const override;
3131
RelType getDynRel(RelType type) const override;
@@ -54,7 +54,7 @@ RelExpr SBF::getRelExpr(RelType type, const Symbol &s,
5454
case R_SBF_64_64:
5555
return R_ABS;
5656
default:
57-
error(getErrorLocation(loc) + "unrecognized reloc " + toString(type));
57+
Err(ctx) << getErrorLoc(ctx, loc) << "unrecognized reloc " << type.v;
5858
}
5959
return R_NONE;
6060
}
@@ -113,12 +113,12 @@ void SBF::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const {
113113
break;
114114
}
115115
default:
116-
error(getErrorLocation(loc) + "unrecognized reloc " + toString(rel.type));
116+
Err(ctx) << getErrorLoc(ctx, loc) << "unrecognized reloc " << rel.type.v;
117117
}
118118
}
119119

120-
static uint32_t getEFlags(InputFile *file) {
121-
if (config->ekind == ELF64BEKind)
120+
static uint32_t getEFlags(InputFile *file, Ctx &ctx) {
121+
if (ctx.arg.ekind == ELF64BEKind)
122122
return cast<ObjFile<ELF64BE>>(file)->getObj().getHeader().e_flags;
123123
return cast<ObjFile<ELF64LE>>(file)->getObj().getHeader().e_flags;
124124
}
@@ -129,7 +129,7 @@ uint32_t SBF::calcEFlags() const {
129129
// Ensure that all the object files were compiled with the same flags, as
130130
// different flags indicate different ABIs.
131131
for (InputFile *f : ctx.objectFiles) {
132-
uint32_t flags = getEFlags(f);
132+
uint32_t flags = getEFlags(f, ctx);
133133
if (ret == 0) {
134134
ret = flags;
135135
} else if (ret != flags) {

lld/ELF/InputSection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ void InputSection::relocateNonAlloc(Ctx &ctx, uint8_t *buf,
10431043
const uint64_t offset = rel.r_offset;
10441044

10451045
// FIX: Temporary remap BPF_64_64 relocations in debug sections.
1046-
if (config->emachine == EM_SBF && type == R_SBF_64_64 && isDebug)
1046+
if (ctx.arg.emachine == EM_SBF && type == R_SBF_64_64 && isDebug)
10471047
type = R_BPF_64_ABS64;
10481048

10491049
uint8_t *bufLoc = buf + offset;

lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void DWARFDebugAranges::extract(const DWARFDataExtractor &debug_aranges_data) {
4141
}
4242
const uint64_t cu_offset = set.getCompileUnitDIEOffset();
4343
for (const auto &desc : set.descriptors()) {
44-
if (desc.Length != 0 && desc.Address > 0)
44+
if (desc.Length != 0)
4545
m_aranges.Append(
4646
RangeToDIE::Entry(desc.Address, desc.Length, cu_offset));
4747
}
@@ -63,7 +63,7 @@ void DWARFDebugAranges::Dump(Log *log) const {
6363

6464
void DWARFDebugAranges::AppendRange(dw_offset_t offset, dw_addr_t low_pc,
6565
dw_addr_t high_pc) {
66-
if (high_pc > low_pc && low_pc > 0)
66+
if (high_pc > low_pc)
6767
m_aranges.Append(RangeToDIE::Entry(low_pc, high_pc - low_pc, offset));
6868
}
6969

0 commit comments

Comments
 (0)