[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL for-5.0 07/10] configure: Support -static-pie if requested
From: |
Laurent Vivier |
Subject: |
Re: [PULL for-5.0 07/10] configure: Support -static-pie if requested |
Date: |
Tue, 31 Mar 2020 15:34:20 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 31/03/2020 05:54, Richard Henderson wrote:
> Recent toolchains support static and pie at the same time.
>
> As with normal dynamic builds, allow --static to default to PIE
> if supported by the toolchain. Allow --enable/--disable-pie to
> override the default.
>
> Reviewed-by: Alex Bennée <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> v2: Fix --disable-pie --static
> v3: Update for QEMU_LDFLAGS.
> ---
> configure | 19 ++++++++++++-------
> 1 file changed, 12 insertions(+), 7 deletions(-)
'configure --static" always produces a dynamically linked binary for me
.../configure' '--disable-system' '--enable-user' '--disable-tools'
'--static'
...
CFLAGS -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g
QEMU_CFLAGS -Werror -pthread -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
-Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes
-fno-strict-aliasing -fno-common -fwrapv -std=gnu99
-Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value
-Wno-missing-include-dirs -Wempty-body -Wnested-externs
-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
-Wold-style-declaration -Wold-style-definition -Wtype-limits
-fstack-protector-strong -I/usr/include/libdrm
-I$(SRC_PATH)/capstone/include
QEMU_LDFLAGS -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -static-pie
-m64 -fstack-protector-strong
...
static build yes
...
PIE yes
make -j 8 m68k-linux-user/clean
make -j 8 m68k-linux-user/all
$ file m68k-linux-user/qemu-m68k
m68k-linux-user/qemu-m68k: ELF 64-bit LSB pie executable, x86-64,
version 1 (GNU/Linux), dynamically linked,
BuildID[sha1]=363ee31697e874085ec53c2af454a070c62647e1, for GNU/Linux
3.2.0, with debug_info, not stripped, too many notes (256)
$ gdb --version
GNU gdb (GDB) Fedora 8.3.50.20190824-30.fc31
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
ld --version
GNU ld version 2.32-31.fc31
Copyright (C) 2019 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later
version.
This program has absolutely no warranty.
Any idea of what happens?
Thanks,
Laurent
- [PULL for-5.0 00/10] tcg patch queue, Richard Henderson, 2020/03/30
- [PULL for-5.0 01/10] configure: Drop adjustment of textseg, Richard Henderson, 2020/03/30
- [PATCH for-5.0] tcg/i386: Fix INDEX_op_dup2_vec, Richard Henderson, 2020/03/30
- [PULL for-5.0 03/10] configure: Do not force pie=no for non-x86, Richard Henderson, 2020/03/30
- [PULL for-5.0 02/10] tcg: Remove softmmu code_gen_buffer fixed address, Richard Henderson, 2020/03/30
- [PULL for-5.0 04/10] configure: Always detect -no-pie toolchain support, Richard Henderson, 2020/03/30
- [PULL for-5.0 05/10] configure: Unnest detection of -z, relro and -z, now, Richard Henderson, 2020/03/30
- [PULL for-5.0 06/10] configure: Override the os default with --disable-pie, Richard Henderson, 2020/03/30
- [PULL for-5.0 07/10] configure: Support -static-pie if requested, Richard Henderson, 2020/03/30
- Re: [PULL for-5.0 07/10] configure: Support -static-pie if requested,
Laurent Vivier <=
- [PULL for-5.0 08/10] target/mips: Fix loongson multimedia condition instructions, Richard Henderson, 2020/03/30
- [PULL for-5.0 09/10] tcg/i386: Fix INDEX_op_dup2_vec, Richard Henderson, 2020/03/30
- [PULL for-5.0 10/10] decodetree: Use Python3 floor division operator, Richard Henderson, 2020/03/30
- Re: [PULL for-5.0 00/10] tcg patch queue, Peter Maydell, 2020/03/31