mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ruby.c: initialize extra optional extensions linked statically
Add a hook point to initialize extra extension libraries. The default hook function is replaced when linking a strong `Init_extra_exts` symbol. A builder can insert an object file that defines Init_extra_exts by XLDFLAGS.
This commit is contained in:
parent
9033ac3e2c
commit
be1382b498
Notes:
git
2022-01-19 11:19:39 +09:00
1 changed files with 10 additions and 0 deletions
10
ruby.c
10
ruby.c
|
@ -1524,6 +1524,15 @@ ruby_init_prelude(void)
|
|||
|
||||
void rb_call_builtin_inits(void);
|
||||
|
||||
// Initialize extra optional exts linked statically.
|
||||
// This empty definition will be replaced with the actual strong symbol by linker.
|
||||
#if RBIMPL_HAS_ATTRIBUTE(weak)
|
||||
__attribute__((weak))
|
||||
#endif
|
||||
void Init_extra_exts(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
ruby_opt_init(ruby_cmdline_options_t *opt)
|
||||
{
|
||||
|
@ -1542,6 +1551,7 @@ ruby_opt_init(ruby_cmdline_options_t *opt)
|
|||
rb_warning_category_update(opt->warn.mask, opt->warn.set);
|
||||
|
||||
Init_ext(); /* load statically linked extensions before rubygems */
|
||||
Init_extra_exts();
|
||||
rb_call_builtin_inits();
|
||||
ruby_init_prelude();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue