[PATCH v2 0/7] configure: Improve PIE and other linkage

Richard Henderson posted 7 patches 4 years, 3 months ago
Test asan failed
Test checkpatch failed
Test FreeBSD failed
Test docker-mingw@fedora failed
Test docker-clang@ubuntu failed
Test docker-quick@centos7 failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20191218223441.23852-1-richard.henderson@linaro.org
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <rth@twiddle.net>
There is a newer version of this series
Makefile                  |   2 +-
accel/tcg/translate-all.c |  37 ++----------
configure                 | 116 +++++++++++---------------------------
3 files changed, 38 insertions(+), 117 deletions(-)
[PATCH v2 0/7] configure: Improve PIE and other linkage
Posted by Richard Henderson 4 years, 3 months ago
This begins by dropping the -Ttext-segment stuff, which Fangrui Song
correctly points out does not work with lld.  But it's also obsolete,
so instead of adding support for lld's --image-base, remove it all.

Then, remove some other legacy random addresses that were supposed
to apply to softmmu, but didn't really make any sense, and aren't
used anyway when PIE is used, which is the default with a modern
linux distribution.

Then, clean up some of the configure logic surrounding PIE, and its
current non-application to non-x86.

Finally, add support for static-pie linking.

Changes in v2:
 - Remove mention of config-host.ld from make distclean
 - Do not split -z,rodata/-z,now into two tests
 - Fix --disable-pie --static

Tested in conjunction with AJB's 
  configure: allow disable of cross compilation container
  https://lists.gnu.org/archive/html/qemu-devel/2019-12/msg02943.html

as otherwise check-tcg simply doesn't work on aarch64 if you happen
to have docker installed.


r~


Richard Henderson (7):
  configure: Drop adjustment of textseg
  tcg: Remove softmmu code_gen_buffer fixed address
  configure: Do not force pie=no for non-x86
  configure: Always detect -no-pie toolchain support
  configure: Unnest detection of -z,relro and -z,now
  configure: Override the os default with --disable-pie
  configure: Support -static-pie if requested

 Makefile                  |   2 +-
 accel/tcg/translate-all.c |  37 ++----------
 configure                 | 116 +++++++++++---------------------------
 3 files changed, 38 insertions(+), 117 deletions(-)

-- 
2.20.1


Re: [PATCH v2 0/7] configure: Improve PIE and other linkage
Posted by Richard Henderson 4 years, 2 months ago
On 12/19/19 8:34 AM, Richard Henderson wrote:
> This begins by dropping the -Ttext-segment stuff, which Fangrui Song
> correctly points out does not work with lld.  But it's also obsolete,
> so instead of adding support for lld's --image-base, remove it all.
> 
> Then, remove some other legacy random addresses that were supposed
> to apply to softmmu, but didn't really make any sense, and aren't
> used anyway when PIE is used, which is the default with a modern
> linux distribution.
> 
> Then, clean up some of the configure logic surrounding PIE, and its
> current non-application to non-x86.
> 
> Finally, add support for static-pie linking.
> 
> Changes in v2:
>  - Remove mention of config-host.ld from make distclean
>  - Do not split -z,rodata/-z,now into two tests
>  - Fix --disable-pie --static
> 
> Tested in conjunction with AJB's 
>   configure: allow disable of cross compilation container
>   https://lists.gnu.org/archive/html/qemu-devel/2019-12/msg02943.html
> 
> as otherwise check-tcg simply doesn't work on aarch64 if you happen
> to have docker installed.

Ping.  Patches 3 and 7 still unreviewed.


r~