ruby-changes:70950
From: Yuta <ko1@a...>
Date: Wed, 19 Jan 2022 11:19:55 +0900 (JST)
Subject: [ruby-changes:70950] be1382b498 (master): ruby.c: initialize extra optional extensions linked statically
https://git.ruby-lang.org/ruby.git/commit/?id=be1382b498 From be1382b498e05a806f1db52629a54046a2e558d0 Mon Sep 17 00:00:00 2001 From: Yuta Saito <kateinoigakukun@g...> Date: Mon, 6 Dec 2021 11:25:44 +0900 Subject: 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. --- ruby.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ruby.c b/ruby.c index b3005260174..ade434cff3d 100644 --- a/ruby.c +++ b/ruby.c @@ -1524,6 +1524,15 @@ ruby_init_prelude(void) https://github.com/ruby/ruby/blob/trunk/ruby.c#L1524 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) https://github.com/ruby/ruby/blob/trunk/ruby.c#L1551 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(); -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/