Issue 109443
Summary wasm-ld: Disabling on-by-default features doesn't work when LTO is used
Labels new issue
Assignees
Reporter alexcrichton
    Given this input:

```llvm
target triple = "wasm32-unknown-unknown"
target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20"

define void @foo(ptr %a) #0 {
  call void %a()
  ret void
}

attributes #0 = { "target-cpu"="mvp" }
```

Locally I see:

```
$ llvm-as wat.ll
$ wasm-ld wat.bc -o foo.wasm --no-entry --export foo 
$ wasm-tools validate -f=-reference-types foo.wasm
error: func 0 failed to validate

Caused by:
    0: zero byte expected (at offset 0x4b)
```

This issue is a reduction of https://github.com/rust-lang/rust/issues/130604 and is where a user is trying to disable reference types for their entire compilation and use LTO as well, but it looks like the `"target-cpu"` isn't taking effect with `wasm-ld`. 

cc @sbc100 do you know what might be causing this?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to