Skip to content
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

Do not use strtold with WASI #841

Closed
wants to merge 1 commit into from
Closed

Conversation

thewtex
Copy link
Contributor

@thewtex thewtex commented Feb 6, 2023

The symbol is not available in WASI-SDK-19.

@thewtex thewtex changed the title Do not use strt2ld with WASI Do not use strtold with WASI Feb 6, 2023
The symbol is not available.
@codecov
Copy link

codecov bot commented Feb 6, 2023

Codecov Report

Base: 99.45% // Head: 99.45% // No change to project coverage 👍

Coverage data is based on head (9ae71be) compared to base (1ffded5).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #841   +/-   ##
=======================================
  Coverage   99.45%   99.45%           
=======================================
  Files          18       18           
  Lines        4069     4069           
=======================================
  Hits         4047     4047           
  Misses         22       22           
Impacted Files Coverage Δ
include/CLI/TypeTools.hpp 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@phlptp
Copy link
Collaborator

phlptp commented Feb 6, 2023

Was the function available in older versions or has CLI11 never worked with WASM?

@thewtex
Copy link
Contributor Author

thewtex commented Feb 6, 2023

CLI11 has worked with WASM in general (I have been using it for a while). However, for the WASI WebAssembly toolchain, long double is not supported.

@thewtex
Copy link
Contributor Author

thewtex commented Feb 6, 2023

I did a quick check with WASI SDK 19, 16, 14 via itk-wasm, all the same:

❯ wasmtime ./wasi-build/strtold-test.wasi.wasm
Support for formatting long double values is currently disabled.
To enable it, add -lc-printscan-long-double to the link command.
Error: failed to run main module `./wasi-build/strtold-test.wasi.wasm`

Caused by:
    0: failed to invoke command default
    1: error while executing at wasm backtrace:
           0: 0x5fe7c - <unknown>!abort
           1: 0x692e0 - <unknown>!long_double_not_supported
           2: 0x692c3 - <unknown>!strtold
           3: 0x6a515 - main
                           at /work/strtold-test.cxx:5:33
           4:  0xd27 - <unknown>!_start
           5: 0x6c5b3 - <unknown>!_start.command_export
    2: wasm trap: wasm `unreachable` instruction executed

@thewtex
Copy link
Contributor Author

thewtex commented Feb 6, 2023

Support for formatting long double values is currently disabled.
To enable it, add -lc-printscan-long-double to the link command.

I just noticed this! 👀 🙄 Let me try it first before merging this, please...

@thewtex
Copy link
Contributor Author

thewtex commented Feb 6, 2023

Let me try it first before merging this, please...

This flag does the trick, applied: InsightSoftwareConsortium/ITK-Wasm#748

Sorry for the noise!

@thewtex thewtex closed this Feb 6, 2023
@phlptp
Copy link
Collaborator

phlptp commented Feb 6, 2023

ok, thanks, I might make a note in the docs at some point to reference that flag if anyone else runs into the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants