Skip to content

Commit

Permalink
COMP: Work around H5DataSpace WASI missing symbol
Browse files Browse the repository at this point in the history
See:

- https://llvm.org/docs/FAQ.html#what-is-this-llvm-global-ctors-and-global-i-a-stuff-that-happens-when-i-include-iostream
- https://stackoverflow.com/questions/31691280/what-does-global-sub-i-mean-in-nm-output

To address:

```
Error: failed to run main module `wasi-build/elastix.wasi.wasm`

Caused by:
    0: failed to invoke command default
    1: error while executing at wasm backtrace:
           0: 0xf1ee5 - <unknown>!abort
           1: 0x106856 - __cxa_allocate_exception
                           at /ITKWebAssemblyInterface/src/exceptionShim.cxx:28:3
           2: 0x7284ab - <unknown>!_GLOBAL__sub_I_H5DataSpace.cpp
           3: 0x42832 - <unknown>!__wasm_call_ctors
           4: 0x16840c8 - _initialize_local
                           at /ITKWebAssemblyInterface/src/initialization.cxx:59:5
           5: 0x1684082 - _start
                           at /ITKWebAssemblyInterface/src/initialization.cxx:90:3
```
  • Loading branch information
thewtex committed Sep 15, 2023
1 parent 301cc96 commit ca33c3c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Modules/ThirdParty/HDF5/src/itkhdf5/c++/src/H5DataSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include <iostream>
#include <cstdio>
#include <string>

#include "H5Include.h"
Expand All @@ -20,8 +20,6 @@
#include "H5DataSpace.h"

namespace H5 {
using std::cerr;
using std::endl;

#ifndef DOXYGEN_SHOULD_SKIP_THIS
// This DOXYGEN_SHOULD_SKIP_THIS block is a work-around approach to control
Expand Down Expand Up @@ -688,7 +686,7 @@ DataSpace::~DataSpace()
close();
}
catch (Exception &close_error) {
cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl;
fprintf(stderr, "DataSpace::~DataSpace - %s\n", close_error.getDetailMsg().c_str());
}
}

Expand Down

0 comments on commit ca33c3c

Please sign in to comment.