Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jan 2017 18:22:31 +0000 (UTC)
From:      Matthias Andree <mandree@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r432640 - head/graphics/rawtherapee-devel
Message-ID:  <201701281822.v0SIMVBZ015612@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mandree
Date: Sat Jan 28 18:22:31 2017
New Revision: 432640
URL: https://svnweb.freebsd.org/changeset/ports/432640

Log:
  Fix i386 SSE2 crashes (use clang), and clean up a bit.
  
  GCC 5.4 also does not get the stack properly aligned in i386 for SSE2
  and causes SIGBUS on startup when trying to access an 8-byte aligned
  double[8] array with SIMD instructions.[1] One workaround would be to use
  -mstackrealign, the other is to use clang - we don't get OpenMP on i386
  anyhow.
  
  Move DISTVERSIONSUFFIX up to appease portlint.
  
  Drop -fexpensive-optimizations, clang does not support it, and gcc 5.4
  includes it in -O2 and -O3.
  
  Note that the upstream discourages the use of 32-bit architectures for
  rawtherapee.
  
  Reported by:	pkg-fallout@ [1]

Modified:
  head/graphics/rawtherapee-devel/Makefile

Modified: head/graphics/rawtherapee-devel/Makefile
==============================================================================
--- head/graphics/rawtherapee-devel/Makefile	Sat Jan 28 18:15:23 2017	(r432639)
+++ head/graphics/rawtherapee-devel/Makefile	Sat Jan 28 18:22:31 2017	(r432640)
@@ -3,10 +3,10 @@
 
 PORTNAME=	rawtherapee
 PORTVERSION=	5.0
+DISTVERSIONSUFFIX=	-gtk3
 PORTREVISION=	0
 CATEGORIES=	graphics
 MASTER_SITES=	http://rawtherapee.com/shared/source/
-DISTVERSIONSUFFIX=	-gtk3
 PKGNAMESUFFIX=	-devel
 
 MAINTAINER=	mandree@FreeBSD.org
@@ -27,7 +27,7 @@ LIB_DEPENDS=	libcanberra-gtk.so:audio/li
 		libsigc-2.0.so:devel/libsigc++20 \
 		libtiff.so:graphics/tiff
 
-USES=		cmake:outsource compiler:gcc-c++11-lib desktop-file-utils dos2unix \
+USES=		cmake:outsource desktop-file-utils dos2unix \
 		jpeg localbase:ldflags pkgconfig tar:xz
 DOS2UNIX_REGEX=	.*\.(cc|h)
 LDFLAGS+=	-Wl,--as-needed # fontconfig, freetype, gettext, libX11
@@ -68,9 +68,8 @@ NATIVE_DESC=		Use -march=native for comp
 
 OPENMP_CMAKE_BOOL=	OPTION_OMP
 
-OPTIMIZED_CFLAGS_CFLAGS=	-O3 -funroll-loops -msse2 \
-			${OPTIMIZED_CFLAGS_CFLAGS_${CHOSEN_COMPILER_TYPE}}
-OPTIMIZED_CFLAGS_CFLAGS_gcc=	-fexpensive-optimizations
+OPTIMIZED_CFLAGS_CFLAGS=	-O3 -funroll-loops -msse2
+# GCC 5.4 includes -fexpensive-optimizations in -O2 already
 
 .include <bsd.port.options.mk>
 
@@ -92,14 +91,27 @@ CMAKE_BUILD_TYPE=	RelWithDebInfo
 STRIP=
 .endif
 
+.if ${ARCH} == i386
+USES+=		compiler:c++11-lib
+# FIXME: if we were to use GCC on i386, we'd need to use -mstackrealign
+# or similar options, else we get SIGBUS when SSE2 is enabled due to
+# improper alignment. Base clang is good enough though, i386 does not
+# support OpenMP, and those seeking ultimate performance need to use
+# amd64.
+.else
+USES+=		compiler:gcc-c++11-lib
+.endif
+
 # -------------------------------------------------------------------
 
 .include <bsd.port.pre.mk>
 
+.if ${CHOSEN_COMPILER_TYPE} == gcc
 # Workaround: this needs to be late because Mk/Uses/compiler.mk tramples
 # over previously set values with gcc-libc++-configure as of r432539.
 # GCC 4.9 doesn't generate usable code on FreeBSD 11.0.
 USE_GCC=	5+
+.endif
 
 post-patch:
 	@${REINPLACE_CMD} -e 's#DESTINATION "$${CMAKE_INSTALL_PREFIX}/share/man/man1"#DESTINATION "${MANPREFIX}/man/man1/"#' \



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