Skip to content

Commit 48a52d9

Browse files
authored
Merge pull request #843 from rust-lang/fix/debuginfo-lang-filename
Set gcc language name and compilation unit name
2 parents 94e2af7 + 4a6325d commit 48a52d9

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ dependencies = [
5656

5757
[[package]]
5858
name = "gccjit"
59-
version = "3.1.1"
59+
version = "3.2.0"
6060
source = "registry+https://github.com/rust-lang/crates.io-index"
61-
checksum = "ff80f4d6d0749eab3a69122210b3a1fdd52edb6162781aadd7c4842e26983683"
61+
checksum = "ef03c8ae23826a0755b980999a553a262c61f2f585245e647192d95bf09eee79"
6262
dependencies = [
6363
"gccjit_sys",
6464
]
6565

6666
[[package]]
6767
name = "gccjit_sys"
68-
version = "1.1.2"
68+
version = "1.2.0"
6969
source = "registry+https://github.com/rust-lang/crates.io-index"
70-
checksum = "4f81d901767ddba371a619fa9bba657066a4d3c5607ee69bbb557c1c5ba9bf85"
70+
checksum = "0ff511da413e4a5da6f09607748395ba37525e01ba7d322cbec3efc43095dd60"
7171
dependencies = [
7272
"libc",
7373
]

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ default = ["master"]
2424
[dependencies]
2525
object = { version = "0.37.0", default-features = false, features = ["std", "read"] }
2626
tempfile = "3.20"
27-
gccjit = { version = "3.1.1", features = ["dlopen"] }
27+
gccjit = { version = "3.2.0", features = ["dlopen"] }
2828
#gccjit = { git = "https://github.com/rust-lang/gccjit.rs", branch = "error-dlopen", features = ["dlopen"] }
2929

3030
# Local copy.

libgccjit.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0081ca6631abdfa02bf42bc85aaf507b8a0e6beb
1+
586d798e864fb33b1b4e842c5493a653841a7c02

src/context.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ use rustc_middle::ty::layout::{
1919
};
2020
use rustc_middle::ty::{self, ExistentialTraitRef, Instance, Ty, TyCtxt};
2121
use rustc_session::Session;
22+
#[cfg(feature = "master")]
23+
use rustc_session::config::DebugInfo;
2224
use rustc_span::source_map::respan;
2325
use rustc_span::{DUMMY_SP, Span};
2426
use rustc_target::spec::{HasTargetSpec, HasX86AbiOpt, Target, TlsModel, X86Abi};
@@ -143,6 +145,11 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
143145
supports_f64_type: bool,
144146
supports_f128_type: bool,
145147
) -> Self {
148+
#[cfg(feature = "master")]
149+
if tcx.sess.opts.debuginfo != DebugInfo::None {
150+
context.set_filename(codegen_unit.name().as_str());
151+
}
152+
146153
let create_type = |ctype, rust_type| {
147154
let layout = tcx
148155
.layout_of(ty::TypingEnv::fully_monomorphized().as_query_input(rust_type))

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ impl CodegenBackend for GccCodegenBackend {
240240

241241
#[cfg(feature = "master")]
242242
{
243+
gccjit::set_lang_name(c"GNU Rust");
244+
243245
let target_cpu = target_cpu(sess);
244246

245247
// Get the second TargetInfo with the correct CPU features by setting the arch.

0 commit comments

Comments
 (0)