New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conformity to binaryen's modifications to DWARF #151
Conversation
Related issue: #150.
Hi @dzfrias. Thank you for your investigations on the linked issue and this patch. I am guessing that we haven't seen these discrepancies in dwarf handling because we have only tested with a small number of wasms, output by the rust compiler, presumably without emitting dwarf. We have a project called I would first like to add a test case there that uses a dwarf-containing wasm input, and verifies the incorrect dwarf behavior. If you would like to write that test it would be welcome, otherwise I'll spend some time on it this weekend. I need to either figure out how to get rustc to emit dwarf info, or use tinygo as in your example. There are two things I want to change about this patch: First it has a minor a build error: https://github.com/brson/wasm-opt-rs/actions/runs/5836602579/job/15833360228?pr=151
Second, you've written some code to disambiguate the name of the "DWARF.cpp" object file. This is needed because of limitations in the We have already run into this and there is a helper function, |
I just wrote a fix for the compiler error and the code now uses I'll work on a test, too. I took a look at the sections of the two WebAssembly binaries, and |
I'm noticing a linking error on macos. I'm on a mac, and this issue strangely only occurs when I run edit: edit2: |
I pushed a test for DWARF line-info conformity, after verifying that it worked without my previous commits. |
This looks perfect. Thank you for taking the time to make this fixes @dzfrias. I'll start working on a new release. |
@dzfrias I published 0.114.1 with your fixes. |
This PR includes the third party LLVM source used in binaryen. This is necessary because the related DWARF stuff depends on this LLVM code. Along with
BUILD_LLVM_DWARF
, I setNDEBUG
, as I ran into a linker error without it. This is done by CMake automatically in binaryen anyway, so this is still conforming to the upstreamwasm-opt
.Lastly, I had to silence warnings because LLVM uses some deprecated APIs. binaryen silences these cleanly with CMake, but I'm not sure how to do the same with
cxx_build
. So, for the time being at least,-w
is passed to the compiler.Related issue: #150.