From owner-freebsd-net@FreeBSD.ORG Sun Mar 1 16:18:30 2009 Return-Path: Delivered-To: net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04DEB1065693 for ; Sun, 1 Mar 2009 16:18:30 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 993418FC08 for ; Sun, 1 Mar 2009 16:18:29 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id E07901CCED; Sun, 1 Mar 2009 17:18:27 +0100 (CET) Date: Sun, 1 Mar 2009 17:18:27 +0100 From: Ed Schouten To: net@FreeBSD.org Message-ID: <20090301161827.GR19161@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rfCqmLcWnxF2yz6F" Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Cc: Subject: Making Netgraph compile with LLVM X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2009 16:18:30 -0000 --rfCqmLcWnxF2yz6F Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello all, It turns out Netgraph uses a language construct that is only allowed with GCC, but not with LLVM. According to the specs, LLVM's behaviour is correct. It is not allowed to do this: struct a { struct { int i; char j[]; } b; char k[20]; }; error: variable sized type 'b' must be at end of struct or class Diane Bruce and I thought this patch should solve this issue: http://80386.nl/pub/ng.diff Yes, I know, the solution isn't really elegant, but I think this is the only way to do this safely. Diane and I also compared the output of objdump and they seem to be equivalent, except for some reordering. Objections before I commit this to SVN? --=20 Ed Schouten WWW: http://80386.nl/ --rfCqmLcWnxF2yz6F Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEUEARECAAYFAkmqtVMACgkQ52SDGA2eCwUXrgCeKX/bFUEP/k9paOHIgvxZzAzf 7PUAmKI4TJo4XEvffV3oqoIDbpQIl5E= =Tp28 -----END PGP SIGNATURE----- --rfCqmLcWnxF2yz6F--