[MacPorts] #64781: x265 fails for ppc64 on Leopard: error: bad value (power8) for -mcpu= switch

MacPorts noreply at macports.org
Tue Apr 5 20:13:07 UTC 2022


#64781: x265 fails for ppc64 on Leopard: error: bad value (power8) for -mcpu=
switch
---------------------------+-------------------------------------
  Reporter:  barracuda156  |      Owner:  (none)
      Type:  defect        |     Status:  new
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:  2.7.2
Resolution:                |   Keywords:  powerpc, leopard, ppc64
      Port:  x265          |
---------------------------+-------------------------------------

Comment (by barracuda156):

 So CMakeLists.txt has the following:

 {{{
 # System architecture detection
 string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
 set(X86_ALIASES x86 i386 i686 x86_64 amd64)
 set(ARM_ALIASES armv6l armv7l aarch64)
 list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
 list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH)
 set(POWER_ALIASES ppc64 ppc64le)
 list(FIND POWER_ALIASES "${SYSPROC}" POWERMATCH)
 if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1")
     set(X86 1)
     add_definitions(-DX265_ARCH_X86=1)
     if(CMAKE_CXX_FLAGS STREQUAL "-m32")
         message(STATUS "Detected x86 target processor")
     elseif("${CMAKE_SIZEOF_VOID_P}" MATCHES 8)
         set(X64 1)
         add_definitions(-DX86_64=1)
         message(STATUS "Detected x86_64 target processor")
     endif()
 elseif(POWERMATCH GREATER "-1")
     message(STATUS "Detected POWER target processor")
     set(POWER 1)
     add_definitions(-DX265_ARCH_POWER=1)
     if("${CMAKE_SIZEOF_VOID_P}" MATCHES 8)
         set(PPC64 1)
         add_definitions(-DPPC64=1)
         message(STATUS "Detected POWER PPC64 target processor")
     endif()
 }}}

 And:

 {{{
 if(POWER)
     # IBM Power8
     option(ENABLE_ALTIVEC "Enable ALTIVEC profiling instrumentation" ON)
     if(ENABLE_ALTIVEC)
         add_definitions(-DHAVE_ALTIVEC=1 -maltivec -mabi=altivec)
         add_definitions(-flax-vector-conversions -fpermissive)
     else()
         add_definitions(-DHAVE_ALTIVEC=0)
     endif()

     option(CPU_POWER8 "Enable CPU POWER8 profiling instrumentation" ON)
     if(CPU_POWER8)
         add_definitions(-mcpu=power8 -DX265_ARCH_POWER8=1)
     endif()
 endif()
 }}}

 Macports patch adds:

 {{{
 --- CMakeLists.txt.orig 2021-01-31 17:45:15.000000000 -0800
 +++ CMakeLists.txt      2021-01-31 17:45:51.000000000 -0800
 @@ -37,6 +37,10 @@

  SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake"
 "${CMAKE_MODULE_PATH}")

 +if(DEFINED OVERRIDE_SYSTEM_PROCESSOR)
 +set(CMAKE_SYSTEM_PROCESSOR ${OVERRIDE_SYSTEM_PROCESSOR})
 +endif()
 +
  # System architecture detection
  string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
  set(X86_ALIASES x86 i386 i686 x86_64 amd64)
 }}}

 So this is possibly the cause: ppc64 makes it think it is on POWER arch,
 while missing altogether ppc32 does not trigger any silly flags and builds
 fine.

-- 
Ticket URL: <https://trac.macports.org/ticket/64781#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list