[FFmpeg-cvslog] Merge commit 'ea2f72a2c14c67a3b35dac6426d1e3c0fae33fd5'

James Almer git at videolan.org
Fri Mar 30 02:42:47 EEST 2018


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Mar 29 20:40:07 2018 -0300| [23f447294487958e0c7e8c01b9f9abedb1c7ba78] | committer: James Almer

Merge commit 'ea2f72a2c14c67a3b35dac6426d1e3c0fae33fd5'

* commit 'ea2f72a2c14c67a3b35dac6426d1e3c0fae33fd5':
  configure: Don't assume a 16 byte aligned stack on BSDs on i386

Merged-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=23f447294487958e0c7e8c01b9f9abedb1c7ba78
---

 configure | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index f2aa2f5262..fc65f1024f 100755
--- a/configure
+++ b/configure
@@ -6522,16 +6522,35 @@ elif enabled gcc; then
     check_cflags -Wformat
     check_cflags -fdiagnostics-color=auto
     enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
+    if enabled x86_32; then
+        case $target_os in
+        *bsd*)
+            # BSDs don't guarantee a 16 byte aligned stack, but we can
+            # request GCC to try to maintain 16 byte alignment throughout
+            # function calls. Library entry points that might call assembly
+            # functions align the stack. (The parameter means 2^4 bytes.)
+            check_cflags -mpreferred-stack-boundary=4
+            ;;
+        esac
+    fi
 elif enabled llvm_gcc; then
     check_cflags -mllvm -stack-alignment=16
 elif enabled clang; then
-    if [ "$target_os" = "mingw32" -o "$target_os" = "win32" ] && enabled x86_32; then
+    if enabled x86_32; then
         # Clang doesn't support maintaining alignment without assuming the
         # same alignment in every function. If 16 byte alignment would be
         # enabled, one would also have to either add attribute_align_arg on
         # every single entry point into the libraries or enable -mstackrealign
         # (doing stack realignment in every single function).
-        disable aligned_stack
+        case $target_os in
+        mingw32|win32|*bsd*)
+            disable aligned_stack
+            ;;
+        *)
+            check_cflags -mllvm -stack-alignment=16
+            check_cflags -mstack-alignment=16
+            ;;
+        esac
     else
         check_cflags -mllvm -stack-alignment=16
         check_cflags -mstack-alignment=16


======================================================================

diff --cc configure
index f2aa2f5262,78a2065208..fc65f1024f
--- a/configure
+++ b/configure
@@@ -6518,10 -4952,22 +6518,21 @@@ elif enabled gcc; the
      check_cflags -Werror=implicit-function-declaration
      check_cflags -Werror=missing-prototypes
      check_cflags -Werror=return-type
 -    check_cflags -Werror=declaration-after-statement
      check_cflags -Werror=vla
 -    check_cflags -Werror=format-security
 +    check_cflags -Wformat
      check_cflags -fdiagnostics-color=auto
      enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
+     if enabled x86_32; then
+         case $target_os in
+         *bsd*)
+             # BSDs don't guarantee a 16 byte aligned stack, but we can
+             # request GCC to try to maintain 16 byte alignment throughout
+             # function calls. Library entry points that might call assembly
+             # functions align the stack. (The parameter means 2^4 bytes.)
+             check_cflags -mpreferred-stack-boundary=4
+             ;;
+         esac
+     fi
  elif enabled llvm_gcc; then
      check_cflags -mllvm -stack-alignment=16
  elif enabled clang; then
@@@ -6531,10 -4977,16 +6542,18 @@@
          # enabled, one would also have to either add attribute_align_arg on
          # every single entry point into the libraries or enable -mstackrealign
          # (doing stack realignment in every single function).
-         disable aligned_stack
+         case $target_os in
+         mingw32|win32|*bsd*)
+             disable aligned_stack
+             ;;
+         *)
+             check_cflags -mllvm -stack-alignment=16
++            check_cflags -mstack-alignment=16
+             ;;
+         esac
      else
          check_cflags -mllvm -stack-alignment=16
 +        check_cflags -mstack-alignment=16
      fi
      check_cflags -Qunused-arguments
      check_cflags -Werror=implicit-function-declaration



More information about the ffmpeg-cvslog mailing list