* [PATCH] configure: Don't warn about lack of PIE on macOS
@ 2020-06-01 12:42 Roman Bolshakov
2020-06-04 1:24 ` Cameron Esfahani
2020-06-23 12:48 ` Stefan Hajnoczi
0 siblings, 2 replies; 4+ messages in thread
From: Roman Bolshakov @ 2020-06-01 12:42 UTC (permalink / raw)
To: qemu-devel; +Cc: Roman Bolshakov, Richard Henderson
ld64 is making PIE executables for 10.7 and above by default, as
documented in ld(1).
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
configure | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configure b/configure
index af2ba83f0e..6dddbca4b2 100755
--- a/configure
+++ b/configure
@@ -2137,6 +2137,8 @@ elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
QEMU_LDFLAGS="-pie $QEMU_LDFLAGS"
pie="yes"
+elif test "$darwin" = "yes"; then
+ pie="yes"
elif test "$pie" = "yes"; then
error_exit "PIE not available due to missing toolchain support"
else
--
2.26.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] configure: Don't warn about lack of PIE on macOS
2020-06-01 12:42 [PATCH] configure: Don't warn about lack of PIE on macOS Roman Bolshakov
@ 2020-06-04 1:24 ` Cameron Esfahani
2020-06-23 12:48 ` Stefan Hajnoczi
1 sibling, 0 replies; 4+ messages in thread
From: Cameron Esfahani @ 2020-06-04 1:24 UTC (permalink / raw)
To: Roman Bolshakov; +Cc: Cameron Esfahani via
Reviewed-by: Cameron Esfahani <dirty@apple.com>
Cameron Esfahani
dirty@apple.com
"It is the spirit and not the form of law that keeps justice alive."
Earl Warren
> On Jun 1, 2020, at 5:42 AM, Roman Bolshakov <r.bolshakov@yadro.com> wrote:
>
> ld64 is making PIE executables for 10.7 and above by default, as
> documented in ld(1).
>
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
> configure | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/configure b/configure
> index af2ba83f0e..6dddbca4b2 100755
> --- a/configure
> +++ b/configure
> @@ -2137,6 +2137,8 @@ elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
> QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
> QEMU_LDFLAGS="-pie $QEMU_LDFLAGS"
> pie="yes"
> +elif test "$darwin" = "yes"; then
> + pie="yes"
> elif test "$pie" = "yes"; then
> error_exit "PIE not available due to missing toolchain support"
> else
> --
> 2.26.1
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] configure: Don't warn about lack of PIE on macOS
2020-06-01 12:42 [PATCH] configure: Don't warn about lack of PIE on macOS Roman Bolshakov
2020-06-04 1:24 ` Cameron Esfahani
@ 2020-06-23 12:48 ` Stefan Hajnoczi
2020-06-23 13:15 ` Roman Bolshakov
1 sibling, 1 reply; 4+ messages in thread
From: Stefan Hajnoczi @ 2020-06-23 12:48 UTC (permalink / raw)
To: Roman Bolshakov; +Cc: Peter Maydell, Richard Henderson, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1038 bytes --]
On Mon, Jun 01, 2020 at 03:42:57PM +0300, Roman Bolshakov wrote:
> ld64 is making PIE executables for 10.7 and above by default, as
> documented in ld(1).
>
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
> configure | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/configure b/configure
> index af2ba83f0e..6dddbca4b2 100755
> --- a/configure
> +++ b/configure
> @@ -2137,6 +2137,8 @@ elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
> QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
> QEMU_LDFLAGS="-pie $QEMU_LDFLAGS"
> pie="yes"
> +elif test "$darwin" = "yes"; then
> + pie="yes"
Hi Roman,
I'm wondering why the elif above doesn't detect the presence of PIE
automatically?
elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
QEMU_LDFLAGS="-pie $QEMU_LDFLAGS"
pie="yes"
Can this code be tweaked to cover macOS too?
Also CCing Peter Maydell in case he wants to merge this patch directly
into qemu.git.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] configure: Don't warn about lack of PIE on macOS
2020-06-23 12:48 ` Stefan Hajnoczi
@ 2020-06-23 13:15 ` Roman Bolshakov
0 siblings, 0 replies; 4+ messages in thread
From: Roman Bolshakov @ 2020-06-23 13:15 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Peter Maydell, Richard Henderson, qemu-devel
On Tue, Jun 23, 2020 at 01:48:57PM +0100, Stefan Hajnoczi wrote:
> On Mon, Jun 01, 2020 at 03:42:57PM +0300, Roman Bolshakov wrote:
> > ld64 is making PIE executables for 10.7 and above by default, as
> > documented in ld(1).
> >
> > Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> > ---
> > configure | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/configure b/configure
> > index af2ba83f0e..6dddbca4b2 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2137,6 +2137,8 @@ elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
> > QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
> > QEMU_LDFLAGS="-pie $QEMU_LDFLAGS"
> > pie="yes"
> > +elif test "$darwin" = "yes"; then
> > + pie="yes"
>
> Hi Roman,
> I'm wondering why the elif above doesn't detect the presence of PIE
> automatically?
>
> elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
> QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
> QEMU_LDFLAGS="-pie $QEMU_LDFLAGS"
> pie="yes"
>
> Can this code be tweaked to cover macOS too?
>
> Also CCing Peter Maydell in case he wants to merge this patch directly
> into qemu.git.
>
> Stefan
Hi Stefan,
It's because clang does not accept -pie/-no-pie directly:
$ cc -Werror -fPIE -DPIE -pie main.c
clang: error: argument unused during compilation: '-pie' [-Werror,-Wunused-command-line-argument]
It has to be passed as linker option, i.e. -Wl,-pie or -Wl,-no_pie. pie
is also a default behaviour of clang/ld64.
I had a patch to enable proper support of pie/no-pie for macOS but I see
little value in it. I don't know where no_pie would be helfpul becuase
clang from Apple Developer Tools can't cross-compile option ROMs.
Thanks,
Roman
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-06-23 13:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-01 12:42 [PATCH] configure: Don't warn about lack of PIE on macOS Roman Bolshakov
2020-06-04 1:24 ` Cameron Esfahani
2020-06-23 12:48 ` Stefan Hajnoczi
2020-06-23 13:15 ` Roman Bolshakov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.