Fails to start on Windows host without explicit --disable-pie

Bug #1871798 reported by James Le Cuirot
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

Since commit d2cd29e30736afd4a1e8cac3cf4da360bbc65978, which removed the x86 conditional around PIE, QEMU completely fails to start on a Windows host unless --disable-pie is explicitly given at build time. Even just requesting the help text doesn't work. To make testing easier, this can be replicated with Wine.

Alex Bennée (ajbennee)
tags: added: configure pie
Revision history for this message
Alex Bennée (ajbennee) wrote :

What compiler and toolchain are you using?

Changed in qemu:
status: New → Incomplete
Revision history for this message
James Le Cuirot (chewi) wrote :

I'm using GCC 9.3.0 with mingw-w64 7.0.0, all built with Gentoo Linux's crossdev.

Revision history for this message
James Le Cuirot (chewi) wrote :

I didn't know whether PIE is generally supported on Windows or not. It was possible that Gentoo is just inadvertently disabling support for it. It did stem from a bug report though and reading around, others elsewhere have reported that PIE on Windows doesn't work.

Revision history for this message
Alex Bennée (ajbennee) wrote : [PATCH v1 07/11] configure: disable PIE for Windows builds

It seems on some compilers the test can pass but still give you
broken binaries.

[AJB untested - please could windows users test]

Fixes: d2cd29e30736
Fixes: https://bugs.launchpad.net/qemu/+bug/1871798
Cc: Bug 1871798 <email address hidden>
Cc: James Le Cuirot <email address hidden>
Signed-off-by: Alex Bennée <email address hidden>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index a207cce82bc..e9c5f630c14 100755
--- a/configure
+++ b/configure
@@ -807,6 +807,7 @@ MINGW32*)
     audio_drv_list=""
   fi
   supported_os="yes"
+ pie="no"
 ;;
 GNU/kFreeBSD)
   bsd="yes"
--
2.20.1

Revision history for this message
Howard Spoelstra (cat-7) wrote : Re: [PATCH v1 07/11] configure: disable PIE for Windows builds

On Thu, Apr 9, 2020 at 11:18 PM Alex Bennée <email address hidden> wrote:

> It seems on some compilers the test can pass but still give you
> broken binaries.
>
> [AJB untested - please could windows users test]
>
> Fixes: d2cd29e30736
> Fixes: https://bugs.launchpad.net/qemu/+bug/1871798
> Cc: Bug 1871798 <email address hidden>
> Cc: James Le Cuirot <email address hidden>
> Signed-off-by: Alex Bennée <email address hidden>
> ---
> configure | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/configure b/configure
> index a207cce82bc..e9c5f630c14 100755
> --- a/configure
> +++ b/configure
> @@ -807,6 +807,7 @@ MINGW32*)
> audio_drv_list=""
> fi
> supported_os="yes"
> + pie="no"
> ;;
> GNU/kFreeBSD)
> bsd="yes"
> --
> 2.20.1
>

Solves my issue! So,

Tested-by: Howard Spoelstra <email address hidden>

Revision history for this message
James Le Cuirot (chewi) wrote :

Tested and working. Thank you!

Revision history for this message
Philippe Mathieu-Daudé (philmd) wrote :

On 4/9/20 11:15 PM, Alex Bennée wrote:
> It seems on some compilers the test can pass but still give you
> broken binaries.
>
> [AJB untested - please could windows users test]
>
> Fixes: d2cd29e30736
> Fixes: https://bugs.launchpad.net/qemu/+bug/1871798
> Cc: Bug 1871798 <email address hidden>
> Cc: James Le Cuirot <email address hidden>
> Signed-off-by: Alex Bennée <email address hidden>
> ---
> configure | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/configure b/configure
> index a207cce82bc..e9c5f630c14 100755
> --- a/configure
> +++ b/configure
> @@ -807,6 +807,7 @@ MINGW32*)
> audio_drv_list=""
> fi
> supported_os="yes"
> + pie="no"
> ;;
> GNU/kFreeBSD)
> bsd="yes"
>

Reviewed-by: Philippe Mathieu-Daudé <email address hidden>

Revision history for this message
Alex Bennée (ajbennee) wrote : [PATCH v2 08/17] configure: disable PIE for Windows builds

It seems on some compilers the test can pass but still give you
broken binaries.

Fixes: d2cd29e30736
Fixes: https://bugs.launchpad.net/qemu/+bug/1871798
Cc: Bug 1871798 <email address hidden>
Signed-off-by: Alex Bennée <email address hidden>
Tested-by: Howard Spoelstra <email address hidden>
Tested-by: James Le Cuirot <email address hidden>
Reviewed-by: Philippe Mathieu-Daudé <email address hidden>
Reviewed-by: Richard Henderson <email address hidden>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 25f7d915720..23b5e93752b 100755
--- a/configure
+++ b/configure
@@ -807,6 +807,7 @@ MINGW32*)
     audio_drv_list=""
   fi
   supported_os="yes"
+ pie="no"
 ;;
 GNU/kFreeBSD)
   bsd="yes"
--
2.20.1

Revision history for this message
Alex Bennée (ajbennee) wrote : [PULL 3/8] configure: disable PIE for Windows builds

It seems on some compilers the test can pass but still give you
broken binaries.

Fixes: d2cd29e30736
Fixes: https://bugs.launchpad.net/qemu/+bug/1871798
Cc: Bug 1871798 <email address hidden>
Signed-off-by: Alex Bennée <email address hidden>
Tested-by: Howard Spoelstra <email address hidden>
Tested-by: James Le Cuirot <email address hidden>
Reviewed-by: Philippe Mathieu-Daudé <email address hidden>
Reviewed-by: Richard Henderson <email address hidden>
Message-Id: <email address hidden>

diff --git a/configure b/configure
index 25f7d915720..23b5e93752b 100755
--- a/configure
+++ b/configure
@@ -807,6 +807,7 @@ MINGW32*)
     audio_drv_list=""
   fi
   supported_os="yes"
+ pie="no"
 ;;
 GNU/kFreeBSD)
   bsd="yes"
--
2.20.1

Revision history for this message
Philippe Mathieu-Daudé (philmd) wrote :

Fixed in commit 469a788cdd3c618ef1b8a23a339510082b3eeea7.

Changed in qemu:
status: Incomplete → Fix Committed
Changed in qemu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.