From delphij@FreeBSD.org  Tue Jul 28 01:02:28 2009
Return-Path: <delphij@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1AB71106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 28 Jul 2009 01:02:28 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id 090898FC1C;
	Tue, 28 Jul 2009 01:02:28 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from freefall.freebsd.org (delphij@localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n6S12R2k067716;
	Tue, 28 Jul 2009 01:02:27 GMT
	(envelope-from delphij@freefall.freebsd.org)
Received: (from delphij@localhost)
	by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n6S12RHV067715;
	Tue, 28 Jul 2009 01:02:27 GMT
	(envelope-from delphij)
Message-Id: <200907280102.n6S12RHV067715@freefall.freebsd.org>
Date: Tue, 28 Jul 2009 01:02:27 GMT
From: Xin LI <delphij@freebsd.org>
Reply-To: Xin LI <delphij@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: sten@blinkenlights.nl
Subject: [PATCH] [UNBREAK] unbreak net/ladvd on FreeBSD/amd64
X-Send-Pr-Version: 3.113
X-GNATS-Notify: sten@blinkenlights.nl

>Number:         137195
>Category:       ports
>Synopsis:       [PATCH] [UNBREAK] unbreak net/ladvd on FreeBSD/amd64
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    delphij
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 28 01:10:00 UTC 2009
>Closed-Date:    Wed Jul 29 05:59:12 UTC 2009
>Last-Modified:  Wed Jul 29 05:59:12 UTC 2009
>Originator:     Xin LI
>Release:        FreeBSD 7.2-STABLE i386
>Organization:
The FreeBSD Project
>Environment:
System: FreeBSD freefall.freebsd.org 7.2-STABLE FreeBSD 7.2-STABLE #38 r194101: Sat Jun 13 11:12:24 UTC 2009 simon@freefall.freebsd.org:/usr/src/sys/i386/compile/FREEFALL i386


>Description:
	ladvd's configure script seems to be unable to detect the
platform correctly, i.e. it uses the Linux-ish x86_64 instead of
the FreeBSD style 'amd64' naming.
>How-To-Repeat:
	build ladvd on FreeBSD/amd64.
>Fix:


--- ladvd-amd64.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/ladvd/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- Makefile	23 Jun 2009 20:09:31 -0000	1.3
+++ Makefile	28 Jul 2009 00:59:09 -0000
@@ -15,7 +15,7 @@ COMMENT=	A minimal CDP/LLDP sender
 
 LIB_DEPENDS=	event-1.4:${PORTSDIR}/devel/libevent
 
-ONLY_FOR_ARCHS=	i386
+ONLY_FOR_ARCHS=	i386 amd64
 
 GNU_CONFIGURE=	yes
 
Index: files/patch-configure
===================================================================
RCS file: files/patch-configure
diff -N files/patch-configure
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-configure	28 Jul 2009 00:58:13 -0000
@@ -0,0 +1,11 @@
+--- configure.orig	2009-06-21 12:44:00.000000000 -0700
++++ configure	2009-07-27 17:57:55.304858737 -0700
+@@ -20063,7 +20063,7 @@
+ 	;;
+     freebsd*)
+ 	case "$target" in
+-	    x86_64-*-freebsd7.*)
++	    amd64-*-freebsd*)
+ 		use_pie=no
+ 	esac
+ 
--- ladvd-amd64.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->delphij 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Jul 28 01:10:11 UTC 2009 
Responsible-Changed-Why:  
Submitter has GNATS access (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137195 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Tue Jul 28 01:10:17 UTC 2009 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137195 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: sten@blinkenlights.nl
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/137195: [PATCH] [UNBREAK] unbreak net/ladvd on FreeBSD/amd64
Date: Tue, 28 Jul 2009 01:10:13 UT

 Maintainer of net/ladvd,
 
 Please note that PR ports/137195 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/137195
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: Sten Spans <sten@blinkenlights.nl>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/137195: [PATCH] [UNBREAK] unbreak net/ladvd on
 FreeBSD/amd64
Date: Tue, 28 Jul 2009 07:59:36 +0200 (CEST)

 On Tue, 28 Jul 2009, Edwin Groothuis wrote:
 
 > Maintainer of net/ladvd,
 >
 > Please note that PR ports/137195 has just been submitted.
 >
 
 Upstream has a slightly different patch which disables PIE
 completely on FreeBSD. The code itself has been tested on
 arm / sparc / vax / amd64 and should be fine. Its the compiler
 flags which cause it to break on certain FreeBSD platforms.
 
 I'd like to propose the following diff which backports the PIE
 related configure changes from upstream, and fixes some lagg ioctl's:
 And as a bonus fixes the other open ladvd pr.
 
 --- Makefile.orig	2009-07-28 07:54:50.000000000 +0200
 +++ Makefile	2009-07-28 07:57:45.000000000 +0200
 @@ -7,6 +7,7 @@
 
   PORTNAME=	ladvd
   PORTVERSION=	0.8
 +PORTREVISION=	1
   CATEGORIES=	net
   MASTER_SITES=	http://blinkenlights.nl/software/ladvd/
 
 @@ -15,9 +16,8 @@
 
   LIB_DEPENDS=	event-1.4:${PORTSDIR}/devel/libevent
 
 -ONLY_FOR_ARCHS=	i386
 -
   GNU_CONFIGURE=	yes
 +CONFIGURE_ARGS=	--with-chroot-dir=/var/empty
 
   PORTDOCS=	*
   MAN8=		ladvd.8
 diff -N files/patch-backport
 --- /dev/null	1 Jan 1970 00:00:00 -0000
 +++ files/patch-backport	28 Jul 2009 00:58:13 -0000
 @@ -0,0 +1,83 @@
 +--- src/netif.c	2009-06-21 21:36:07.000000000 +0200
 ++++ src/netif.c	2009-07-24 07:53:48.000000000 +0200
 +@@ -399,6 +403,12 @@
 +     memset(&drvinfo, 0, sizeof(drvinfo));
 + #endif
 + 
 ++#ifdef HAVE_NET_IF_LAGG_H
 ++    struct lagg_reqall ra;
 ++#elif HAVE_NET_IF_TRUNK_H
 ++    struct trunk_reqall ra;
 ++#endif
 ++
 + #ifdef HAVE_SYSFS
 +     if (snprintf(path, SYSFS_PATH_MAX,
 + 	    SYSFS_CLASS_NET "/%s/device", ifaddr->ifa_name) > 0) {
 +@@ -442,13 +452,17 @@
 +     if (if_data->ifi_type == IFT_ETHER) {
 + 
 + 	// bonding
 ++#if defined(HAVE_NET_IF_LAGG_H) || defined(HAVE_NET_IF_TRUNK_H)
 ++	memset(&ra, 0, sizeof(ra));
 ++	strlcpy(ra.ra_ifname, ifaddr->ifa_name, sizeof(ra.ra_ifname));
 + #ifdef HAVE_NET_IF_LAGG_H
 +-	if (ioctl(sockfd, SIOCGLAGG, (caddr_t)ifr) >= 0)
 ++	if (ioctl(sockfd, SIOCGLAGG, &ra) >= 0)
 + 	    return(NETIF_BONDING);
 + #elif HAVE_NET_IF_TRUNK_H
 +-	if (ioctl(sockfd, SIOCGTRUNK, (caddr_t)ifr) == 0)
 ++	if (ioctl(sockfd, SIOCGTRUNK, &ra) == 0)
 + 	    return(NETIF_BONDING);
 + #endif
 ++#endif
 + 
 + 	// accept regular devices
 + 	return(NETIF_REGULAR);
 +@@ -459,8 +473,9 @@
 + 	return(NETIF_BRIDGE);
 + #endif
 + #ifdef IFT_IEEE8023ADLAG
 ++    // trunk ports have a special type
 +     } else if (if_data->ifi_type == IFT_IEEE8023ADLAG) {
 +-	return(NETIF_BONDING);
 ++	return(NETIF_REGULAR);
 + #endif
 +     }
 + 
 +@@ -618,7 +633,7 @@
 + 	    my_log(INFO, "found slave %s", subif->name);
 + 	    subif->slave = 1;
 + 	    subif->master = master;
 +-	    subif->lacp_index = i++;
 ++	    subif->lacp_index = i;
 + 	    csubif->subif = subif;
 + 	    csubif = subif;
 + 	}
 +--- configure.orig	2009-06-21 21:44:00.000000000 +0200
 ++++ configure	2009-07-28 07:42:56.000000000 +0200
 +@@ -20062,15 +20062,12 @@
 + 
 + 	;;
 +     freebsd*)
 +-	case "$target" in
 +-	    x86_64-*-freebsd7.*)
 +-		use_pie=no
 +-	esac
 + 
 + cat >>confdefs.h <<\_ACEOF
 + #define TARGET_IS_FREEBSD 1
 + _ACEOF
 + 
 ++	use_pie=no
 + 	;;
 +     openbsd*)
 + 
 +@@ -20479,7 +20476,7 @@
 + { echo "$as_me:$LINENO: result: $ssp_cv_cc" >&5
 + echo "${ECHO_T}$ssp_cv_cc" >&6; }
 +     if test $ssp_cv_cc = yes; then
 +-      WFLAGS="$WFLAGS -fstack-protector"
 ++      WCFLAGS="$WCFLAGS -fstack-protector"
 + 
 + cat >>confdefs.h <<\_ACEOF
 + #define ENABLE_SSP_CC 1
 
 -- 
 Sten Spans
 
 "There is a crack in everything, that's how the light gets in."
 Leonard Cohen - Anthem
State-Changed-From-To: feedback->closed 
State-Changed-By: delphij 
State-Changed-When: Wed Jul 29 05:58:56 UTC 2009 
State-Changed-Why:  
Maintainer patch applied. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137195 
>Unformatted:
