Compile error ruby eventmachine for OpenWRT Barrier Breaker errors with "error: size of array '...' is negative"
Compile error ruby eventmachine for OpenWRT Barrier Breaker errors with "error: size of array '...' is negative"
我已经着手为 OpenWRT Barrier Breaker 创建一个 Ruby 2.2 包和 Event Machine。可以在此处查看 eventmachine 包的 makefile:https://github.com/DaKaZ/ruby-openwrt/blob/master/packages/ruby-eventmachine/Makefile
我能够从 feeds/packages 的主干成功使用 Ruby 2.2 实现,并且在我的路由器上使用 Ruby 2.2 运行 OpenWRT Barrier Breaker,但是... eventmachine 在构建时抛出以下错误:
In file included from /Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby.h:33:0,
from rubymain.cpp:26:
/Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/ruby.h:107:73: error: size of array 'ruby_check_sizeof_long' is negative
typedef char ruby_check_sizeof_long[SIZEOF_LONG == sizeof(long) ? 1 : -1];
^
/Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/ruby.h:111:76: error: size of array 'ruby_check_sizeof_voidp' is negative
typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
^
In file included from /Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/intern.h:35:0,
from /Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/ruby.h:1710,
from /Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby.h:33,
from rubymain.cpp:26:
/Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/st.h:52:93: error: size of array 'st_check_for_sizeof_st_index_t' is negative
typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP == (int)sizeof(st_index_t) ? 1 : -1];
^
make[4]: *** [rubymain.o] Error 1
make[3]: *** [/Volumes/OpenWrt/barrier_breaker/build_dir/target-mipsel_74kc+dsp2_uClibc-0.9.33.2/linux-brcm47xx_mips74k/ruby-eventmachine-1.0.7/.built] Error 2
make[3]: Leaving directory `/Volumes/OpenWrt/barrier_breaker/feeds/rubyopenwrt/packages/ruby-eventmachine'
make[2]: *** [package/feeds/rubyopenwrt/ruby-eventmachine/compile] Error 2
make[2]: Leaving directory `/Volumes/OpenWrt/barrier_breaker'
make[1]: *** [/Volumes/OpenWrt/barrier_breaker/staging_dir/target-mipsel_74kc+dsp2_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/Volumes/OpenWrt/barrier_breaker'
make: *** [world] Error 2
这似乎是 ruby HOST 版本中的一个错误,但我不知道如何正确使用交叉编译版本来构建 eventmachine。请帮忙!
对于任何感兴趣的人 - 我能够构建和 运行 事件机器并且它工作得很好,但只能使用自定义 Makefile - 我永远无法将自动生成的文件正确地 运行 。这是 Makefile。我使用一个简单的脚本来正确设置构建:
echo "[update feeds]"
./scripts/feeds update -a
echo "[install packages from rubyopenwrt feed]"
./scripts/feeds install -a -p rubyopenwrt
echo "[install customized ruby-eventmachine makefile]"
cp em-build-works/Makefile feeds/rubyopenwrt/packages/ruby-eventmachine
这是工作的 Makefile:
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
RUBY_PKG_LIBVER:=2.2
PKG_NAME:=ruby-eventmachine
PKG_SHORT_NAME:=eventmachine
PKG_RELEASE:=1
PKG_LIBVER:=1.0.7
PKG_REV:=6dbdb97bada05d33a1f0d469a49d8c46ac2e77d0
PKG_VERSION:=$(PKG_LIBVER)
PKG_SOURCE:=$(PKG_NAME).tar.gz
PKG_SOURCE_URL:=git://github.com/eventmachine/eventmachine.git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_PROTO:=git
PKG_BUILD_DEPENDS:=
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/ruby-eventmachine
SUBMENU:=Ruby
SECTION:=lang
CATEGORY:=Languages
DEPENDS:=+ruby-socket +libstdcpp +libc +libgcc +libssl +libcrypto
TITLE:=Ruby eventmachine gem
endef
RUBY:= \
$(STAGING_DIR_HOST)/bin/ruby -I $(STAGING_DIR_HOST)/share/ri \
define Package/ruby-eventmachine/description
This package contains the ruby eventmachine gem.
endef
define Build/Configure/eventmachine
(cd $(PKG_BUILD_DIR)/ext; \
$(RUBY) extconf.rb; \
);
endef
define Build/Compile/eventmachine
$(MAKE_VARS) \
$(MAKE) -C $(PKG_BUILD_DIR)/ext \
$(MAKE_FLAGS) \
$(1);
$(CP) $(PKG_BUILD_DIR)/ext/*.so $(PKG_BUILD_DIR)/lib/
endef
define Build/Configure/fastfilereader
(cd $(PKG_BUILD_DIR)/ext/fastfilereader; \
$(RUBY) extconf.rb; \
);
endef
define Build/Compile/fastfilereader
$(MAKE_VARS) \
$(MAKE) -C $(PKG_BUILD_DIR)/ext/fastfilereader \
$(MAKE_FLAGS) \
$(1);
$(CP) $(PKG_BUILD_DIR)/ext/fastfilereader/*.so $(PKG_BUILD_DIR)/lib/
endef
define Build/Configure
$(call Build/Configure/eventmachine)
$(call Build/Configure/fastfilereader)
endef
# hack Makefiles here
define Build/Compile
$(SED) 's/-fstack-protector//' $(PKG_BUILD_DIR)/ext/fastfilereader/Makefile
$(SED) '17s/host.*/target-mips-rlx5281-linux\/usr\/include\/ruby-2.2\/mips-linux-gnu/' $(PKG_BUILD_DIR)/ext/fastfilereader/Makefile
$(call Build/Compile/fastfilereader)
$(SED) 's/-fstack-protector//' $(PKG_BUILD_DIR)/ext/Makefile
$(SED) '17s/host.*/target-mips-rlx5281-linux\/usr\/include\/ruby-2.2\/mips-linux-gnu/' $(PKG_BUILD_DIR)/ext/Makefile
$(call Build/Compile/eventmachine)
endef
define Package/ruby-eventmachine/install
$(INSTALL_DIR) $(1)/usr/lib/ruby/$(RUBY_PKG_LIBVER)/mips-linux-gnu
$(CP) $(PKG_BUILD_DIR)/lib/eventmachine.rb $(1)/usr/lib/ruby/$(RUBY_PKG_LIBVER)/
$(CP) $(PKG_BUILD_DIR)/lib/em $(1)/usr/lib/ruby/$(RUBY_PKG_LIBVER)/
$(CP) $(PKG_BUILD_DIR)/lib/*.so $(1)/usr/lib/ruby/$(RUBY_PKG_LIBVER)/mips-linux-gnu
endef
$(eval $(call BuildPackage,ruby-eventmachine,+libopenssl))
我已经着手为 OpenWRT Barrier Breaker 创建一个 Ruby 2.2 包和 Event Machine。可以在此处查看 eventmachine 包的 makefile:https://github.com/DaKaZ/ruby-openwrt/blob/master/packages/ruby-eventmachine/Makefile
我能够从 feeds/packages 的主干成功使用 Ruby 2.2 实现,并且在我的路由器上使用 Ruby 2.2 运行 OpenWRT Barrier Breaker,但是... eventmachine 在构建时抛出以下错误:
In file included from /Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby.h:33:0,
from rubymain.cpp:26:
/Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/ruby.h:107:73: error: size of array 'ruby_check_sizeof_long' is negative
typedef char ruby_check_sizeof_long[SIZEOF_LONG == sizeof(long) ? 1 : -1];
^
/Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/ruby.h:111:76: error: size of array 'ruby_check_sizeof_voidp' is negative
typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
^
In file included from /Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/intern.h:35:0,
from /Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/ruby.h:1710,
from /Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby.h:33,
from rubymain.cpp:26:
/Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/st.h:52:93: error: size of array 'st_check_for_sizeof_st_index_t' is negative
typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP == (int)sizeof(st_index_t) ? 1 : -1];
^
make[4]: *** [rubymain.o] Error 1
make[3]: *** [/Volumes/OpenWrt/barrier_breaker/build_dir/target-mipsel_74kc+dsp2_uClibc-0.9.33.2/linux-brcm47xx_mips74k/ruby-eventmachine-1.0.7/.built] Error 2
make[3]: Leaving directory `/Volumes/OpenWrt/barrier_breaker/feeds/rubyopenwrt/packages/ruby-eventmachine'
make[2]: *** [package/feeds/rubyopenwrt/ruby-eventmachine/compile] Error 2
make[2]: Leaving directory `/Volumes/OpenWrt/barrier_breaker'
make[1]: *** [/Volumes/OpenWrt/barrier_breaker/staging_dir/target-mipsel_74kc+dsp2_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/Volumes/OpenWrt/barrier_breaker'
make: *** [world] Error 2
这似乎是 ruby HOST 版本中的一个错误,但我不知道如何正确使用交叉编译版本来构建 eventmachine。请帮忙!
对于任何感兴趣的人 - 我能够构建和 运行 事件机器并且它工作得很好,但只能使用自定义 Makefile - 我永远无法将自动生成的文件正确地 运行 。这是 Makefile。我使用一个简单的脚本来正确设置构建:
echo "[update feeds]"
./scripts/feeds update -a
echo "[install packages from rubyopenwrt feed]"
./scripts/feeds install -a -p rubyopenwrt
echo "[install customized ruby-eventmachine makefile]"
cp em-build-works/Makefile feeds/rubyopenwrt/packages/ruby-eventmachine
这是工作的 Makefile:
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
RUBY_PKG_LIBVER:=2.2
PKG_NAME:=ruby-eventmachine
PKG_SHORT_NAME:=eventmachine
PKG_RELEASE:=1
PKG_LIBVER:=1.0.7
PKG_REV:=6dbdb97bada05d33a1f0d469a49d8c46ac2e77d0
PKG_VERSION:=$(PKG_LIBVER)
PKG_SOURCE:=$(PKG_NAME).tar.gz
PKG_SOURCE_URL:=git://github.com/eventmachine/eventmachine.git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_PROTO:=git
PKG_BUILD_DEPENDS:=
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/ruby-eventmachine
SUBMENU:=Ruby
SECTION:=lang
CATEGORY:=Languages
DEPENDS:=+ruby-socket +libstdcpp +libc +libgcc +libssl +libcrypto
TITLE:=Ruby eventmachine gem
endef
RUBY:= \
$(STAGING_DIR_HOST)/bin/ruby -I $(STAGING_DIR_HOST)/share/ri \
define Package/ruby-eventmachine/description
This package contains the ruby eventmachine gem.
endef
define Build/Configure/eventmachine
(cd $(PKG_BUILD_DIR)/ext; \
$(RUBY) extconf.rb; \
);
endef
define Build/Compile/eventmachine
$(MAKE_VARS) \
$(MAKE) -C $(PKG_BUILD_DIR)/ext \
$(MAKE_FLAGS) \
$(1);
$(CP) $(PKG_BUILD_DIR)/ext/*.so $(PKG_BUILD_DIR)/lib/
endef
define Build/Configure/fastfilereader
(cd $(PKG_BUILD_DIR)/ext/fastfilereader; \
$(RUBY) extconf.rb; \
);
endef
define Build/Compile/fastfilereader
$(MAKE_VARS) \
$(MAKE) -C $(PKG_BUILD_DIR)/ext/fastfilereader \
$(MAKE_FLAGS) \
$(1);
$(CP) $(PKG_BUILD_DIR)/ext/fastfilereader/*.so $(PKG_BUILD_DIR)/lib/
endef
define Build/Configure
$(call Build/Configure/eventmachine)
$(call Build/Configure/fastfilereader)
endef
# hack Makefiles here
define Build/Compile
$(SED) 's/-fstack-protector//' $(PKG_BUILD_DIR)/ext/fastfilereader/Makefile
$(SED) '17s/host.*/target-mips-rlx5281-linux\/usr\/include\/ruby-2.2\/mips-linux-gnu/' $(PKG_BUILD_DIR)/ext/fastfilereader/Makefile
$(call Build/Compile/fastfilereader)
$(SED) 's/-fstack-protector//' $(PKG_BUILD_DIR)/ext/Makefile
$(SED) '17s/host.*/target-mips-rlx5281-linux\/usr\/include\/ruby-2.2\/mips-linux-gnu/' $(PKG_BUILD_DIR)/ext/Makefile
$(call Build/Compile/eventmachine)
endef
define Package/ruby-eventmachine/install
$(INSTALL_DIR) $(1)/usr/lib/ruby/$(RUBY_PKG_LIBVER)/mips-linux-gnu
$(CP) $(PKG_BUILD_DIR)/lib/eventmachine.rb $(1)/usr/lib/ruby/$(RUBY_PKG_LIBVER)/
$(CP) $(PKG_BUILD_DIR)/lib/em $(1)/usr/lib/ruby/$(RUBY_PKG_LIBVER)/
$(CP) $(PKG_BUILD_DIR)/lib/*.so $(1)/usr/lib/ruby/$(RUBY_PKG_LIBVER)/mips-linux-gnu
endef
$(eval $(call BuildPackage,ruby-eventmachine,+libopenssl))