[FFmpeg-devel] [PATCH] configure: reserve a register for gcc before 5 on x86_32 with PIE

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Sun Nov 20 02:07:42 EET 2016


gcc before gcc-5 reserves a register on x86_32 for the GOT, when PIE is
enabled.

This fixes build failures due to:
error: 'asm' operand has impossible constraints

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
---

A build log of a failed build with gcc 4.9 is available at:
https://buildd.debian.org/status/fetch.php?pkg=ffmpeg&arch=i386&ver=7%3A3.2-2~bpo8%2B1&stamp=1478791165

---
 configure | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/configure b/configure
index b5bfad6..8794580 100755
--- a/configure
+++ b/configure
@@ -5364,6 +5364,19 @@ EOF
     enabled ssse3  && check_inline_asm ssse3_inline  '"pabsw %xmm0, %xmm0"'
     enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
 
+    case "$toolchain" in
+        hardened)
+            if enabled x86_32; then
+                # When PIE is enabled on x86_32, gcc before gcc-5 reserves a register for the GOT.
+                case $gcc_basever in
+                    2*|3*|4*)
+                        disable ebp_available
+                    ;;
+                esac
+            fi
+        ;;
+    esac
+
     if ! disabled_any asm mmx yasm; then
         if check_cmd $yasmexe --version; then
             enabled x86_64 && yasm_extra="-m amd64"
-- 
2.10.2


More information about the ffmpeg-devel mailing list