mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-05 19:05:34 +00:00
configure: Override the os default with --disable-pie
Some distributions, e.g. Ubuntu 19.10, enable PIE by default. If for some reason one wishes to build a non-pie binary, we must provide additional options to override. At the same time, reorg the code to an elif chain. Backports commit 2c674109c2da3f2e17b69f39e0b93b3f3d3dfa59 from qemu
This commit is contained in:
parent
598083421b
commit
f08ba73e78
20
qemu/configure
vendored
20
qemu/configure
vendored
|
@ -865,24 +865,18 @@ if compile_prog "-Werror -fno-pie" "-no-pie"; then
|
||||||
LDFLAGS_NOPIE="-no-pie"
|
LDFLAGS_NOPIE="-no-pie"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$pie" != "no" ; then
|
if test "$pie" = "no"; then
|
||||||
if compile_prog "-fPIE -DPIE" "-pie"; then
|
QEMU_CFLAGS="$CFLAGS_NOPIE $QEMU_CFLAGS"
|
||||||
|
QEMU_LDFLAGS="$LDFLAGS_NOPIE $QEMU_LDFLAGS"
|
||||||
|
elif compile_prog "-fPIE -DPIE" "-pie"; then
|
||||||
QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
|
QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
|
||||||
LDFLAGS="-pie $LDFLAGS"
|
QEMU_LDFLAGS="-pie $QEMU_LDFLAGS"
|
||||||
pie="yes"
|
pie="yes"
|
||||||
else
|
elif test "$pie" = "yes"; then
|
||||||
if test "$pie" = "yes"; then
|
|
||||||
error_exit "PIE not available due to missing toolchain support"
|
error_exit "PIE not available due to missing toolchain support"
|
||||||
else
|
else
|
||||||
echo "Disabling PIE due to missing toolchain support"
|
echo "Disabling PIE due to missing toolchain support"
|
||||||
pie="no"
|
pie="no"
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if compile_prog "-fno-pie" "-nopie"; then
|
|
||||||
CFLAGS_NOPIE="-fno-pie"
|
|
||||||
LDFLAGS_NOPIE="-nopie"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Detect support for PT_GNU_RELRO + DT_BIND_NOW.
|
# Detect support for PT_GNU_RELRO + DT_BIND_NOW.
|
||||||
|
|
Loading…
Reference in a new issue