Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions compiler/rustc_target/src/spec/base/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ pub(crate) fn options() -> TargetOptions {
// stack overflow will be guaranteed to trap as it underflows instead of
// corrupting static data.
concat!($prefix, "--stack-first"),
// FIXME we probably shouldn't pass this but instead pass an explicit list
// of symbols we'll allow to be undefined. We don't currently have a
// mechanism of knowing, however, which symbols are intended to be imported
// from the environment and which are intended to be imported from other
// objects linked elsewhere. This is a coarse approximation but is sure to
// hide some bugs and frustrate someone at some point, so we should ideally
// work towards a world where we can explicitly list symbols that are
// supposed to be imported and have all other symbols generate errors if
// they remain undefined.
concat!($prefix, "--allow-undefined"),
// LLD only implements C++-like demangling, which doesn't match our own
// mangling scheme. Tell LLD to not demangle anything and leave it up to
// us to demangle these symbols later. Currently rustc does not perform
Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/wasm-stringify-ints-small/foo.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#![crate_type = "cdylib"]

#[link(wasm_import_module = "the-world")]
extern "C" {
fn observe(ptr: *const u8, len: usize);
}

macro_rules! s {
( $( $f:ident -> $t:ty );* $(;)* ) => {
$(
#[link(wasm_import_module = "the-world")]
extern "C" {
fn $f() -> $t;
}
Expand Down
5 changes: 5 additions & 0 deletions tests/run-make/wasm-unexpected-features/foo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ unsafe extern "Rust" {
fn __rust_alloc_error_handler(size: usize, align: usize) -> !;
}

#[rustc_std_internal_symbol]
pub unsafe fn __rdl_alloc_error_handler(_size: usize, _align: usize) -> ! {
loop {}
}

#[used]
static mut BUF: [u8; 1024] = [0; 1024];

Expand Down
1 change: 1 addition & 0 deletions tests/ui/linking/executable-no-mangle-strip.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ run-pass
//@ ignore-windows-gnu: only statics marked with used can be GC-ed on windows-gnu
//@ ignore-wasm: wasm, for better or worse, exports all #[no_mangle]

// Regression test for <https://github.com/rust-lang/rust/issues/139744>.
// Functions in the binary marked with no_mangle should be GC-ed if they
Expand Down
Loading