beignet-1.3.2-Debian-compliant-compiler-flags-handling.patch 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Description: Set compiler flags
  2. Respect CFLAGS,CXXFLAGS,LDFLAGS (security hardening etc.)
  3. Be verbose
  4. Disable non-policy-compliant instruction set assumptions (slows the
  5. OpenCL compiler by ~few%, no effect on OpenCL execution speed)
  6. Author: Simon Richter <sjr@debian.org>,Rebecca Palmer <rebecca_palmer@zoho.com>
  7. --- a/CMakeLists.txt
  8. +++ b/CMakeLists.txt
  9. @@ -31,7 +31,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINA
  10. INCLUDE (FindPkgConfig)
  11. -SET(CMAKE_VERBOSE_MAKEFILE "false")
  12. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/")
  13. INCLUDE (GNUInstallDirs OPTIONAL)
  14. # support old CMake without GNUInstallDirs
  15. @@ -73,9 +72,9 @@ ADD_DEFINITIONS(-DGEN7_SAMPLER_CLAMP_BOR
  16. # compiler flag setting
  17. if (COMPILER STREQUAL "GCC")
  18. - set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -funroll-loops -fstrict-aliasing -msse2 -msse3 -mssse3 -msse4.1 -fPIC -Wall -mfpmath=sse -Wcast-align -Wl,-E")
  19. + set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -funroll-loops -fstrict-aliasing -fPIC -Wall -Wcast-align -Wl,-E")
  20. elseif (COMPILER STREQUAL "CLANG")
  21. - set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -funroll-loops -fstrict-aliasing -msse2 -msse3 -mssse3 -msse4.1 -fPIC -Wall")
  22. + set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -funroll-loops -fstrict-aliasing -fPIC -Wall")
  23. elseif (COMPILER STREQUAL "ICC")
  24. set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -wd2928 -Wall -fPIC -fstrict-aliasing -fp-model fast -msse4.1 -Wl,-E")
  25. endif ()
  26. --- a/backend/src/sys/platform.hpp
  27. +++ b/backend/src/sys/platform.hpp
  28. @@ -41,15 +41,6 @@
  29. #define __X86__
  30. #endif
  31. -/* We require SSE ... */
  32. -#ifndef __SSE__
  33. -#define __SSE__
  34. -#endif
  35. -
  36. -/* ... and SSE2 */
  37. -#ifndef __SSE2__
  38. -#define __SSE2__
  39. -#endif
  40. #if defined(_INCLUDED_IMM)
  41. // #define __AVX__
  42. --- a/utests/CMakeLists.txt
  43. +++ b/utests/CMakeLists.txt
  44. @@ -26,8 +26,8 @@ if (NOT NOT_BUILD_STAND_ALONE_UTEST)
  45. # Threads
  46. Find_Package(Threads)
  47. - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_CXX_FLAGS} -std=c++0x -Wno-invalid-offsetof")
  48. - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_CXX_FLAGS}")
  49. + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_CXX_FLAGS} -std=c++0x -Wno-invalid-offsetof -ffloat-store")
  50. + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_CXX_FLAGS} -ffloat-store") #compiler_{degrees,radians,function_argument2} use equality comparison of floats
  51. set (CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DGBE_DEBUG=1")
  52. set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1")
  53. set (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0")