libbsd: fixes for %nvhpc (#29848)

This commit is contained in:
Harmen Stoppels 2022-04-13 11:24:02 +02:00 committed by GitHub
parent 6a8aa59717
commit cb56e9b745
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 71 deletions

View File

@ -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>

View File

@ -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:')

View File

@ -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

View File

@ -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')