findutils: ensure __nonnull is defined on macOS (#28316)

This commit is contained in:
Erik Schnetter 2022-01-17 04:14:39 -05:00 committed by GitHub
parent 20bccc3843
commit 350d2da8b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,11 @@
--- a/gl/lib/malloc/dynarray-skeleton.c
+++ b/gl/lib/malloc/dynarray-skeleton.c
@@ -85,6 +85,8 @@
(if DYNARRAY_FINAL_TYPE is not defined)
*/
#include <malloc/dynarray.h>
+#undef __nonnull
+#define __nonnull(x)
#include <errno.h>

View File

@ -51,6 +51,11 @@ def url_for_version(self, version):
patch('nvhpc.patch', when='@4.6.0 %nvhpc')
# Workaround bug where __LONG_WIDTH__ is not defined
patch('nvhpc-long-width.patch', when='@4.8.0:4.8 %nvhpc')
# Auto-detecting whether `__attribute__((__nonnull__(...)))` is supported
# does not work for GCC on macOS
# <https://savannah.gnu.org/bugs/?func=detailitem&item_id=59972>; we thus
# disable this attribute manually
patch('nonnull.patch')
build_directory = 'spack-build'