forked from freebsd/freebsd-ports
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lang/python3.11: backport netlink patch
this patch backports GH-107812: extend socket's netlink support to FreeBSD see python/cpython#107813 for the patch. see python/cpython#107812 for the discussion on the backport itself. Sponsored by: The FreeBSD Foundation
- Loading branch information
Showing
3 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- Modules/socketmodule.h.orig | ||
+++ Modules/socketmodule.h | ||
@@ -89,6 +89,8 @@ typedef int socklen_t; | ||
# include <asm/types.h> | ||
# endif | ||
# include <linux/netlink.h> | ||
+#elif defined(HAVE_NETLINK_NETLINK_H) | ||
+# include <netlink/netlink.h> | ||
#else | ||
# undef AF_NETLINK | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,41 @@ | ||
--- configure.orig 2022-12-07 13:31:07 UTC | ||
+++ configure | ||
@@ -7630,7 +7630,7 @@ if test "$Py_LTO" = 'true' ; then | ||
|
||
@@ -8336,7 +8336,7 @@ fi | ||
|
||
if test "$Py_LTO" = 'true' ; then | ||
case $CC in | ||
- *clang*) | ||
+ *clang*|cc) | ||
LDFLAGS_NOLTO="-fno-lto" | ||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -flto=thin" >&5 | ||
$as_echo_n "checking whether C compiler accepts -flto=thin... " >&6; } | ||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -flto=thin" >&5 | ||
printf %s "checking whether C compiler accepts -flto=thin... " >&6; } | ||
@@ -10629,6 +10629,7 @@ fi | ||
|
||
|
||
# On Linux, netlink.h requires asm/types.h | ||
+# On FreeBSD, netlink.h is located in netlink/netlink.h | ||
ac_fn_c_check_header_compile "$LINENO" "linux/netlink.h" "ac_cv_header_linux_netlink_h" " | ||
#ifdef HAVE_ASM_TYPES_H | ||
#include <asm/types.h> | ||
@@ -10643,6 +10644,20 @@ then : | ||
printf "%s\n" "#define HAVE_LINUX_NETLINK_H 1" >>confdefs.h | ||
|
||
fi | ||
+ac_fn_c_check_header_compile "$LINENO" "netlink/netlink.h" "ac_cv_header_netlink_netlink_h" " | ||
+#ifdef HAVE_ASM_TYPES_H | ||
+#include <asm/types.h> | ||
+#endif | ||
+#ifdef HAVE_SYS_SOCKET_H | ||
+#include <sys/socket.h> | ||
+#endif | ||
+ | ||
+" | ||
+if test "x$ac_cv_header_netlink_netlink_h" = xyes | ||
+then : | ||
+ printf "%s\n" "#define HAVE_NETLINK_NETLINK_H 1" >>confdefs.h | ||
+ | ||
+fi | ||
|
||
|
||
# On Linux, qrtr.h requires asm/types.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- pyconfig.h.in.orig | ||
+++ pyconfig.h.in | ||
@@ -835,6 +835,9 @@ | ||
/* Define to 1 if you have the <netinet/in.h> header file. */ | ||
#undef HAVE_NETINET_IN_H | ||
|
||
+/* Define to 1 if you have the <netlink/netlink.h> header file. */ | ||
+#undef HAVE_NETLINK_NETLINK_H | ||
+ | ||
/* Define to 1 if you have the <netpacket/packet.h> header file. */ | ||
#undef HAVE_NETPACKET_PACKET_H | ||
|