rust/compiler/rustc_codegen_llvm/src
bors ed43cbcb88 Auto merge of #134299 - RalfJung:remove-start, r=compiler-errors
remove support for the (unstable) #[start] attribute

As explained by `@Noratrieb:`
`#[start]` should be deleted. It's nothing but an accidentally leaked implementation detail that's a not very useful mix between "portable" entrypoint logic and bad abstraction.

I think the way the stable user-facing entrypoint should work (and works today on stable) is pretty simple:
- `std`-using cross-platform programs should use `fn main()`. the compiler, together with `std`, will then ensure that code ends up at `main` (by having a platform-specific entrypoint that gets directed through `lang_start` in `std` to `main` - but that's just an implementation detail)
- `no_std` platform-specific programs should use `#![no_main]` and define their own platform-specific entrypoint symbol with `#[no_mangle]`, like `main`, `_start`, `WinMain` or `my_embedded_platform_wants_to_start_here`. most of them only support a single platform anyways, and need cfg for the different platform's ways of passing arguments or other things *anyways*

`#[start]` is in a super weird position of being neither of those two. It tries to pretend that it's cross-platform, but its signature is  a total lie. Those arguments are just stubbed out to zero on ~~Windows~~ wasm, for example. It also only handles the platform-specific entrypoints for a few platforms that are supported by `std`, like Windows or Unix-likes. `my_embedded_platform_wants_to_start_here` can't use it, and neither could a libc-less Linux program.
So we have an attribute that only works in some cases anyways, that has a signature that's a total lie (and a signature that, as I might want to add, has changed recently, and that I definitely would not be comfortable giving *any* stability guarantees on), and where there's a pretty easy way to get things working without it in the first place.

Note that this feature has **not** been RFCed in the first place.

*This comment was posted [in May](https://github.com/rust-lang/rust/issues/29633#issuecomment-2088596042) and so far nobody spoke up in that issue with a usecase that would require keeping the attribute.*

Closes https://github.com/rust-lang/rust/issues/29633

try-job: x86_64-gnu-nopt
try-job: x86_64-msvc-1
try-job: x86_64-msvc-2
try-job: test-various
2025-01-21 19:46:20 +00:00
..
back Rollup merge of #133752 - klensy:cp, r=davidtwco 2025-01-13 15:56:55 +01:00
builder upstream rustc_codegen_llvm changes for enzyme/autodiff 2025-01-01 21:42:45 +01:00
coverageinfo coverage: Add a synthetic test for when all spans are discarded 2024-12-19 22:03:43 +11:00
debuginfo Auto merge of #135643 - khuey:135332, r=jieyouxu 2025-01-20 14:16:22 +00:00
llvm Treat undef bytes as equal to any other byte 2025-01-21 08:27:21 +00:00
abi.rs Add gpu-kernel calling convention 2025-01-16 00:26:55 +01:00
allocator.rs Clean up FFI calls for operand bundles 2024-10-30 13:26:24 +11:00
asm.rs Auto merge of #129181 - beetrees:asm-spans, r=pnkfelix,compiler-errors 2024-12-12 02:34:06 +00:00
attributes.rs Rollup merge of #134030 - folkertdev:min-fn-align, r=workingjubilee 2025-01-11 18:13:45 +01:00
base.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
builder.rs Remove range-metadata amdgpu workaround 2025-01-02 15:45:04 +01:00
callee.rs rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structures 2024-12-16 19:08:19 +01:00
common.rs Treat undef bytes as equal to any other byte 2025-01-21 08:27:21 +00:00
consts.rs Rollup merge of #127483 - BertalanD:no_sanitize-global-var, r=rcvalle 2024-11-23 20:19:51 +08:00
context.rs Auto merge of #134299 - RalfJung:remove-start, r=compiler-errors 2025-01-21 19:46:20 +00:00
declare.rs Add gpu-kernel calling convention 2025-01-16 00:26:55 +01:00
errors.rs Auto merge of #134794 - RalfJung:abi-required-target-features, r=workingjubilee 2025-01-05 23:21:06 +00:00
intrinsic.rs Override carrying_mul_add in cg_llvm 2024-12-27 08:17:40 -08:00
lib.rs upstream rustc_codegen_llvm changes for enzyme/autodiff 2025-01-01 21:42:45 +01:00
llvm_util.rs Rollup merge of #131830 - hoodmane:emscripten-wasm-eh, r=workingjubilee 2025-01-06 22:04:13 -05:00
mono_item.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
type_.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
type_of.rs make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
va_arg.rs Teach rust core about Xtensa VaListImpl and add a custom lowering of vaarg for xtensa. 2024-12-03 10:54:08 +00:00
value.rs Add warn(unreachable_pub) to rustc_codegen_llvm. 2024-08-16 08:46:57 +10:00