about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorAyush Singh <ayushsingh1325@gmail.com>2022-11-05 14:36:38 +0530
committerAyush Singh <ayushsingh1325@gmail.com>2022-11-11 01:04:39 +0530
commit9f0a8620bd7d325e6d42417b08daff3e55cb88f6 (patch)
tree1ca5c5d46e69c3efbf205b5a8169bdd7897b9fc4 /compiler/rustc_codegen_ssa/src
parent5b3e9090757da9a95b22f589fe39b6a4b5455b96 (diff)
downloadrust-9f0a8620bd7d325e6d42417b08daff3e55cb88f6.tar.gz
rust-9f0a8620bd7d325e6d42417b08daff3e55cb88f6.zip
Improve generating Custom entry function
This commit is aimed at making compiler generated entry functions
(Basically just C `main` right now) more generic so other targets can do
similar things for custom entry. This was initially implemented as part
of https://github.com/rust-lang/rust/pull/100316.

Currently, this moves the entry function name and Call convention to the
target spec.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/symbol_export.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs
index 752f6b1ef40..22f534d909a 100644
--- a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs
+++ b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs
@@ -180,7 +180,8 @@ fn exported_symbols_provider_local<'tcx>(
         .collect();
 
     if tcx.entry_fn(()).is_some() {
-        let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(tcx, "main"));
+        let exported_symbol =
+            ExportedSymbol::NoDefId(SymbolName::new(tcx, tcx.sess.target.entry_name.as_ref()));
 
         symbols.push((
             exported_symbol,