Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Mar 2014 12:06:38 +0000 (UTC)
From:      Brendan Fabeny <bf@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r346884 - in head/math/gsl: . files
Message-ID:  <201403031206.s23C6cl2091724@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bf
Date: Mon Mar  3 12:06:38 2014
New Revision: 346884
URL: http://svnweb.freebsd.org/changeset/ports/346884
QAT: https://qat.redports.org/buildarchive/r346884/

Log:
  Attempt to fix the build on powerpc* by the same means used on Darwin and GNU/Linux
  
  PR:		179857
  Submitted by:	jhibbits, nwhitehorn

Added:
  head/math/gsl/files/patch-ieee-utils-fp-freebsd.c   (contents, props changed)
Modified:
  head/math/gsl/Makefile

Modified: head/math/gsl/Makefile
==============================================================================
--- head/math/gsl/Makefile	Mon Mar  3 12:03:02 2014	(r346883)
+++ head/math/gsl/Makefile	Mon Mar  3 12:06:38 2014	(r346884)
@@ -30,10 +30,4 @@ check regression-test test: build
 	@cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${CORELIMIT} ${MAKE_CMD} \
 	${MAKE_ARGS} check
 
-.include <bsd.port.pre.mk>
-
-.if ${ARCH} == "powerpc"
-BROKEN=		Does not compile on powerpc
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>

Added: head/math/gsl/files/patch-ieee-utils-fp-freebsd.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/math/gsl/files/patch-ieee-utils-fp-freebsd.c	Mon Mar  3 12:06:38 2014	(r346884)
@@ -0,0 +1,66 @@
+--- ieee-utils/fp-freebsd.c.orig	2014-02-03 11:46:44.000000000 -0600
++++ ieee-utils/fp-freebsd.c	2014-02-03 11:46:18.000000000 -0600
+@@ -24,10 +24,28 @@
+ int
+ gsl_ieee_set_mode (int precision, int rounding, int exception_mask)
+ {
+-  fp_prec_t prec = 0 ;
+   fp_except_t mode = 0 ;
+   fp_rnd_t    rnd  = 0 ;
+ 
++#ifdef __powerpc__
++  switch (precision)
++    {
++    case GSL_IEEE_SINGLE_PRECISION:
++      GSL_ERROR ("powerpc only supports default precision rounding", GSL_EUNSUP)
++;
++      break ;
++    case GSL_IEEE_DOUBLE_PRECISION:
++      GSL_ERROR ("powerpc only supports default precision rounding", GSL_EUNSUP)
++;
++      break ;
++    case GSL_IEEE_EXTENDED_PRECISION:
++      GSL_ERROR ("powerpc only supports default precision rounding", GSL_EUNSUP)
++;
++      break ;
++    }
++#else
++  fp_prec_t prec = 0 ;
++
+   switch (precision)
+     {
+     case GSL_IEEE_SINGLE_PRECISION:
+@@ -43,6 +61,7 @@
+       fpsetprec(prec);
+       break ;
+     }
++#endif
+ 
+   switch (rounding)
+     {
+@@ -69,13 +88,23 @@
+ 
+   /* Turn on all the exceptions apart from 'inexact' */
+ 
+-  mode = FP_X_INV | FP_X_DNML | FP_X_DZ | FP_X_OFL | FP_X_UFL ;
++  mode = FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL ;
+ 
+   if (exception_mask & GSL_IEEE_MASK_INVALID)
+     mode &= ~ FP_X_INV ;
+ 
+   if (exception_mask & GSL_IEEE_MASK_DENORMALIZED)
+-    mode &= ~ FP_X_DNML ;
++    {
++      /* do nothing */
++    }
++  else
++    {
++#ifdef __powerpc__
++      GSL_ERROR ("powerpc does not support the denormalized operand exception. "                 "Use 'mask-denormalized' to work around this.", GSL_EUNSUP) ;
++#else
++      mode |= FP_X_DNML;
++#endif
++    }
+ 
+   if (exception_mask & GSL_IEEE_MASK_DIVISION_BY_ZERO)
+     mode &= ~ FP_X_DZ ;



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