Skip to content

Commit d0d2e60

Browse files
committed
Merge commit '659243d85c7489412bd0faa1c068d904a6042941' into sync_cg_clif-2024-07-13
1 parent 776ab98 commit d0d2e60

File tree

10 files changed

+94
-77
lines changed

10 files changed

+94
-77
lines changed

Cargo.lock

+47-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust-toolchain

+1-1
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"]

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
# =============================================

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,

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
}

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
};

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)