Project

General

Profile

Bug #7606 ยป pie-check.diff

git diff, patching configure.in - kernigh (George Koehler), 12/23/2012 10:48 AM

View differences:

configure.in
2708 2708
  if test "$GCC" = yes -a -z "$EXTSTATIC" -a "x$pie" != xno; then
2709 2709
    RUBY_TRY_CFLAGS(-fPIE, [pie=yes], [pie=no])
2710 2710
    if test "$pie" = yes; then
2711
      RUBY_APPEND_OPTION(XCFLAGS, -fPIE)
2711
      # Use -fPIE when testing -pie.  RUBY_TRY_LDFLAGS sets
2712
      # $save_CFLAGS internally, so set other name here.
2713
      save_CFLAGS_before_pie="$CFLAGS"
2714
      CFLAGS="$CFLAGS -fPIE"
2712 2715
      for pie in -pie -Wl,-pie; do
2713 2716
	RUBY_TRY_LDFLAGS([$pie], [], [pie=])
2714 2717
	if test "x$pie" != x; then
2718
 	  RUBY_APPEND_OPTION(XCFLAGS, -fPIE)
2715 2719
	  RUBY_APPEND_OPTION(XLDFLAGS, $pie)
2716 2720
	  break
2717 2721
	fi
2718 2722
      done
2723
      CFLAGS="$save_CFLAGS_before_pie"
2719 2724
    fi
2720 2725
  fi
2721 2726
])