Commit graph

19 commits

Author SHA1 Message Date
Amanieu d'Antras
abc0660118 Remove #[alloc_error_handler] from the compiler and library 2023-04-16 08:35:50 -07:00
Collin Baker
cb41803899 Don't export of __rust_* alloc symbols if not codegened 2023-03-09 19:21:44 -05:00
bjorn3
e25566e20b Merge commit '7d53619064' into sync_cg_clif-2023-02-09 2023-02-09 12:38:16 +01:00
bjorn3
949699931e Merge commit '2bb3996244' into sync_cg_clif-2022-12-14 2022-12-14 19:30:46 +01:00
Amanieu d'Antras
56074b5231 Rewrite implementation of #[alloc_error_handler]
The new implementation doesn't use weak lang items and instead changes
`#[alloc_error_handler]` to an attribute macro just like
`#[global_allocator]`.

The attribute will generate the `__rg_oom` function which is called by
the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom`
function is defined in any crate then the compiler shim will call
`__rdl_oom` in the alloc crate which will simply panic.

This also fixes link errors with `-C link-dead-code` with
`default_alloc_error_handler`: `__rg_oom` was previously defined in the
alloc crate and would attempt to reference the `oom` lang item, even if
it didn't exist. This worked as long as `__rg_oom` was excluded from
linking since it was not called.

This is a prerequisite for the stabilization of
`default_alloc_error_handler` (#102318).
2022-10-31 16:32:57 +00:00
bjorn3
e54a13f18b Merge commit '266e96785a' into sync_cg_clif-2022-10-23 2022-10-23 16:22:55 +02:00
Joshua Nelson
3c9765cff1 Rename debugging_opts to unstable_opts
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`).
Rename it to be more clear.
2022-07-13 17:47:06 -05:00
Amanieu d'Antras
aa36237e16 Add -Z oom={panic,abort} command-line option 2022-03-03 12:58:38 +00:00
bjorn3
f596dce542 Merge commit '35d9c6bf25' into sync_cg_clif-2022-02-23 2022-02-23 11:49:34 +01:00
bjorn3
279f486960 Merge commit '05677b6bd6' into sync_cg_clif-2021-08-06 2021-08-06 16:26:56 +02:00
Camille GILLOT
6a371d2c89 Make allocator_kind a query. 2021-06-20 11:52:51 +02:00
Camille Gillot
0f0f3138cb
Revert "Reduce the amount of untracked state in TyCtxt" 2021-06-01 09:05:22 +02:00
Camille GILLOT
ee94fbb607 Make allocator_kind a query. 2021-05-30 19:58:01 +02:00
Camille GILLOT
85a14d70bb Use () in dependency_formats. 2021-05-12 13:58:41 +02:00
Erin Power
505aa48f24 Sync rustc_codegen_cranelift 'ddd4ce2553' 2021-04-30 14:49:58 +02:00
bjorn3
5444b46234 Merge commit '0969bc6dde' into sync_cg_clif-2021-03-29 2021-03-29 10:45:09 +02:00
bjorn3
7a6ea77473 Merge commit '9a0c32934e' into sync_cg_clif-2021-03-05 2021-03-05 19:12:59 +01:00
bjorn3
216c4ae463 Merge commit '03f01bbe90' into update_cg_clif-2020-11-01 2020-11-03 11:00:04 +01:00
bjorn3
ac4f7deb2f Add 'compiler/rustc_codegen_cranelift/' from commit '793d26047f'
git-subtree-dir: compiler/rustc_codegen_cranelift
git-subtree-mainline: cf798c1ec6
git-subtree-split: 793d26047f
2020-10-26 09:53:27 +01:00