diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2022-04-13 11:24:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-13 11:24:02 +0200 |
commit | cb56e9b74532f5a0d1a95b8f4671628802cd6a51 (patch) | |
tree | 921cf61124eae25b0a6b1b9651fb19b546086a0d | |
parent | 6a8aa597170bc8730aed4306eabe1d2e37759e47 (diff) | |
download | spack-cb56e9b74532f5a0d1a95b8f4671628802cd6a51.tar.gz spack-cb56e9b74532f5a0d1a95b8f4671628802cd6a51.tar.bz2 spack-cb56e9b74532f5a0d1a95b8f4671628802cd6a51.tar.xz spack-cb56e9b74532f5a0d1a95b8f4671628802cd6a51.zip |
libbsd: fixes for %nvhpc (#29848)
4 files changed, 34 insertions, 71 deletions
diff --git a/var/spack/repos/builtin/packages/libbsd/nvhpc.patch b/var/spack/repos/builtin/packages/libbsd/nvhpc.patch deleted file mode 100644 index fd380fd29a..0000000000 --- a/var/spack/repos/builtin/packages/libbsd/nvhpc.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- a/src/fgetln.c 2020-08-07 09:17:09.456951858 -0700 -+++ b/src/fgetln.c 2020-08-07 09:16:12.471731317 -0700 -@@ -25,6 +25,7 @@ - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -+#include "config.h" - #include <stdio.h> - #include <sys/cdefs.h> - #include <sys/types.h> ---- a/src/fpurge.c 2020-08-07 09:17:00.871918633 -0700 -+++ b/src/fpurge.c 2020-08-07 09:15:55.436665389 -0700 -@@ -24,6 +24,7 @@ - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -+#include "config.h" - #include <errno.h> - #include <stdio.h> - #include <stdio_ext.h> ---- a/src/funopen.c 2020-08-07 09:16:52.566886490 -0700 -+++ b/src/funopen.c 2020-08-07 09:17:25.206012812 -0700 -@@ -24,6 +24,7 @@ - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -+#include "config.h" - #include <sys/cdefs.h> - #include <sys/types.h> - #include <errno.h> ---- a/src/getpeereid.c 2020-08-07 09:25:13.822834376 -0700 -+++ b/src/getpeereid.c 2020-08-07 09:25:27.802889361 -0700 -@@ -24,6 +24,7 @@ - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -+#include "config.h" - #include <sys/cdefs.h> - - #include <sys/param.h> ---- a/src/progname.c 2020-08-07 09:23:02.168316940 -0700 -+++ b/src/progname.c 2020-08-07 09:23:09.840346776 -0700 -@@ -30,6 +30,7 @@ - * <https://sourceware.org/ml/libc-alpha/2006-03/msg00125.html>. - */ - -+#include "config.h" - #include <errno.h> - #include <string.h> - #include <stdlib.h> ---- a/src/setproctitle.c 2020-08-07 09:21:49.003033771 -0700 -+++ b/src/setproctitle.c 2020-08-07 09:22:09.161111787 -0700 -@@ -22,6 +22,7 @@ - * USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -+#include "config.h" - #include <errno.h> - #include <stddef.h> - #include <stdarg.h> diff --git a/var/spack/repos/builtin/packages/libbsd/package.py b/var/spack/repos/builtin/packages/libbsd/package.py index ecd167b21b..b88c366e35 100644 --- a/var/spack/repos/builtin/packages/libbsd/package.py +++ b/var/spack/repos/builtin/packages/libbsd/package.py @@ -32,19 +32,11 @@ class Libbsd(AutotoolsPackage): patch('cdefs.h.patch', when='@0.8.6 %gcc@:4') patch('local-elf.h.patch', when='@:0.10 %intel') - patch('nvhpc.patch', when='%nvhpc') # https://gitlab.freedesktop.org/libbsd/libbsd/issues/1 conflicts('platform=darwin') - depends_on('libmd', when='@0.11:') + # install hook calls compilers with -nostdlib + conflicts('@0.11.4: %nvhpc') - def patch(self): - # Remove flags not recognized by the NVIDIA compiler - if self.spec.satisfies('%pgi') or self.spec.satisfies('%nvhpc'): - filter_file('-isystem', '-I', 'src/Makefile.in') - # This is not a 1 for 1 replacement, requiring nvhpc.patch - # to include config.h where needed - filter_file('-include ', '-I ', 'src/Makefile.in') - filter_file('-Wall -Wextra -Wno-unused-variable ' - '-Wno-unused-parameter', '-Wall', 'configure') + depends_on('libmd', when='@0.11:') diff --git a/var/spack/repos/builtin/packages/libmd/nvhpc-aliases.patch b/var/spack/repos/builtin/packages/libmd/nvhpc-aliases.patch new file mode 100644 index 0000000000..bd84f5180e --- /dev/null +++ b/var/spack/repos/builtin/packages/libmd/nvhpc-aliases.patch @@ -0,0 +1,28 @@ +From 62be7d51eed4294541f70c2022c7f0ba3868e2e7 Mon Sep 17 00:00:00 2001 +From: Harmen Stoppels <harmenstoppels@gmail.com> +Date: Sat, 2 Apr 2022 23:20:32 +0200 +Subject: [PATCH] nvhpc doesn't support __attribute__ __alias + +--- + src/local-link.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/local-link.h b/src/local-link.h +index 7560c4f..e8906b9 100644 +--- a/src/local-link.h ++++ b/src/local-link.h +@@ -40,9 +40,11 @@ + * maintainable. + */ + #ifndef _MSC_VER ++#ifndef __NVCOMPILER + #define libmd_alias(alias, symbol) \ + extern __typeof(symbol) alias __attribute__((__alias__(#symbol))) + #endif ++#endif + + #ifdef __ELF__ + #define libmd_symver_default(alias, symbol, version) \ +-- +2.25.1 + diff --git a/var/spack/repos/builtin/packages/libmd/package.py b/var/spack/repos/builtin/packages/libmd/package.py index 6e15ae44a6..bc64502df4 100644 --- a/var/spack/repos/builtin/packages/libmd/package.py +++ b/var/spack/repos/builtin/packages/libmd/package.py @@ -21,3 +21,6 @@ class Libmd(AutotoolsPackage): version('1.0.2', sha256='dc66b8278f82e7e1bf774fbd4bc83a0348e8f27afa185b2c2779cfcb3da25013') version('1.0.1', sha256='e14eeb931cf85330f95ff822262d3033125488dfb2f867441e36e2d2c4a34c71') version('1.0.0', sha256='f21aea69f6411cb4307cda1f6378c7ed07830202b5f4cb9e64f681fdaf2d64c7') + + # Use wrapper functions instead of __attribute__ __alias__ + patch('nvhpc-aliases.patch', when='%nvhpc') |