summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorGeorge Hartzell <hartzell@alerce.com>2017-06-07 09:51:46 -0700
committerAdam J. Stewart <ajstewart426@gmail.com>2017-06-07 11:51:46 -0500
commit29090a527af34bcc9c5d5414ce8e61ac42d40bb0 (patch)
tree26fa056663640ebcaeff21e5e9fc35fbce5dd00b /var
parent8018f6cdf633306244a888266ab7bdaa7229c504 (diff)
downloadspack-29090a527af34bcc9c5d5414ce8e61ac42d40bb0.tar.gz
spack-29090a527af34bcc9c5d5414ce8e61ac42d40bb0.tar.bz2
spack-29090a527af34bcc9c5d5414ce8e61ac42d40bb0.tar.xz
spack-29090a527af34bcc9c5d5414ce8e61ac42d40bb0.zip
Bug/cctools syscall (#4440)
* Handle missing defn of __NR_memfd_create Generally SYS_foo is defined to __NR_foo (in sys/syscall.h) which is then defined to a syscall number (in asm/unistd_64.h). Certain CentOS systems have SYS_memfd_create defined to __NR_memfd_create but are missing the second definition. This is a belt and suspenders solution to the problem. See [this post][syscall] for a nice general description of how these parts fit together. [syscall]: https://www.uninformativ.de/blog/postings/2017-02-11/0/POSTING-en.html * Avoid flake8 warning
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/cctools/package.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/cctools/package.py b/var/spack/repos/builtin/packages/cctools/package.py
index 452df0d613..165d684a9f 100644
--- a/var/spack/repos/builtin/packages/cctools/package.py
+++ b/var/spack/repos/builtin/packages/cctools/package.py
@@ -44,6 +44,18 @@ class Cctools(AutotoolsPackage):
# depends_on('xrootd')
depends_on('zlib')
+ # Generally SYS_foo is defined to __NR_foo (sys/syscall.h) which
+ # is then defined to a syscall number (asm/unistd_64.h). Certain
+ # CentOS systems have SYS_memfd_create defined to
+ # __NR_memfd_create but are missing the second definition.
+ # This is a belt and suspenders solution to the problem.
+ def patch(self):
+ before = '#if defined(__linux__) && defined(SYS_memfd_create)'
+ after = '#if defined(__linux__) && defined(SYS_memfd_create) && defined(__NR_memfd_create)' # noqa: E501
+ f = 'dttools/src/memfdexe.c'
+ kwargs = {'ignore_absent': False, 'backup': True, 'string': True}
+ filter_file(before, after, f, **kwargs)
+
def configure_args(self):
args = []
# disable these bits