[x265-commits] [x265] cmake: use list append for numa lib (nit)

Steve Borho steve at borho.org
Fri Mar 6 19:52:59 CET 2015


details:   http://hg.videolan.org/x265/rev/c3d888d55f88
branches:  
changeset: 9646:c3d888d55f88
user:      Steve Borho <steve at borho.org>
date:      Fri Mar 06 10:48:51 2015 -0600
description:
cmake: use list append for numa lib (nit)
Subject: [x265] cmake: generalize adding additional linker options

details:   http://hg.videolan.org/x265/rev/cb0127e26694
branches:  
changeset: 9647:cb0127e26694
user:      Steve Borho <steve at borho.org>
date:      Fri Mar 06 10:49:25 2015 -0600
description:
cmake: generalize adding additional linker options
Subject: [x265] cmake: remove obsolete CC_HAS_FSANITIZE section

details:   http://hg.videolan.org/x265/rev/23a56c0d1ffa
branches:  
changeset: 9648:23a56c0d1ffa
user:      Steve Borho <steve at borho.org>
date:      Fri Mar 06 10:49:44 2015 -0600
description:
cmake: remove obsolete CC_HAS_FSANITIZE section
Subject: [x265] cmake: -fstack-protector requires libssp on MinGW

details:   http://hg.videolan.org/x265/rev/eea4096c1503
branches:  
changeset: 9649:eea4096c1503
user:      Steve Borho <steve at borho.org>
date:      Fri Mar 06 10:51:00 2015 -0600
description:
cmake: -fstack-protector requires libssp on MinGW
Subject: [x265] cmake: use the more aggressive form -fstack-protector-all

details:   http://hg.videolan.org/x265/rev/a07ea06f3ee8
branches:  
changeset: 9650:a07ea06f3ee8
user:      Steve Borho <steve at borho.org>
date:      Fri Mar 06 11:01:10 2015 -0600
description:
cmake: use the more aggressive form -fstack-protector-all

The simpler -fstack-protector was only instrumenting a few functions in
search.cpp (we only noticed when there were link failures because of libssp)
Subject: [x265] asm: upgrade runtime warning to explicit compile error

details:   http://hg.videolan.org/x265/rev/3eef0fe70475
branches:  
changeset: 9651:3eef0fe70475
user:      Steve Borho <steve at borho.org>
date:      Fri Mar 06 11:07:03 2015 -0600
description:
asm: upgrade runtime warning to explicit compile error

It is impossible to link the encoder in that configuration, so we must tell the
user at compile time that this will not work.

diffstat:

 source/CMakeLists.txt                |  17 +++++++++--------
 source/common/x86/asm-primitives.cpp |   3 +--
 2 files changed, 10 insertions(+), 10 deletions(-)

diffs (72 lines):

diff -r e0603bbe919f -r 3eef0fe70475 source/CMakeLists.txt
--- a/source/CMakeLists.txt	Fri Mar 06 12:13:48 2015 +0530
+++ b/source/CMakeLists.txt	Fri Mar 06 11:07:03 2015 -0600
@@ -63,7 +63,7 @@ if(UNIX)
         if(NUMA_V2)
             add_definitions(-DHAVE_LIBNUMA)
             message(STATUS "libnuma found, building with support for NUMA nodes")
-            set(PLATFORM_LIBS ${PLATFORM_LIBS} ${NUMA_LIBRARY})
+            list(APPEND PLATFORM_LIBS ${NUMA_LIBRARY})
             link_directories(${NUMA_LIBRARY_DIR})
             include_directories(${NUMA_INCLUDE_DIR})
         endif()
@@ -165,6 +165,7 @@ if(GCC)
     set(FSANITIZE "" CACHE STRING "-fsanitize options for GCC/clang")
     if(FSANITIZE)
         add_definitions(-fsanitize=${FSANITIZE})
+        list(APPEND LINKER_OPTIONS "-fsanitize=${FSANITIZE}")
     endif()
     execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CC_VERSION)
 endif(GCC)
@@ -186,10 +187,7 @@ if(CHECKED_BUILD)
     if(GCC)
         check_cxx_compiler_flag(-fsanitize=undefined-trap CC_HAS_CATCH_UNDEFINED) # clang
         check_cxx_compiler_flag(-ftrapv CC_HAS_FTRAPV)                            # gcc
-        check_cxx_compiler_flag(-fstack-protector CC_HAS_STACK_PROTECT)           # gcc
-        if(CC_HAS_FSANITIZE)
-            add_definitions(-fsanitize=address)
-        endif()
+        check_cxx_compiler_flag(-fstack-protector-all CC_HAS_STACK_PROTECT)       # gcc
         if(CC_HAS_FTRAPV)
             add_definitions(-ftrapv)
         endif()
@@ -197,7 +195,10 @@ if(CHECKED_BUILD)
             add_definitions(-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error)
         endif()
         if(CC_HAS_STACK_PROTECT)
-            add_definitions(-fstack-protector)
+            add_definitions(-fstack-protector-all)
+            if(MINGW)
+                list(APPEND PLATFORM_LIBS ssp)
+            endif()
         endif()
     endif(GCC)
 endif()
@@ -428,12 +429,12 @@ if(ENABLE_CLI)
         endif()
     endif()
     set_target_properties(cli PROPERTIES OUTPUT_NAME x265)
-    if(FSANITIZE)
+    if(LINKER_OPTIONS)
         # clang and gcc need the sanitize options to be passed at link
         # time so the appropriate ASAN/TSAN runtime libraries can be
         # linked. Linking the cli to the static libx265 is usually
         # required (by setting ENABLE_SHARED to OFF)
-        set_target_properties(cli PROPERTIES LINK_FLAGS "-fsanitize=${FSANITIZE}")
+        set_target_properties(cli PROPERTIES LINK_FLAGS ${LINKER_OPTIONS})
     endif()
 
     install(TARGETS cli DESTINATION ${BIN_INSTALL_DIR})
diff -r e0603bbe919f -r 3eef0fe70475 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Fri Mar 06 12:13:48 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Fri Mar 06 11:07:03 2015 -0600
@@ -797,8 +797,7 @@ void interp_8tap_hv_pp_cpu(const pixel* 
 void setupAssemblyPrimitives(EncoderPrimitives &p, int cpuMask) // 16bpp
 {
 #if !defined(X86_64)
-    x265_log(NULL, X265_LOG_WARNING, "Assembly not allowed in 32bit high bit-depth builds\n");
-    return;
+#error "Unsupported build configuration (32bit x86 and HIGH_BIT_DEPTH), you must configure ENABLE_ASSEMBLY=OFF"
 #endif
 
     if (cpuMask & X265_CPU_SSE2)


More information about the x265-commits mailing list