Revision 40d6444e configure

b/configure
172 172
blobs="yes"
173 173
pkgversion=""
174 174
check_utests=""
175
user_pie="no"
175
pie=""
176 176
zero_malloc=""
177 177
trace_backend="nop"
178 178
trace_file="trace"
......
701 701
  ;;
702 702
  --disable-guest-base) guest_base="no"
703 703
  ;;
704
  --enable-user-pie) user_pie="yes"
704
  --enable-pie) pie="yes"
705 705
  ;;
706
  --disable-user-pie) user_pie="no"
706
  --disable-pie) pie="no"
707 707
  ;;
708 708
  --enable-uname-release=*) uname_release="$optarg"
709 709
  ;;
......
1031 1031
echo "  --enable-guest-base      enable GUEST_BASE support for usermode"
1032 1032
echo "                           emulation targets"
1033 1033
echo "  --disable-guest-base     disable GUEST_BASE support"
1034
echo "  --enable-user-pie        build usermode emulation targets as PIE"
1035
echo "  --disable-user-pie       do not build usermode emulation targets as PIE"
1034
echo "  --enable-pie             build Position Independent Executables"
1035
echo "  --disable-pie            do not build Position Independent Executables"
1036 1036
echo "  --fmod-lib               path to FMOD library"
1037 1037
echo "  --fmod-inc               path to FMOD includes"
1038 1038
echo "  --oss-lib                path to OSS library"
......
1099 1099
    fi
1100 1100
done
1101 1101

  
1102
if test "$static" = "yes" ; then
1103
  if test "$pie" = "yes" ; then
1104
    echo "static and pie are mutually incompatible"
1105
    exit 1
1106
  else
1107
    pie="no"
1108
  fi
1109
fi
1110

  
1111
if test "$pie" = ""; then
1112
  case "$cpu-$targetos" in
1113
    i386-Linux|x86_64-Linux)
1114
      ;;
1115
    *)
1116
      pie="no"
1117
      ;;
1118
  esac
1119
fi
1120

  
1121
if test "$pie" != "no" ; then
1122
  cat > $TMPC << EOF
1123
int main(void) { return 0; }
1124
EOF
1125
  if compile_prog "-fPIE -DPIE" "-pie"; then
1126
    QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
1127
    LDFLAGS="-pie $LDFLAGS"
1128
    pie="yes"
1129
    if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then
1130
      LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS"
1131
    fi
1132
  else
1133
    if test "$pie" = "yes"; then
1134
      echo "PIE not available due to missing toolchain support"
1135
      exit 1
1136
    else
1137
      echo "Disabling PIE due to missing toolchain support"
1138
      pie="no"
1139
    fi
1140
  fi
1141
fi
1142

  
1102 1143
#
1103 1144
# Solaris specific configure tool chain decisions
1104 1145
#
......
2765 2806
echo "uname -r          $uname_release"
2766 2807
echo "NPTL support      $nptl"
2767 2808
echo "GUEST_BASE        $guest_base"
2768
echo "PIE user targets  $user_pie"
2809
echo "PIE               $pie"
2769 2810
echo "vde support       $vde"
2770 2811
echo "Linux AIO support $linux_aio"
2771 2812
echo "ATTR/XATTR support $attr"
......
3225 3266
    symlink $source_path/Makefile.dis $d/Makefile
3226 3267
    echo > $d/config.mak
3227 3268
done
3228
if test "$static" = "no" -a "$user_pie" = "yes" ; then
3229
  echo "QEMU_CFLAGS+=-fpie" > libdis-user/config.mak
3230
fi
3231 3269

  
3232 3270
for target in $target_list; do
3233 3271
target_dir="$target"
......
3646 3684
  esac
3647 3685
fi
3648 3686

  
3649
if test "$target_user_only" = "yes" -a "$static" = "no" -a \
3650
	"$user_pie" = "yes" ; then
3651
  cflags="-fpie $cflags"
3652
  ldflags="-pie $ldflags"
3653
fi
3654

  
3655 3687
if test "$target_softmmu" = "yes" -a \( \
3656 3688
        "$TARGET_ARCH" = "microblaze" -o \
3657 3689
        "$TARGET_ARCH" = "cris" \) ; then
......
3775 3807
mkdir -p $d
3776 3808
mkdir -p $d/trace
3777 3809
symlink $source_path/Makefile.user $d/Makefile
3778
if test "$static" = "no" -a "$user_pie" = "yes" ; then
3779
  echo "QEMU_CFLAGS+=-fpie" > $d/config.mak
3780
fi
3781 3810

  
3782 3811
if test "$docs" = "yes" ; then
3783 3812
  mkdir -p QMP

Also available in: Unified diff