mbox series

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

Message ID 20191218031920.6414-1-richard.henderson@linaro.org
Headers show
Series configure: Improve PIE and other linkage | expand

Message

Richard Henderson Dec. 18, 2019, 3:19 a.m. UTC
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.


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

 accel/tcg/translate-all.c |  37 ++----------
 configure                 | 120 ++++++++++++--------------------------
 2 files changed, 41 insertions(+), 116 deletions(-)

-- 
2.20.1

Comments

Fangrui Song Dec. 18, 2019, 7:28 a.m. UTC | #1
On 2019-12-17, 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.

>

>

>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

>

> accel/tcg/translate-all.c |  37 ++----------

> configure                 | 120 ++++++++++++--------------------------

> 2 files changed, 41 insertions(+), 116 deletions(-)

>

>-- 

>2.20.1


Thank you for the patch set. I hope this will make that lld qemu user
happy.

How will this patch set affect statically linked user mode binaries?
(qemu-user-static packages on Debian, CentOS, ...)
Richard Henderson Dec. 18, 2019, 10:32 p.m. UTC | #2
On 12/17/19 9:28 PM, Fangrui Song wrote:
> How will this patch set affect statically linked user mode binaries?

> (qemu-user-static packages on Debian, CentOS, ...)


The statically linked user mode binaries will still build, and should still be
able to run any guest binary that could be run before.

If the distribution is new enough to support -static-pie, then that will be
automatically used.

r~