xref: /OK3568_Linux_fs/buildroot/package/x265/0001-fix-gcc-options.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1# HG changeset patch
2# User Bertrand Jacquin <bertrand@jacquin.bzh>
3# Date 1444431941 -3600
4# Node ID 5c6d2a6f2f9a0534933cc999b3845be4344e1af0
5# Parent  b6156a08b1def3584647f26096866c1a0c11e54a
6build: Disable -march selection from CMakeLists.txt
7
8x32 arch as defined on https://sites.google.com/site/x32abi is neither
9X86 nor X64, then forcing -march=i686 leads to build failure as wrong
10-march is used.
11
12Forcing -march, -mfloat-abi and -mfpu for ARM is also wrong
13
14As a global sanity sake, disable all forced -march in CMakeLists
15
16Backported from upstream pull request:
17https://bitbucket.org/multicoreware/x265/pull-requests/21
18
19Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
20
21diff -r 58dddcf01b7d source/CMakeLists.txt
22--- a/source/CMakeLists.txt	Mon Jan 23 09:50:33 2017 +0530
23+++ b/source/CMakeLists.txt	Mon Jan 23 21:03:10 2017 +0100
24@@ -194,28 +194,6 @@
25     if(NATIVE_BUILD)
26         if(INTEL_CXX)
27             add_definitions(-xhost)
28-        else()
29-            add_definitions(-march=native)
30-        endif()
31-    elseif(X86 AND NOT X64)
32-        string(FIND "${CMAKE_CXX_FLAGS}" "-march" marchPos)
33-        if(marchPos LESS "0")
34-            add_definitions(-march=i686)
35-            if(WIN32 AND NOT INTEL_CXX AND NOT CLANG AND
36-               CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
37-                add_definitions(-mpreferred-stack-boundary=2)
38-            endif()
39-        endif()
40-    endif()
41-    if(ARM AND CROSS_COMPILE_ARM)
42-        set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
43-    elseif(ARM)
44-        find_package(Neon)
45-        if(CPU_HAS_NEON)
46-            set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
47-            add_definitions(-DHAVE_NEON)
48-        else()
49-            set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
50         endif()
51     endif()
52     add_definitions(${ARM_ARGS})
53