rust/compiler/rustc_codegen_gcc/src
Matthias Krüger 7c3b2e5254
Rollup merge of #140770 - folkertdev:custom-abi, r=tgross35
add `extern "custom"` functions

tracking issue: rust-lang/rust#140829
previous discussion: https://github.com/rust-lang/rust/issues/140566

In short, an `extern "custom"` function is a function with a custom ABI, that rust does not know about. Therefore, such functions can only be defined with `#[unsafe(naked)]` and `naked_asm!`, or via an `extern "C" { /* ... */ }` block. These functions cannot be called using normal rust syntax: calling them can only be done from inline assembly.

The motivation is low-level scenarios where a custom calling convention is used. Currently, we often pick `extern "C"`, but that is a lie because the function does not actually respect the C calling convention.

At the moment `"custom"` seems to be the name with the most support. That name is not final, but we need to pick something to actually implement this.

r? `@traviscross`
cc `@tgross35`

try-job: x86_64-apple-2
2025-06-13 05:19:14 +02:00
..
back Merge commit '6ba33f5e11' into subtree-update_cg_gcc_2025-05-14 2025-05-14 13:51:02 +02:00
intrinsic Remove type_test from IntrinsicCallBuilderMethods 2025-06-03 10:00:56 +00:00
abi.rs add extern "custom" functions 2025-06-12 20:27:10 +02:00
allocator.rs Remove implicit #[no_mangle] for #[rustc_std_internal_symbol] 2025-03-17 14:08:09 +00:00
asm.rs Rollup merge of #134232 - bjorn3:naked_asm_improvements, r=wesleywiser 2025-04-30 17:27:57 +02:00
attributes.rs Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
base.rs Make predefine methods take &mut self 2025-05-28 20:55:00 +00:00
builder.rs get rid of rustc_codegen_ssa::common::AtomicOrdering 2025-05-28 22:57:55 +02:00
callee.rs Remove rustc_attr_data_structures re-export from rustc_attr_parsing 2025-05-18 18:14:43 +02:00
common.rs Merge commit '4f83a4258d' into subtree-update_cg_gcc_2025-04-25 2025-04-25 10:44:19 -04:00
consts.rs store target.min_global_align as an Align 2025-06-07 22:06:42 +02:00
context.rs Remove codegen_unit from MiscCodegenMethods 2025-05-28 20:55:00 +00:00
coverageinfo.rs Unbox and unwrap the contents of StatementKind::Coverage 2024-03-23 22:05:11 +11:00
debuginfo.rs Remove get_dbg_loc from DebugInfoBuilderMethods 2025-06-03 10:00:11 +00:00
declare.rs Merge commit '6ba33f5e11' into subtree-update_cg_gcc_2025-05-14 2025-05-14 13:51:02 +02:00
errors.rs -Zretpoline and -Zretpoline-external-thunk flags (target modifiers) to enable retpoline-related target features 2025-06-09 21:29:59 +07:00
gcc_util.rs -Zretpoline and -Zretpoline-external-thunk flags (target modifiers) to enable retpoline-related target features 2025-06-09 21:29:59 +07:00
int.rs cg_gcc: convert to CanonAbi 2025-06-03 10:04:19 -07:00
lib.rs Remove all unused feature gates from the compiler 2025-06-08 14:50:42 +00:00
mono_item.rs Make predefine methods take &mut self 2025-05-28 20:55:00 +00:00
type_.rs Generalize BaseTypeCodegenMethods 2025-02-24 15:11:29 +00:00
type_of.rs Merge commit '4f83a4258d' into subtree-update_cg_gcc_2025-04-25 2025-04-25 10:44:19 -04:00