Closed WaveformDelta closed 7 years ago
I don't know what version of mruby
you are using and full Rakefile
that cause this issue,
so I can't say much about it.
Customization isn't bad though makes things hard to verify so I need more information.
As I see, conf.cxx
and conf.linker
should be clang++
or -x c++
(force compiler to treat source as C++ code) should be added.
Add -fexceptions
to your C compiler flags.
I prefer enable_cxx_exception
since most C project aren't for C++ compilers.
Adding -fexceptions
was the piece I was missing: with that added, all code now works as expected.
I created a Gist with my modified Rakefile
; I included the -x c++
argument to clang even though I found in testing I don't need it. For now, I'm not using the enable_cxx_exception
.
I accept this issue as closed. Thank you for your help!!
@WaveformDelta Glad to hear you solved it!
I am using this gem with the ios-embedded-ruby project and including it in the MRubyiOSExample app. However, including this (or any C++ gem) into the project causes a problem with exception handling when I run it on the device. I can cause an unrecoverable crash with code as simple as:
On a device, the
raise
statement will crash with a SIGABRT on the call toMRB_THROW
in themrb_exc_raise()
method in theerror.c
source file with the message:Additional information
ios-embedded-ruby
builds for both targets)mruby-marshal
gem to build for iOS, I had to replace themruby-onig-regexp
gem dependency with themruby-pure-regexp
gemios-ruby-embedded
Rakefile (copy of the 'conf.cc' flags)enable_cxx_exception
andenable_cxx_abi
options in the Rakefile, but did not find a combination that solved the problem-lc++
flag to "Other Linker Flags" in the Xcode project