Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Sep 2017 23:49:46 +0000 (UTC)
From:      "Carlos J. Puga Medina" <cpm@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r449320 - in head/cad/openvsp: . files
Message-ID:  <201709052349.v85NnkMx028075@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cpm
Date: Tue Sep  5 23:49:46 2017
New Revision: 449320
URL: https://svnweb.freebsd.org/changeset/ports/449320

Log:
  cad/openvsp: fix build on CURRENT
  
  - Pet portlint, USE_* comes before USES
  - Bump PORTREVISION
  
  On -CURRENT, gcc can not compile cad/openvsp. We switch to clang but need an
  additional patch in the port, otherwise clang 5.0.0 r312293 and earlier crashes.
  
  This patch will be removed if/when clang compiles clean the port.
  
  This update is based on a patch by dim@
  
  For details, see: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221588
  
  PR:		222001
  Submitted by:	Fernando Apesteguia <fernando.apesteguia@gmail.com> (maintainer)

Added:
  head/cad/openvsp/files/
  head/cad/openvsp/files/extra-src_external_angelscript_sdk_angelscript_source_as__callfunc__x86.cpp   (contents, props changed)
Modified:
  head/cad/openvsp/Makefile

Modified: head/cad/openvsp/Makefile
==============================================================================
--- head/cad/openvsp/Makefile	Tue Sep  5 23:11:01 2017	(r449319)
+++ head/cad/openvsp/Makefile	Tue Sep  5 23:49:46 2017	(r449320)
@@ -4,6 +4,7 @@
 PORTNAME=	openvsp
 PORTVERSION=	3.13.1
 DISTVERSIONPREFIX=	${GH_PROJECT}_
+PORTREVISION=	1
 CATEGORIES=	cad
 
 MAINTAINER=	fernando.apesteguia@gmail.com
@@ -26,14 +27,15 @@ BUILD_DEPENDS=	${LOCALBASE}/lib/libopenNURBS.a:graphic
 		${LOCALBASE}/include/glm/glm.hpp:math/glm \
 		${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs
 
+CMAKE_SOURCE_PATH=	${WRKSRC}/SuperProject
+CMAKE_INSTALL_PREFIX=	${STAGEDIR}${PREFIX}
+
+USES=		cmake:outsource,noninja jpeg
+
 USE_GITHUB=	yes
 GH_PROJECT=	OpenVSP
 GH_ACCOUNT=	${GH_PROJECT}
 
-CMAKE_SOURCE_PATH=	${WRKSRC}/SuperProject
-CMAKE_INSTALL_PREFIX=	${STAGEDIR}${PREFIX}
-USES=		cmake:outsource,noninja compiler:gcc-c++11-lib jpeg
-
 # On FreeBSD < 11 libc++ lacks support for sized delete operators.
 # GCC dropped the builtin version of these operators in 6+ by
 # defaulting to gnu++14. Force c++11 instead.
@@ -56,6 +58,22 @@ USE_GL=		gl glu
 
 USE_GNOME=	libxml2
 CFLAGS+=	-I${LOCALBASE}/include/openNURBS
+
+.include <bsd.port.options.mk>
+
+# In 12 gcc can not compile the port so switch to clang 5.0.0 in base.
+# But wait! It crashes while compiling so apply a patch to avoid weird asm code
+# that makes clang die
+# For details see:
+# https://lists.freebsd.org/pipermail/freebsd-hackers/2017-August/051352.html
+
+.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200000
+USES+=	compiler:c++11-lib
+EXTRA_PATCHES=	${FILESDIR}/extra-src_external_angelscript_sdk_angelscript_source_as__callfunc__x86.cpp
+CFLAGS+=	-I${LOCALBASE}/include
+.else
+USES+=	compiler:gcc-c++11-lib
+.endif
 
 BUILD_PREFIX=	OpenVSP-prefix/src/OpenVSP-build/_CPack_Packages/FreeBSD/ZIP/OpenVSP-${PORTVERSION}-FreeBSD
 

Added: head/cad/openvsp/files/extra-src_external_angelscript_sdk_angelscript_source_as__callfunc__x86.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/openvsp/files/extra-src_external_angelscript_sdk_angelscript_source_as__callfunc__x86.cpp	Tue Sep  5 23:49:46 2017	(r449320)
@@ -0,0 +1,164 @@
+--- src/external/angelscript/sdk/angelscript/source/as_callfunc_x86.cpp.orig	2017-08-02 20:09:54 UTC
++++ src/external/angelscript/sdk/angelscript/source/as_callfunc_x86.cpp
+@@ -340,7 +340,7 @@ endcopy:
+ 	volatile asPWORD a[] = {asPWORD(args), asPWORD(paramSize), asPWORD(func)};
+ 
+ 	asm __volatile__(
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// When compiled with optimizations the stack unwind doesn't work properly, 
+ 		// causing exceptions to crash the application. By adding this prologue
+ 		// and the epilogue below, the stack unwind works as it should. 
+@@ -385,7 +385,7 @@ endcopy:
+ 		// Pop the alignment bytes
+ 		"popl  %%esp            \n"
+ 		"popl  %%ebx            \n"
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// Epilogue
+ 		"movl %%ebp, %%esp         \n"
+ 		".cfi_def_cfa_register esp \n"
+@@ -462,7 +462,7 @@ endcopy:
+ 	volatile asPWORD a[] = {asPWORD(obj), asPWORD(args), asPWORD(paramSize), asPWORD(func)};
+ 
+ 	asm __volatile__ (
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// When compiled with optimizations the stack unwind doesn't work properly, 
+ 		// causing exceptions to crash the application. By adding this prologue
+ 		// and the epilogue below, the stack unwind works as it should. 
+@@ -508,7 +508,7 @@ endcopy:
+ 		// Pop the alignment bytes
+ 		"popl  %%esp            \n"
+ 		"popl  %%ebx            \n"
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// Epilogue
+ 		"movl %%ebp, %%esp         \n"
+ 		".cfi_def_cfa_register esp \n"
+@@ -585,7 +585,7 @@ endcopy:
+ 	volatile asPWORD a[] = {asPWORD(obj), asPWORD(args), asPWORD(paramSize), asPWORD(func)};
+ 
+ 	asm __volatile__ (
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// When compiled with optimizations the stack unwind doesn't work properly, 
+ 		// causing exceptions to crash the application. By adding this prologue
+ 		// and the epilogue below, the stack unwind works as it should. 
+@@ -631,7 +631,7 @@ endcopy:
+ 		// Pop the alignment bytes
+ 		"popl  %%esp            \n"
+ 		"popl  %%ebx            \n"
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// Epilogue
+ 		"movl %%ebp, %%esp         \n"
+ 		".cfi_def_cfa_register esp \n"
+@@ -717,7 +717,7 @@ endcopy:
+ 	volatile asPWORD a[] = {asPWORD(obj), asPWORD(args), asPWORD(paramSize), asPWORD(func), asPWORD(retPtr)};
+ 
+ 	asm __volatile__ (
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// When compiled with optimizations the stack unwind doesn't work properly, 
+ 		// causing exceptions to crash the application. By adding this prologue
+ 		// and the epilogue below, the stack unwind works as it should. 
+@@ -767,7 +767,7 @@ endcopy:
+ 		// Pop the alignment bytes
+ 		"popl  %%esp            \n"
+ 		"popl  %%ebx            \n"
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// Epilogue
+ 		"movl %%ebp, %%esp         \n"
+ 		".cfi_def_cfa_register esp \n"
+@@ -849,7 +849,7 @@ endcopy:
+ 	volatile asPWORD a[] = {asPWORD(args), asPWORD(paramSize), asPWORD(func), asPWORD(retPtr)};
+ 
+ 	asm __volatile__ (
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// When compiled with optimizations the stack unwind doesn't work properly, 
+ 		// causing exceptions to crash the application. By adding this prologue
+ 		// and the epilogue below, the stack unwind works as it should. 
+@@ -896,7 +896,7 @@ endcopy:
+ 		// Pop the alignment bytes
+ 		"popl  %%esp            \n"
+ 		"popl  %%ebx            \n"
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// Epilogue
+ 		"movl %%ebp, %%esp         \n"
+ 		".cfi_def_cfa_register esp \n"
+@@ -980,7 +980,7 @@ endcopy:
+ 	volatile asPWORD a[] = {asPWORD(obj), asPWORD(args), asPWORD(paramSize), asPWORD(func), asPWORD(retPtr)};
+ 
+ 	asm __volatile__ (
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// When compiled with optimizations the stack unwind doesn't work properly, 
+ 		// causing exceptions to crash the application. By adding this prologue
+ 		// and the epilogue below, the stack unwind works as it should. 
+@@ -1030,7 +1030,7 @@ endcopy:
+ 		// Pop the alignment bytes
+ 		"popl  %%esp            \n"
+ 		"popl  %%ebx            \n"
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// Epilogue
+ 		"movl %%ebp, %%esp         \n"
+ 		".cfi_def_cfa_register esp \n"
+@@ -1102,7 +1102,7 @@ endcopy:
+ 	volatile asPWORD a[] = {asPWORD(args), asPWORD(paramSize), asPWORD(func)};
+ 
+ 	asm __volatile__ (
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// When compiled with optimizations the stack unwind doesn't work properly, 
+ 		// causing exceptions to crash the application. By adding this prologue
+ 		// and the epilogue below, the stack unwind works as it should. 
+@@ -1145,7 +1145,7 @@ endcopy:
+ 		// Pop the alignment bytes
+ 		"popl  %%esp            \n"
+ 		"popl  %%ebx            \n"
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// Epilogue
+ 		"movl %%ebp, %%esp         \n"
+ 		".cfi_def_cfa_register esp \n"
+@@ -1233,7 +1233,7 @@ endcopy:
+ 	volatile asPWORD a[] = {asPWORD(obj), asPWORD(args), asPWORD(paramSize), asPWORD(func)};
+ 
+ 	asm __volatile__ (
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// When compiled with optimizations the stack unwind doesn't work properly, 
+ 		// causing exceptions to crash the application. By adding this prologue
+ 		// and the epilogue below, the stack unwind works as it should. 
+@@ -1285,7 +1285,7 @@ endcopy:
+ 		// Pop the alignment bytes
+ 		"popl  %%esp            \n"
+ 		"popl  %%ebx            \n"
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// Epilogue
+ 		"movl %%ebp, %%esp         \n"
+ 		".cfi_def_cfa_register esp \n"
+@@ -1380,7 +1380,7 @@ endcopy:
+ 	volatile asPWORD a[] = {asPWORD(obj), asPWORD(args), asPWORD(paramSize), asPWORD(func), asPWORD(retPtr)};
+ 
+ 	asm __volatile__ (
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// When compiled with optimizations the stack unwind doesn't work properly, 
+ 		// causing exceptions to crash the application. By adding this prologue
+ 		// and the epilogue below, the stack unwind works as it should. 
+@@ -1445,7 +1445,7 @@ endcopy:
+ 		// Pop the alignment bytes
+ 		"popl  %%esp           \n"
+ 		"popl  %%ebx           \n"
+-#ifdef __OPTIMIZE__
++#if defined(__OPTIMIZE__) && !defined(__clang__)
+ 		// Epilogue
+ 		"movl %%ebp, %%esp         \n"
+ 		".cfi_def_cfa_register esp \n"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709052349.v85NnkMx028075>