net/packetdrill: fix build on armv7, FreeBSD 12

- make a symbol new in FreeBSD 13 optional
 - mark a union as packed that will require unaligned access
 - define TEST_TARGET

Approved by:	portmgr (build fix blanket)
MFH:		2023Q4
This commit is contained in:
Robert Clausecker 2023-10-07 06:41:02 +02:00
parent 28587fb276
commit f6c3a40927
3 changed files with 25 additions and 4 deletions

View File

@ -8,8 +8,6 @@ WWW= https://github.com/freebsd-net/packetdrill
LICENSE= GPLv2
IGNORE_FreeBSD_12= does not build
USES= bison python:run uidfix
USE_GITHUB= yes
GH_ACCOUNT= freebsd-net
@ -24,12 +22,12 @@ OPTIONS_DEFINE= DOCS EXAMPLES
# XXX Static libraries with PIE are currently unsupported.
MAKE_ARGS+= WITHOUT_PIE=true
TEST_TARGET= tests
# 'MD5_Init' is deprecated on OpenSSL 3
CFLAGS+= -Wno-deprecated
pre-build:
cd ${WRKSRC} && ${LN} Makefile.FreeBSD Makefile
cd ${WRKSRC} && ${LN} -f Makefile.FreeBSD Makefile
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}

View File

@ -0,0 +1,12 @@
--- symbols_freebsd.c.orig 2023-10-07 04:37:59 UTC
+++ symbols_freebsd.c
@@ -406,7 +406,9 @@ struct int_symbol platform_symbols_table[] = {
{ TCP_NOOPT, "TCP_NOOPT" },
{ TCP_MD5SIG, "TCP_MD5SIG" },
{ TCP_INFO, "TCP_INFO" },
+#if defined(TCP_STATS)
{ TCP_STATS, "TCP_STATS" },
+#endif
#if defined(TCP_LOG)
{ TCP_LOG, "TCP_LOG" },
#endif

View File

@ -0,0 +1,11 @@
--- tcp_options.h.orig 2023-10-07 04:31:15 UTC
+++ tcp_options.h
@@ -166,7 +166,7 @@ struct tcp_option {
struct {
u8 data[MAX_TCP_OPTION_DATA_BYTES];
} generic;
- };
+ } __packed;
u32 flags; /* meta information, not going on the wire */
} __packed;