summaryrefslogtreecommitdiff
path: root/sys-libs/libnvme/files/libnvme-1.3-configure-clang-16.patch
blob: b7954a996272c65026466c60ca51431acc9914fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
https://github.com/linux-nvme/libnvme/commit/ddfb3ba036f9df2737c165b27f9b458dd83a7df8

From ddfb3ba036f9df2737c165b27f9b458dd83a7df8 Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Tue, 31 Jan 2023 23:27:53 +0100
Subject: [PATCH] build: Fix nss code snippet includes

With hardened distribution CFLAGS the meson code snippet wouldn't compile:

Compiler stderr:
  .build/meson-private/tmpy2z1t5q4/testfile.c: In function 'main':
  .build/meson-private/tmpy2z1t5q4/testfile.c:2:30: error: storage size of 'hints' isn't known
      2 |              struct addrinfo hints, *result;
        |                              ^~~~~
  .build/meson-private/tmpy2z1t5q4/testfile.c:3:21: warning: implicit declaration of function 'getaddrinfo' [-Wimplicit-function-declaration]
      3 |              return getaddrinfo(argv[1], argv[2], &hints, &result);
        |                     ^~~~~~~~~~~
--- a/meson.build
+++ b/meson.build
@@ -199,7 +199,10 @@ conf.set10(
 conf.set(
     'HAVE_LIBNSS',
     cc.links(
-      '''int main(int argc, char **argv) {
+      '''#include <sys/types.h>
+         #include <sys/socket.h>
+         #include <netdb.h>
+         int main(int argc, char **argv) {
              struct addrinfo hints, *result;
              return getaddrinfo(argv[1], argv[2], &hints, &result);
       }