From 315fa72042e17af12a9e12f11352fbcb5374ba41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Sat, 20 May 2017 20:21:41 +0200 Subject: [PATCH] ruby: fix gcc7 build for i686* With gcc-7.1.0 -fstack-protector or -fstack-protector-strong fail to link because of undefined references to __stack_chk_fail_local. This patch is merely a hack to make ruby build until the root cause for this bug is found. --- srcpkgs/ruby/template | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/srcpkgs/ruby/template b/srcpkgs/ruby/template index cba5e28515c..4e17ba25e53 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