1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Resolve abi symbol references from miniruby to avoid circular deps

Adding `ruby` to `PREP` causes the following circular dependencies
because `PREP` is used as a prerequisite by some targets required to
build `ruby` target itself.
```
make: Circular .rbconfig.time <- ruby dependency dropped.
make: Circular builtin_binary.inc <- ruby dependency dropped.
make: Circular ext/extinit.c <- ruby dependency dropped.
make: Circular ruby <- ruby dependency dropped.
```

Adding a new Make variable like `EXTPREP` only for exts may be also
reasonable, but it would introduce another complexity into our build
system. `-bundle_loader` doesn't care that link-time and run-time
loader executables are different as long as bound symbols are provided,
so it's ok to resolve from miniruby to simplify our build.
This commit is contained in:
Yuta Saito 2022-07-30 17:25:12 +09:00
parent e5a3f23256
commit 6d8b9a9d61
Notes: git 2022-08-04 16:29:44 +09:00
3 changed files with 4 additions and 5 deletions

View file

@ -3015,7 +3015,6 @@ STATIC=
# When building ext bundles, a mach-o bundle needs to know its loader
# program to bind symbols from the ruby executable
EXTDLDFLAGS="-bundle_loader '\$(BUILTRUBY)'"
PREP="$PREP"' $(PROGRAM)'
])
rb_cv_dlopen=yes],
[aix*], [ : ${LDSHARED='$(CC)'}
@ -3340,7 +3339,7 @@ AS_IF([test x"$cross_compiling" = xyes], [
AC_SUBST(XRUBY_LIBDIR)
AC_SUBST(XRUBY_RUBYLIBDIR)
AC_SUBST(XRUBY_RUBYHDRDIR)
PREP="$PREP "'$(arch)-fake.rb'
PREP='$(arch)-fake.rb'
RUNRUBY_COMMAND='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
RUNRUBY='$(RUNRUBY_COMMAND)'
XRUBY='$(MINIRUBY)'
@ -3350,7 +3349,7 @@ AS_IF([test x"$cross_compiling" = xyes], [
], [
MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib -I.'
MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common'
PREP="$PREP "'miniruby$(EXEEXT)'
PREP='miniruby$(EXEEXT)'
RUNRUBY_COMMAND='$(MINIRUBY) $(tooldir)/runruby.rb --extout=$(EXTOUT) $(RUNRUBYOPT)'
RUNRUBY='$(RUNRUBY_COMMAND) --'
XRUBY='$(RUNRUBY)'

View file

@ -36,7 +36,7 @@ RUBY_SO_NAME = @RUBY_SO_NAME@
LIBRUBY = @LIBRUBY@
LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
LIBRUBYARG_STATIC = $(LIBRUBYARG_SHARED)
BUILTRUBY = $(topdir)/ruby$(EXEEXT)
BUILTRUBY = $(topdir)/miniruby$(EXEEXT)
empty =
AR = @AR@

View file

@ -427,7 +427,7 @@ end
topruby = $ruby
$ruby = topruby.join(' ')
$mflags << "ruby=#$ruby"
$builtruby = '$(topdir)/ruby' + EXEEXT # Must be an executable path
$builtruby = '$(topdir)/miniruby' + EXEEXT # Must be an executable path
MTIMES = [__FILE__, 'rbconfig.rb', srcdir+'/lib/mkmf.rb'].collect {|f| File.mtime(f)}