Skip to content

Commit

Permalink
net/aoe: fix build on non-x86
Browse files Browse the repository at this point in the history
While we are at it:

 - remove BROKEN_... lines for FreeBSD versions out of support
 - drop homegrown do-install in favour of USES=uidfix
 - install kernel module into standard location
 - attempt to fix the build on FreeBSD 13

Still doesn't work on FreeBSD 13.2.  While it builds, the code now
fails at runtime, apparently when it tries to dereference vnet_entry_ifnet
in the line

    IFNET_FOREACH(ifp)

in aoenet_xmitbcast.

PR:		239891
  • Loading branch information
chadf authored and clausecker committed Sep 10, 2023
1 parent 1a08f9f commit 20f0525
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 155 deletions.
21 changes: 9 additions & 12 deletions net/aoe/Makefile
@@ -1,6 +1,6 @@
PORTNAME= aoe
PORTVERSION= 1.2.0
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= net
MASTER_SITES= https://people.freebsd.org/~sson/aoe/
DISTNAME= ${PORTNAME}-freebsd-${PORTVERSION}
Expand All @@ -11,22 +11,19 @@ WWW= http://www.coraid.com/support/freebsd/

LICENSE= BSD2CLAUSE

BROKEN_aarch64= fails to compile: redefinition of frame
BROKEN_armv6= fails to compile: implicit declaration of function 'cp15_pmccntr_get' is invalid in C99
BROKEN_armv7= fails to compile: redefinition of frame
BROKEN_sparc64= fails to compile: redefinition of frame
BROKEN_FreeBSD_13= use of undeclared identifier 'ifnet'
BROKEN_FreeBSD_14= use of undeclared identifier 'ifnet'
BROKEN_FreeBSD_13= crashes dereferencing vnet_entry_ifnet
BROKEN_FreeBSD_14= crashes dereferencing vnet_entry_ifnet

USES= kmod
USES= kmod uidfix
USE_RC_SUBR= aoe

WRKSRC= ${WRKDIR}/dev/aoe
KMODDIR= ${PREFIX}/lib/aoe

USE_RC_SUBR= aoe
PLIST_FILES= share/man/man4/aoe.4.gz \
${KMODDIR}/aoe.ko

do-install:
${INSTALL_KLD} ${WRKSRC}/aoe.ko ${STAGEDIR}${PREFIX}/lib/aoe
${INSTALL_MAN} ${WRKDIR}/aoe.4 ${STAGEDIR}${PREFIX}/man/man4/
post-install:
${INSTALL_MAN} ${WRKDIR}/aoe.4 ${STAGEDIR}${PREFIX}/share/man/man4/

.include <bsd.port.mk>
1 change: 0 additions & 1 deletion net/aoe/files/aoe.in
Expand Up @@ -22,7 +22,6 @@ aoe_start()
fi
sysctl net.aoe > /dev/null 2>&1
if [ $? -eq 1 ]; then
kldconfig -mf %%PREFIX%%/lib/aoe
kldload aoe > /dev/null 2>&1
fi
if [ $? -eq 0 ]; then
Expand Down
10 changes: 10 additions & 0 deletions net/aoe/files/patch-aoe.h
@@ -0,0 +1,10 @@
--- aoe.h.orig 2023-09-05 13:45:55 UTC
+++ aoe.h
@@ -167,6 +167,7 @@ struct ifnet;
struct mbuf;
struct mtx;

+#define frame aoeframe
struct frame {
int f_tag;
int f_mlen;

0 comments on commit 20f0525

Please sign in to comment.