[vtk-developers] OS X vtkDetermineCompilerFlags.cmake broken for gcc 4.5 up -mlong-branch only relevant to PPC

Sean McBride sean at rogue-research.com
Fri Apr 13 14:16:24 EDT 2012


On Fri, 13 Apr 2012 12:54:18 -0500, Kent Williams said:

>There seems to be some really old PPC-specific stuff laying around
>that is problematic after e.g. gcc 4.2.  In particular,
>'-mlong-branch' is not supported.  I'm not sure it even exists in gcc
>versions other than Apple's custom builds.
>
>Is OS X & Power Macs even still supported?

I believe so.  Our recent discussion said we supported 10.5 and later, and 10.5 supports PPC.

>In particular, around line 105 in vtkDetermineCompilerFlags.cmake
>there's this:
>
>
>     IF(NOT BUILD_SHARED_LIBS)
>      SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mlong-branch")
>      SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mlong-branch")
>     ENDIF(NOT BUILD_SHARED_LIBS)
>
>Apparently this is silently ignored by compilers other than CLang and
>home-built GCC, who get upset because they don't recognize it.
>
>This is why Slicer won't build on Apple with anything other than the
>default gcc-llvm compiler, too.
>
>Shouldn't it be something like this?
>
>set(BUILDING_ON_PPC_OS_X  <whatever flag(s) tell you you're building
>on OS X with PPC>)
>if(NOT BUILD_SHARED_LIBS AND ${BUILDING_ON_PPC_OS_X})

Whether you're building _on_ PPC is not important, it's whether your building _for_ the PPC architecture.  Remember, with Universal Binaries you may be building for ppc & intel at the same time.

In the past, I remember link problems on PPC related to all this.  They may have been fixed in newer gcc/ld/Xcode versions.

I could try a test build on my Rogue3 dashboard, it's running 10.5 on PPC with the newest Xcode available there....

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtk-developers mailing list