2016-03-19 18:15 GMT+01:00 Hendrik Leppkes <h.lepp...@gmail.com>:
> The same would need to be applied for the 32-bit case as well, fwiw.

I didn't have a build environment to assert that, but now I do, and I
confirm it is needed. Patch updated.

-- 
Christophe
From 87e4f2a42bdb5f733d104ffba7cf70f786b72a03 Mon Sep 17 00:00:00 2001
From: Christophe Gisquet <christophe.gisq...@gmail.com>
Date: Sat, 19 Mar 2016 14:45:23 +0100
Subject: [PATCH] mingw64: configure: disable pie with debug enabled

This breaks use of gdb.
---
 configure | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index e5de306..9ccd727 100755
--- a/configure
+++ b/configure
@@ -4604,10 +4604,14 @@ case $target_os in
         # for dynamicbase (ASLR).  Using -pie does retain the reloc section
         # however ld then forgets what the entry point should be (oops) so we
         # have to manually (re)set it.
-        if enabled x86_32; then
+        # However, adding -pie breaks debugging through gdb at least under
+        # mingw, so let's not do this when debugging has been enabled.
+        if enabled x86_32 && disabled debug; then
             add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
         elif enabled x86_64; then
-            add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
+            if disabled debug; then
+                add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
+            fi
             check_ldflags -Wl,--high-entropy-va # binutils 2.25
             # Set image base >4GB for extra entropy with HEASLR
             add_ldexeflags -Wl,--image-base,0x140000000
-- 
2.7.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to