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:

committed by
Todd Gamblin

parent
0dad5b3ee5
commit
1b53e82348
@@ -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'
|
||||
|
15
var/spack/repos/builtin/packages/bison/secure_snprintf.patch
Normal file
15
var/spack/repos/builtin/packages/bison/secure_snprintf.patch
Normal 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';
|
Reference in New Issue
Block a user