On Tue, 20 Aug 2013, Stuart Henderson wrote:

> On 2013/08/20 08:25, Stuart Henderson wrote:
> > On 2013/08/20 08:50, David Coppa wrote:
> > > On Mon, Aug 19, 2013 at 11:50 PM, Stuart Henderson <st...@openbsd.org> 
> > > wrote:
> > > 
> > > > these ones all use cmake which has a common segfault on arm since
> > > > the move to enabling the elf parser.

Comments on the following diff?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/cmake/Makefile,v
retrieving revision 1.89
diff -u -p -u -p -r1.89 Makefile
--- Makefile    20 Aug 2013 14:22:58 -0000      1.89
+++ Makefile    21 Aug 2013 13:03:48 -0000
@@ -23,7 +23,10 @@ PERMIT_PACKAGE_CDROM =       Yes
 WANTLIB =              archive c curl curses expat form m \
                        stdc++ z
 
+# XXX: CMake's built-in ELF parser is broken on arm
+.if ${MACHINE_ARCH} != "arm"
 BUILD_DEPENDS =                devel/ninja
+.endif
 
 LIB_DEPENDS =          archivers/libarchive \
                        net/curl
@@ -59,6 +62,8 @@ pre-configure:
                ${WRKSRC}/Modules/FindSDL.cmake \
                ${WRKSRC}/Modules/FindTCL.cmake
 
+# XXX: CMake's built-in ELF parser is broken on arm
+.if ${MACHINE_ARCH} != "arm"
 do-build:
        cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} ninja -v -j \
                ${MAKE_JOBS} ${ALL_TARGET}
@@ -70,6 +75,7 @@ do-install:
 do-test:
        cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} ninja -v -j \
                ${MAKE_JOBS} ${TEST_FLAGS} ${TEST_TARGET}
+.endif
 
 post-install:
        rm ${WRKINST}/${LOCALBASE}/share/cmake/Modules/*.{beforesubst,orig}
Index: cmake.port.mk
===================================================================
RCS file: /cvs/ports/devel/cmake/cmake.port.mk,v
retrieving revision 1.20
diff -u -p -u -p -r1.20 cmake.port.mk
--- cmake.port.mk       25 Jun 2013 08:34:10 -0000      1.20
+++ cmake.port.mk       21 Aug 2013 13:03:48 -0000
@@ -9,6 +9,11 @@ MAKE_ENV+=LIB${_n}_VERSION=${_v}
 
 USE_NINJA ?= Yes
 
+# XXX: CMake's built-in ELF parser is broken on arm
+.if ${MACHINE_ARCH} == "arm"
+USE_NINJA = No
+.endif
+
 .if ${USE_NINJA:L} == "yes"
 BUILD_DEPENDS += devel/ninja
 _MODCMAKE_GEN = Ninja
Index: patches/patch-Source_CMakeLists_txt
===================================================================
RCS file: /cvs/ports/devel/cmake/patches/patch-Source_CMakeLists_txt,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 patch-Source_CMakeLists_txt
--- patches/patch-Source_CMakeLists_txt 25 Jun 2013 07:16:46 -0000      1.3
+++ patches/patch-Source_CMakeLists_txt 21 Aug 2013 13:03:49 -0000
@@ -13,18 +13,22 @@ OpenBSD provides ELF ABI declarations in
 
 Teach the platform check and cmELF implementation to use these.
 
---- Source/CMakeLists.txt.orig Wed May 15 19:38:13 2013
-+++ Source/CMakeLists.txt      Fri Jun 21 09:15:02 2013
-@@ -11,7 +11,11 @@
+XXX: broken on arm
+
+--- Source/CMakeLists.txt.orig Tue Jul  2 15:41:40 2013
++++ Source/CMakeLists.txt      Tue Aug 20 11:22:32 2013
+@@ -11,8 +11,12 @@
  #=============================================================================
  include(CheckIncludeFile)
  # Check if we can build support for ELF parsing.
 -CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H)
+-if(HAVE_ELF_H)
 +if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
 +  CHECK_INCLUDE_FILES("stdint.h;elf_abi.h" HAVE_ELF_H)
 +else()
 +  CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H)
 +endif()
- if(HAVE_ELF_H)
++if(HAVE_ELF_H AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
    set(CMAKE_USE_ELF_PARSER 1)
  else()
+   set(CMAKE_USE_ELF_PARSER)
Index: patches/patch-bootstrap
===================================================================
RCS file: /cvs/ports/devel/cmake/patches/patch-bootstrap,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 patch-bootstrap
--- patches/patch-bootstrap     28 Jun 2013 14:58:23 -0000      1.3
+++ patches/patch-bootstrap     21 Aug 2013 13:03:49 -0000
@@ -1,15 +1,20 @@
 $OpenBSD: patch-bootstrap,v 1.3 2013/06/28 14:58:23 dcoppa Exp $
 
 Use Ninja to build CMake
+XXX: broken on arm
 
---- bootstrap.orig     Thu Jun 27 11:26:07 2013
-+++ bootstrap  Thu Jun 27 11:26:31 2013
-@@ -112,7 +112,7 @@ if ${cmake_system_mingw}; then
+--- bootstrap.orig     Tue Jul  2 15:41:41 2013
++++ bootstrap  Tue Aug 20 10:55:10 2013
+@@ -112,7 +112,11 @@ if ${cmake_system_mingw}; then
    cmake_bootstrap_generator="MSYS Makefiles"
  else
    # Bootstrapping from a standard UNIX prompt.
 -  cmake_bootstrap_generator="Unix Makefiles"
-+  cmake_bootstrap_generator="Ninja"
++  if arch -s | grep ^arm >/dev/null 2>&1; then
++    cmake_bootstrap_generator="Unix Makefiles"
++  else
++    cmake_bootstrap_generator="Ninja"
++  fi
  fi
  
  # Choose tools and extensions for this platform.

Reply via email to