-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #1832 - hyd-dev:1776-follow-up, r=RalfJung
Report an error if a `#[no_mangle]`/`#[export_name = ...]` function has the same symbol name as a built-in shim Implements #1776 (comment). The error looks like this: ``` error: found `malloc` symbol definition that clashes with a built-in shim --> tests/compile-fail/function_calls/exported_symbol_shim_clashing.rs:12:9 | 12 | malloc(0); | ^^^^^^^^^ found `malloc` symbol definition that clashes with a built-in shim | help: the `malloc` symbol is defined here --> tests/compile-fail/function_calls/exported_symbol_shim_clashing.rs:2:1 | 2 | / extern "C" fn malloc(_: usize) -> *mut std::ffi::c_void { 3 | | //~^ HELP the `malloc` symbol is defined here 4 | | unreachable!() 5 | | } | |_^ = note: inside `main` at tests/compile-fail/function_calls/exported_symbol_shim_clashing.rs:12:9 ``` This does not implement "better error messages than we do currently for arg/ABI mismatches" in #1776 (comment) -- I failed to remove all `check_arg_count()` and `check_abi()` (they are still used in `src/shims/intrinsics.rs` and `call_dlsym()`) and they don't receive the name of the shim.
- Loading branch information
Showing
13 changed files
with
350 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.