various fixes for macOS high sierra (#5647)

* various fixes for macOS high sierra

* add macOS_version() helper function

* flake8 fixes

* update oce and trilinos

* fix bison
This commit is contained in:
Denis Davydov
2017-10-12 20:41:57 +02:00
committed by Todd Gamblin
parent 0dad5b3ee5
commit 1b53e82348
7 changed files with 52 additions and 5 deletions

View File

@@ -23,6 +23,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
from spack.operating_systems.mac_os import macOS_version
import sys
class Bison(AutotoolsPackage):
@@ -40,4 +42,7 @@ class Bison(AutotoolsPackage):
patch('pgi.patch', when='@3.0.4')
if sys.platform == 'darwin' and macOS_version() >= Version('10.13'):
patch('secure_snprintf.patch', level=0, when='@3.0.4')
build_directory = 'spack-build'

View File

@@ -0,0 +1,15 @@
With format string strictness, High Sierra also enforces that %n isn't used
in dynamic format strings, but we should just disable its use on darwin in
general.
--- lib/vasnprintf.c.orig 2017-06-22 15:19:15.000000000 -0700
+++ lib/vasnprintf.c 2017-06-22 15:20:20.000000000 -0700
@@ -4869,7 +4869,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
#endif
*fbp = dp->conversion;
#if USE_SNPRINTF
-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
fbp[1] = '%';
fbp[2] = 'n';
fbp[3] = '\0';