Skip to content

Commit 00167ab

Browse files
committed
Auto merge of rust-lang#127694 - bjorn3:sync_cg_clif-2024-07-13, r=bjorn3
Subtree sync for rustc_codegen_cranelift Couple of bug fixes this time. Fixes rust-lang#125545 r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2 parents fcaa6fd + 6ff363f commit 00167ab

File tree

10 files changed

+94
-77
lines changed

10 files changed

+94
-77
lines changed

compiler/rustc_codegen_cranelift/Cargo.lock

+47-47
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ dependencies = [
1616

1717
[[package]]
1818
name = "anyhow"
19-
version = "1.0.82"
19+
version = "1.0.86"
2020
source = "registry+https://github.com/rust-lang/crates.io-index"
21-
checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519"
21+
checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
2222

2323
[[package]]
2424
name = "arbitrary"
@@ -67,7 +67,7 @@ dependencies = [
6767
"cranelift-entity",
6868
"cranelift-isle",
6969
"gimli",
70-
"hashbrown 0.14.3",
70+
"hashbrown 0.14.5",
7171
"log",
7272
"regalloc2",
7373
"rustc-hash",
@@ -182,9 +182,9 @@ dependencies = [
182182

183183
[[package]]
184184
name = "crc32fast"
185-
version = "1.4.0"
185+
version = "1.4.2"
186186
source = "registry+https://github.com/rust-lang/crates.io-index"
187-
checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa"
187+
checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3"
188188
dependencies = [
189189
"cfg-if",
190190
]
@@ -203,9 +203,9 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
203203

204204
[[package]]
205205
name = "gimli"
206-
version = "0.28.0"
206+
version = "0.28.1"
207207
source = "registry+https://github.com/rust-lang/crates.io-index"
208-
checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0"
208+
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
209209
dependencies = [
210210
"fallible-iterator",
211211
"indexmap",
@@ -223,9 +223,9 @@ dependencies = [
223223

224224
[[package]]
225225
name = "hashbrown"
226-
version = "0.14.3"
226+
version = "0.14.5"
227227
source = "registry+https://github.com/rust-lang/crates.io-index"
228-
checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
228+
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
229229
dependencies = [
230230
"ahash",
231231
]
@@ -237,30 +237,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
237237
checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
238238
dependencies = [
239239
"equivalent",
240-
"hashbrown 0.14.3",
240+
"hashbrown 0.14.5",
241241
]
242242

243243
[[package]]
244244
name = "libc"
245-
version = "0.2.153"
245+
version = "0.2.155"
246246
source = "registry+https://github.com/rust-lang/crates.io-index"
247-
checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
247+
checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
248248

249249
[[package]]
250250
name = "libloading"
251-
version = "0.8.3"
251+
version = "0.8.4"
252252
source = "registry+https://github.com/rust-lang/crates.io-index"
253-
checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19"
253+
checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d"
254254
dependencies = [
255255
"cfg-if",
256256
"windows-targets",
257257
]
258258

259259
[[package]]
260260
name = "log"
261-
version = "0.4.21"
261+
version = "0.4.22"
262262
source = "registry+https://github.com/rust-lang/crates.io-index"
263-
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
263+
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
264264

265265
[[package]]
266266
name = "mach"
@@ -273,9 +273,9 @@ dependencies = [
273273

274274
[[package]]
275275
name = "memchr"
276-
version = "2.7.2"
276+
version = "2.7.4"
277277
source = "registry+https://github.com/rust-lang/crates.io-index"
278-
checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
278+
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
279279

280280
[[package]]
281281
name = "object"
@@ -284,7 +284,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
284284
checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce"
285285
dependencies = [
286286
"crc32fast",
287-
"hashbrown 0.14.3",
287+
"hashbrown 0.14.5",
288288
"indexmap",
289289
"memchr",
290290
]
@@ -297,9 +297,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
297297

298298
[[package]]
299299
name = "proc-macro2"
300-
version = "1.0.81"
300+
version = "1.0.86"
301301
source = "registry+https://github.com/rust-lang/crates.io-index"
302-
checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba"
302+
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
303303
dependencies = [
304304
"unicode-ident",
305305
]
@@ -382,9 +382,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
382382

383383
[[package]]
384384
name = "syn"
385-
version = "2.0.60"
385+
version = "2.0.70"
386386
source = "registry+https://github.com/rust-lang/crates.io-index"
387-
checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3"
387+
checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16"
388388
dependencies = [
389389
"proc-macro2",
390390
"quote",
@@ -393,9 +393,9 @@ dependencies = [
393393

394394
[[package]]
395395
name = "target-lexicon"
396-
version = "0.12.14"
396+
version = "0.12.15"
397397
source = "registry+https://github.com/rust-lang/crates.io-index"
398-
checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
398+
checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2"
399399

400400
[[package]]
401401
name = "unicode-ident"
@@ -454,9 +454,9 @@ dependencies = [
454454

455455
[[package]]
456456
name = "windows-targets"
457-
version = "0.52.5"
457+
version = "0.52.6"
458458
source = "registry+https://github.com/rust-lang/crates.io-index"
459-
checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
459+
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
460460
dependencies = [
461461
"windows_aarch64_gnullvm",
462462
"windows_aarch64_msvc",
@@ -470,66 +470,66 @@ dependencies = [
470470

471471
[[package]]
472472
name = "windows_aarch64_gnullvm"
473-
version = "0.52.5"
473+
version = "0.52.6"
474474
source = "registry+https://github.com/rust-lang/crates.io-index"
475-
checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
475+
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
476476

477477
[[package]]
478478
name = "windows_aarch64_msvc"
479-
version = "0.52.5"
479+
version = "0.52.6"
480480
source = "registry+https://github.com/rust-lang/crates.io-index"
481-
checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
481+
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
482482

483483
[[package]]
484484
name = "windows_i686_gnu"
485-
version = "0.52.5"
485+
version = "0.52.6"
486486
source = "registry+https://github.com/rust-lang/crates.io-index"
487-
checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
487+
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
488488

489489
[[package]]
490490
name = "windows_i686_gnullvm"
491-
version = "0.52.5"
491+
version = "0.52.6"
492492
source = "registry+https://github.com/rust-lang/crates.io-index"
493-
checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
493+
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
494494

495495
[[package]]
496496
name = "windows_i686_msvc"
497-
version = "0.52.5"
497+
version = "0.52.6"
498498
source = "registry+https://github.com/rust-lang/crates.io-index"
499-
checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
499+
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
500500

501501
[[package]]
502502
name = "windows_x86_64_gnu"
503-
version = "0.52.5"
503+
version = "0.52.6"
504504
source = "registry+https://github.com/rust-lang/crates.io-index"
505-
checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
505+
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
506506

507507
[[package]]
508508
name = "windows_x86_64_gnullvm"
509-
version = "0.52.5"
509+
version = "0.52.6"
510510
source = "registry+https://github.com/rust-lang/crates.io-index"
511-
checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
511+
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
512512

513513
[[package]]
514514
name = "windows_x86_64_msvc"
515-
version = "0.52.5"
515+
version = "0.52.6"
516516
source = "registry+https://github.com/rust-lang/crates.io-index"
517-
checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
517+
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
518518

519519
[[package]]
520520
name = "zerocopy"
521-
version = "0.7.32"
521+
version = "0.7.35"
522522
source = "registry+https://github.com/rust-lang/crates.io-index"
523-
checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
523+
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
524524
dependencies = [
525525
"zerocopy-derive",
526526
]
527527

528528
[[package]]
529529
name = "zerocopy-derive"
530-
version = "0.7.32"
530+
version = "0.7.35"
531531
source = "registry+https://github.com/rust-lang/crates.io-index"
532-
checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
532+
checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
533533
dependencies = [
534534
"proc-macro2",
535535
"quote",
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2024-06-30"
2+
channel = "nightly-2024-07-13"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]

compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ rm tests/ui/parser/unclosed-delimiter-in-dep.rs # submodule contains //~ERROR
3434

3535
# vendor intrinsics
3636
rm tests/ui/asm/x86_64/evex512-implicit-feature.rs # unimplemented AVX512 x86 vendor intrinsic
37+
rm tests/ui/simd/dont-invalid-bitcast-x86_64.rs # unimplemented llvm.x86.sse41.round.ps
3738

3839
# exotic linkages
3940
rm tests/incremental/hashes/function_interfaces.rs
@@ -56,13 +57,13 @@ rm -r tests/run-make/target-specs # i686 not supported by Cranelift
5657
rm -r tests/run-make/mismatching-target-triples # same
5758
rm tests/ui/asm/x86_64/issue-96797.rs # const and sym inline asm operands don't work entirely correctly
5859
rm tests/ui/asm/x86_64/goto.rs # inline asm labels not supported
60+
rm tests/ui/simd/simd-bitmask-notpow2.rs # non-pow-of-2 simd vector sizes
5961

6062
# requires LTO
6163
rm -r tests/run-make/cdylib
6264
rm -r tests/run-make/codegen-options-parsing
6365
rm -r tests/run-make/lto-*
6466
rm -r tests/run-make/reproducible-build-2
65-
rm -r tests/run-make/issue-109934-lto-debuginfo
6667
rm -r tests/run-make/no-builtins-lto
6768
rm -r tests/run-make/reachable-extern-fn-available-lto
6869

@@ -109,6 +110,7 @@ rm -r tests/run-make/symbols-include-type-name
109110
rm -r tests/run-make/notify-all-emit-artifacts
110111
rm -r tests/run-make/reset-codegen-1
111112
rm -r tests/run-make/inline-always-many-cgu
113+
rm -r tests/run-make/intrinsic-unreachable
112114

113115
# giving different but possibly correct results
114116
# =============================================

compiler/rustc_codegen_cranelift/src/abi/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ pub(crate) fn codegen_terminator_call<'tcx>(
395395
crate::intrinsics::codegen_llvm_intrinsic_call(
396396
fx,
397397
&fx.tcx.symbol_name(instance).name,
398-
fn_args,
399398
args,
400399
ret_place,
401400
target,

compiler/rustc_codegen_cranelift/src/archive.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ impl ArchiveBuilderBuilder for ArArchiveBuilderBuilder {
1414

1515
fn create_dll_import_lib(
1616
&self,
17-
_sess: &Session,
17+
sess: &Session,
1818
_lib_name: &str,
1919
_dll_imports: &[rustc_session::cstore::DllImport],
2020
_tmpdir: &Path,
2121
_is_direct_dependency: bool,
2222
) -> PathBuf {
23-
unimplemented!("creating dll imports is not yet supported");
23+
sess.dcx().fatal("raw-dylib is not yet supported by rustc_codegen_cranelift");
2424
}
2525
}

compiler/rustc_codegen_cranelift/src/constant.rs

+32-4
Original file line numberDiff line numberDiff line change
@@ -385,15 +385,43 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
385385

386386
if let Some(section_name) = section_name {
387387
let (segment_name, section_name) = if tcx.sess.target.is_like_osx {
388-
let section_name = section_name.as_str();
389-
if let Some(names) = section_name.split_once(',') {
390-
names
391-
} else {
388+
// See https://github.com/llvm/llvm-project/blob/main/llvm/lib/MC/MCSectionMachO.cpp
389+
let mut parts = section_name.as_str().split(',');
390+
let Some(segment_name) = parts.next() else {
392391
tcx.dcx().fatal(format!(
393392
"#[link_section = \"{}\"] is not valid for macos target: must be segment and section separated by comma",
394393
section_name
395394
));
395+
};
396+
let Some(section_name) = parts.next() else {
397+
tcx.dcx().fatal(format!(
398+
"#[link_section = \"{}\"] is not valid for macos target: must be segment and section separated by comma",
399+
section_name
400+
));
401+
};
402+
if section_name.len() > 16 {
403+
tcx.dcx().fatal(format!(
404+
"#[link_section = \"{}\"] is not valid for macos target: section name bigger than 16 bytes",
405+
section_name
406+
));
407+
}
408+
let section_type = parts.next().unwrap_or("regular");
409+
if section_type != "regular" && section_type != "cstring_literals" {
410+
tcx.dcx().fatal(format!(
411+
"#[link_section = \"{}\"] is not supported: unsupported section type {}",
412+
section_name, section_type,
413+
));
414+
}
415+
let _attrs = parts.next();
416+
if parts.next().is_some() {
417+
tcx.dcx().fatal(format!(
418+
"#[link_section = \"{}\"] is not valid for macos target: too many components",
419+
section_name
420+
));
396421
}
422+
// FIXME(bytecodealliance/wasmtime#8901) set S_CSTRING_LITERALS section type when
423+
// cstring_literals is specified
424+
(segment_name, section_name)
397425
} else {
398426
("", section_name.as_str())
399427
};

compiler/rustc_codegen_cranelift/src/debuginfo/object.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@ impl WriteDebugInfo for ObjectProduct {
3939
let section_id = self.object.add_section(
4040
segment,
4141
name,
42-
if id == SectionId::EhFrame { SectionKind::ReadOnlyData } else { SectionKind::Debug },
42+
if id == SectionId::DebugStr || id == SectionId::DebugLineStr {
43+
SectionKind::DebugString
44+
} else if id == SectionId::EhFrame {
45+
SectionKind::ReadOnlyData
46+
} else {
47+
SectionKind::Debug
48+
},
4349
);
4450
self.object
4551
.section_mut(section_id)

0 commit comments

Comments
 (0)