[x265] [PATCH 18/18] AArch64: Build with -flax-vector-conversions=none

Hari Limaye hari.limaye at arm.com
Tue Aug 13 15:21:58 UTC 2024


Currently -flax-vector-conversions is passed to GCC (and all compilers
that are treated as GCC-like in source/CMakeLists.txt) when building for
AArch64.

Remove this, and add -flax-vector-conversions=none for compilers which
support this, to enforce explicit vector type conversions. GCC already
does not allow implicit vector type conversions by default.
---
 source/CMakeLists.txt | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index d88604353..e509c6473 100755
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -312,7 +312,13 @@ if(GCC)
             set(ARM_ARGS -O3 -march=armv9-a+sve2)
             add_definitions(-DHAVE_SVE2=1)
         endif()
-        set(ARM_ARGS ${ARM_ARGS} -fPIC -flax-vector-conversions)
+        set(ARM_ARGS ${ARM_ARGS} -fPIC)
+        # Do not allow implicit vector type conversions in Clang builds (this
+        # is already the default in GCC builds).
+        check_cxx_compiler_flag(-flax-vector-conversions=none CC_HAS_FLAX_VEC_CONV_NONE)
+        if(CC_HAS_FLAX_VEC_CONV_NONE)
+            set(ARM_ARGS ${ARM_ARGS} -flax-vector-conversions=none)
+        endif()
         if(CPU_HAS_SVE)
             set(SVE_HEADER_TEST "
 #ifndef __ARM_NEON_SVE_BRIDGE
-- 
2.42.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0018-AArch64-Build-with-flax-vector-conversions-none.patch
Type: text/x-patch
Size: 1714 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20240813/0f6c89c4/attachment.bin>


More information about the x265-devel mailing list