mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 12:41:01 +00:00
configure: Always detect -no-pie toolchain support
The CFLAGS_NOPIE and LDFLAGS_NOPIE variables are used in pc-bios/optionrom/Makefile, which has nothing to do with the PIE setting of the main qemu executables. This overrides any operating system default to build all executables as PIE, which is important for ROMs. Backports commit b26341241bbfe9cc126479a0dbed5d40d547f242 from qemu
This commit is contained in:
parent
13e94b11ea
commit
e546e24b83
14
qemu/configure
vendored
14
qemu/configure
vendored
|
@ -848,20 +848,24 @@ if test "$static" = "yes" ; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$pie" != "no" ; then
|
cat > $TMPC << EOF
|
||||||
cat > $TMPC << EOF
|
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
# define THREAD __thread
|
# define THREAD __thread
|
||||||
#else
|
#else
|
||||||
# define THREAD
|
# define THREAD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static THREAD int tls_var;
|
static THREAD int tls_var;
|
||||||
|
|
||||||
int main(void) { return tls_var; }
|
int main(void) { return tls_var; }
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Check we support --no-pie first; we will need this for building ROMs.
|
||||||
|
if compile_prog "-Werror -fno-pie" "-no-pie"; then
|
||||||
|
CFLAGS_NOPIE="-fno-pie"
|
||||||
|
LDFLAGS_NOPIE="-no-pie"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$pie" != "no" ; then
|
||||||
if compile_prog "-fPIE -DPIE" "-pie"; then
|
if compile_prog "-fPIE -DPIE" "-pie"; then
|
||||||
QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
|
QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
|
||||||
LDFLAGS="-pie $LDFLAGS"
|
LDFLAGS="-pie $LDFLAGS"
|
||||||
|
|
Loading…
Reference in a new issue