Replies: 5 comments · 2 replies
|
I too have explored methods for adding supplemental presyms in the period before mruby 3.1.0. If you are already writing a gem and using C in it, there is a workaround for now. void
mrb_mruby_MYGEM_gem_init(mrb_state *mrb)
{
#ifdef MRB_PRESYM_SCANNING
MRB_SYM(extra_symbol1);
MRB_SYM(extra_symbol2);
mrb_intern_lit(mrb, "$global_variable");
mrb_intern_lit(mrb, "\x01\x02\x03");
#endif
...
} |
|
psst! These are not official practices. They may not be available in the future.
|
|
Is there a reason global variables are not supported in presym? When I add eg $GLOBAL to presym tokens it appears in table.h but not in id.h. I note that globals do not appear in: |
|
The reason is that the number of symbols used in the application and the symbols corresponding to global variables is small, so we thought the impact would be small. Another reason is that presym scan and allocation are done during the libmruby build, so it was difficult to apply to symbols in the app. |
|
Yeah, having the ability to add extra presyms symbols when working with an already built |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
My MRuby::Build looks like this:
MRuby::Build.new do |conf| conf.toolchain conf.enable_cxx_exception pdb = "/Fd\"#{ENV['MRUBY_PDB']}\"" conf.cc {|c| c.flags << pdb} conf.cxx {|c| c.flags << pdb} GEMS.each { |g| conf.gem :core => g } DEFINES.each { |d| conf.defines << d } endHow could I modify this to register some additional source files for presym scanning? I don't want them to take part in the build in any way except to add some new symbols. I was expecting something like:
config.presym do |p| p.src_files << "my_src_file" endAlso is it possible to manually inject specific symbols directly into the build from here, without needing to scan source files?
I've messed about for a while but I'm not getting anywhere...
Thank you!
All reactions