[Bug #18286] Make builtin binary if sharable in universal binaries
This commit is contained in:
parent
e2ef85b109
commit
22939382a8
@ -3,15 +3,15 @@
|
|||||||
#include "iseq.h"
|
#include "iseq.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
|
|
||||||
#ifdef CROSS_COMPILING
|
#include "builtin_binary.inc"
|
||||||
|
|
||||||
|
#ifndef BUILTIN_BINARY_SIZE
|
||||||
|
|
||||||
#define INCLUDED_BY_BUILTIN_C 1
|
#define INCLUDED_BY_BUILTIN_C 1
|
||||||
#include "mini_builtin.c"
|
#include "mini_builtin.c"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include "builtin_binary.inc"
|
|
||||||
|
|
||||||
static const unsigned char *
|
static const unsigned char *
|
||||||
bin4feature(const struct builtin_binary *bb, const char *feature, size_t *psize)
|
bin4feature(const struct builtin_binary *bb, const char *feature, size_t *psize)
|
||||||
{
|
{
|
||||||
|
@ -1301,9 +1301,12 @@ preludes: {$(srcdir)}golf_prelude.c
|
|||||||
$(ECHO) making $@
|
$(ECHO) making $@
|
||||||
$(Q) $(BASERUBY) $(tooldir)/mk_builtin_loader.rb $<
|
$(Q) $(BASERUBY) $(tooldir)/mk_builtin_loader.rb $<
|
||||||
|
|
||||||
builtin_binary.inc: $(PREP) $(BUILTIN_RB_SRCS) $(srcdir)/template/builtin_binary.inc.tmpl
|
$(BUILTIN_BINARY:yes=built)in_binary.inc: $(PREP) $(BUILTIN_RB_SRCS) $(srcdir)/template/builtin_binary.inc.tmpl
|
||||||
$(Q) $(MINIRUBY) $(tooldir)/generic_erb.rb -o $@ \
|
$(Q) $(MINIRUBY) $(tooldir)/generic_erb.rb -o $@ \
|
||||||
$(srcdir)/template/builtin_binary.inc.tmpl -- --cross=$(CROSS_COMPILING)
|
$(srcdir)/template/builtin_binary.inc.tmpl
|
||||||
|
|
||||||
|
$(BUILTIN_BINARY:no=builtin)_binary.inc:
|
||||||
|
$(Q) echo> $@ // empty $(@F)
|
||||||
|
|
||||||
$(BUILTIN_RB_INCS): $(top_srcdir)/tool/mk_builtin_loader.rb
|
$(BUILTIN_RB_INCS): $(top_srcdir)/tool/mk_builtin_loader.rb
|
||||||
|
|
||||||
|
21
configure.ac
21
configure.ac
@ -1489,6 +1489,25 @@ RUBY_CHECK_SIZEOF(float)
|
|||||||
RUBY_CHECK_SIZEOF(double)
|
RUBY_CHECK_SIZEOF(double)
|
||||||
RUBY_CHECK_SIZEOF(time_t, [long "long long"], [], [@%:@include <time.h>])
|
RUBY_CHECK_SIZEOF(time_t, [long "long long"], [], [@%:@include <time.h>])
|
||||||
RUBY_CHECK_SIZEOF(clock_t, [], [], [@%:@include <time.h>])
|
RUBY_CHECK_SIZEOF(clock_t, [], [], [@%:@include <time.h>])
|
||||||
|
AC_SUBST(X_BUILTIN_BINARY, yes)
|
||||||
|
AS_IF([test "$cross_compiling" = yes],
|
||||||
|
[dnl miniruby cannot run if cross compiling
|
||||||
|
X_BUILTIN_BINARY=no
|
||||||
|
],
|
||||||
|
[
|
||||||
|
AS_CASE([ac_cv_sizeof_voidp],
|
||||||
|
[[1-9]*], [dnl fixed value
|
||||||
|
],
|
||||||
|
[
|
||||||
|
AC_CACHE_CHECK([word size], [rb_cv_word_size],
|
||||||
|
[for w in 4 8; do
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@if SIZEOF_VOIDP != ${w}
|
||||||
|
@%:@error SIZEOF_VOIDP
|
||||||
|
@%:@endif]])], [rb_cv_word_size=${w}; break])
|
||||||
|
done])
|
||||||
|
AS_IF([test -z $rb_cv_word_size], [X_BUILTIN_BINARY=no])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct,
|
AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct,
|
||||||
[rb_cv_packed_struct=no
|
[rb_cv_packed_struct=no
|
||||||
@ -4482,7 +4501,7 @@ guard=INCLUDE_RUBY_CONFIG_H
|
|||||||
{
|
{
|
||||||
echo "#ifndef $guard"
|
echo "#ifndef $guard"
|
||||||
echo "#define $guard 1"
|
echo "#define $guard 1"
|
||||||
grep -v "^#define PACKAGE_" confdefs.h
|
sed "/^@%:@define PACKAGE_/d;s/ *$//" confdefs.h
|
||||||
echo "#endif /* $guard */"
|
echo "#endif /* $guard */"
|
||||||
} | tr -d '\015' |
|
} | tr -d '\015' |
|
||||||
(
|
(
|
||||||
|
@ -65,6 +65,7 @@ rubyarchhdrdir = @rubyarchhdrdir@
|
|||||||
ruby_version = @ruby_version@
|
ruby_version = @ruby_version@
|
||||||
RUBY_VERSION_NAME = @RUBY_VERSION_NAME@
|
RUBY_VERSION_NAME = @RUBY_VERSION_NAME@
|
||||||
UNIVERSAL_ARCHNAMES = @UNIVERSAL_ARCHNAMES@
|
UNIVERSAL_ARCHNAMES = @UNIVERSAL_ARCHNAMES@
|
||||||
|
BUILTIN_BINARY = @X_BUILTIN_BINARY@
|
||||||
|
|
||||||
TESTUI = console
|
TESTUI = console
|
||||||
TESTS =
|
TESTS =
|
||||||
|
@ -433,8 +433,10 @@ THREAD_IMPL_SRC = thread_$(THREAD_MODEL).c
|
|||||||
|
|
||||||
!if "$(CROSS_COMPILING)" == "yes"
|
!if "$(CROSS_COMPILING)" == "yes"
|
||||||
PREP = $(arch)-fake.rb
|
PREP = $(arch)-fake.rb
|
||||||
|
BUILTIN_BINARY = no
|
||||||
!else
|
!else
|
||||||
PREP = miniruby$(EXEEXT)
|
PREP = miniruby$(EXEEXT)
|
||||||
|
BUILTIN_BINARY = yes
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!if !defined(EXTSTATIC)
|
!if !defined(EXTSTATIC)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user