|
Tomas Bzatek |
351c1b |
From ddfb3ba036f9df2737c165b27f9b458dd83a7df8 Mon Sep 17 00:00:00 2001
|
|
Tomas Bzatek |
351c1b |
From: Tomas Bzatek <tbzatek@redhat.com>
|
|
Tomas Bzatek |
351c1b |
Date: Tue, 31 Jan 2023 23:27:53 +0100
|
|
Tomas Bzatek |
351c1b |
Subject: [PATCH 2/2] build: Fix nss code snippet includes
|
|
Tomas Bzatek |
351c1b |
|
|
Tomas Bzatek |
351c1b |
With hardened distribution CFLAGS the meson code snippet wouldn't compile:
|
|
Tomas Bzatek |
351c1b |
|
|
Tomas Bzatek |
351c1b |
Compiler stderr:
|
|
Tomas Bzatek |
351c1b |
.build/meson-private/tmpy2z1t5q4/testfile.c: In function 'main':
|
|
Tomas Bzatek |
351c1b |
.build/meson-private/tmpy2z1t5q4/testfile.c:2:30: error: storage size of 'hints' isn't known
|
|
Tomas Bzatek |
351c1b |
2 | struct addrinfo hints, *result;
|
|
Tomas Bzatek |
351c1b |
| ^~~~~
|
|
Tomas Bzatek |
351c1b |
.build/meson-private/tmpy2z1t5q4/testfile.c:3:21: warning: implicit declaration of function 'getaddrinfo' [-Wimplicit-function-declaration]
|
|
Tomas Bzatek |
351c1b |
3 | return getaddrinfo(argv[1], argv[2], &hints, &result);
|
|
Tomas Bzatek |
351c1b |
| ^~~~~~~~~~~
|
|
Tomas Bzatek |
351c1b |
---
|
|
Tomas Bzatek |
351c1b |
meson.build | 5 ++++-
|
|
Tomas Bzatek |
351c1b |
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
Tomas Bzatek |
351c1b |
|
|
Tomas Bzatek |
351c1b |
diff --git a/meson.build b/meson.build
|
|
Tomas Bzatek |
351c1b |
index d389cbf..cf72d6d 100644
|
|
Tomas Bzatek |
351c1b |
--- a/meson.build
|
|
Tomas Bzatek |
351c1b |
+++ b/meson.build
|
|
Tomas Bzatek |
351c1b |
@@ -199,7 +199,10 @@ conf.set10(
|
|
Tomas Bzatek |
351c1b |
conf.set(
|
|
Tomas Bzatek |
351c1b |
'HAVE_LIBNSS',
|
|
Tomas Bzatek |
351c1b |
cc.links(
|
|
Tomas Bzatek |
351c1b |
- '''int main(int argc, char **argv) {
|
|
Tomas Bzatek |
351c1b |
+ '''#include <sys/types.h>
|
|
Tomas Bzatek |
351c1b |
+ #include <sys/socket.h>
|
|
Tomas Bzatek |
351c1b |
+ #include <netdb.h>
|
|
Tomas Bzatek |
351c1b |
+ int main(int argc, char **argv) {
|
|
Tomas Bzatek |
351c1b |
struct addrinfo hints, *result;
|
|
Tomas Bzatek |
351c1b |
return getaddrinfo(argv[1], argv[2], &hints, &result);
|
|
Tomas Bzatek |
351c1b |
}
|
|
Tomas Bzatek |
351c1b |
--
|
|
Tomas Bzatek |
351c1b |
2.39.0
|
|
Tomas Bzatek |
351c1b |
|