diff --git a/srcpkgs/ruby/template b/srcpkgs/ruby/template index cba5e28515..4e17ba25e5 100644 --- a/srcpkgs/ruby/template +++ b/srcpkgs/ruby/template @@ -28,6 +28,16 @@ pre_build() { sed -e 's,\(checking_for("wide getaddrinfo") {try_\)run,\1link,' -i ext/socket/extconf.rb # Hack for cross-builds. touch ext/ripper/check + if [ "$XBPS_GCC_VERSION_MAJOR" -ge 7 ]; then + # Set -fno-stack-protector for i686* or otherwise linking fails with + # ...: undefined reference to `__stack_chk_fail_local' + case "$XBPS_TARGET_MACHINE" in + i686*) sed -i Makefile \ + -e "s;-fstack-protector-strong;;" \ + -e "s;-fstack-protector;-fno-stack-protector;" + ;; + esac + fi } post_install() { # Remove references to the cross compiler