From root@neutron.lbl.gov  Mon Dec 26 00:06:16 2011
Return-Path: <root@neutron.lbl.gov>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A6BBD1065670
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Dec 2011 00:06:16 +0000 (UTC)
	(envelope-from root@neutron.lbl.gov)
Received: from neutron.lbl.gov (neutron.lbl.gov [131.243.70.40])
	by mx1.freebsd.org (Postfix) with ESMTP id 7C9378FC08
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Dec 2011 00:06:16 +0000 (UTC)
Received: from neutron.lbl.gov (neutron [127.0.0.1])
	by neutron.lbl.gov (8.14.5/8.14.5) with ESMTP id pBPNo57F025883
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 25 Dec 2011 15:50:10 -0800 (PST)
	(envelope-from root@neutron.lbl.gov)
Received: (from root@localhost)
	by neutron.lbl.gov (8.14.5/8.14.5/Submit) id pBPNo0Ur025858;
	Sun, 25 Dec 2011 15:50:00 -0800 (PST)
	(envelope-from root)
Message-Id: <201112252350.pBPNo0Ur025858@neutron.lbl.gov>
Date: Sun, 25 Dec 2011 15:50:00 -0800 (PST)
From: tplou@lbl.gov
Reply-To: tplou@lbl.gov
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: OFED failed to build with clang
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         163619
>Category:       kern
>Synopsis:       OFED failed to build with clang
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 26 00:10:10 UTC 2011
>Closed-Date:    Mon Dec 17 05:19:41 UTC 2012
>Last-Modified:  Mon Dec 17 05:19:41 UTC 2012
>Originator:     User
>Release:        FreeBSD 9.0-RC3 amd64
>Organization:
N/A
>Environment:
System: FreeBSD 9.0-RC3 FreeBSD 9.0-RC3 #0 r228312: Tue Dec 6 10:22:33 PST 2011 root@:/usr/obj/usr/src/sys/GENERIC amd64


>Description:
When try to build r228873 with WITH_OFED=YES, it fails with the following error:

@/sys/cdefs.h:148:23: note: expanded from:
...
#define __CONCAT(x,y)   x/**/y
                        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
3 warnings and 20 errors generated.
*** Error code 1
In file included from /usr/src/sys/modules/mlx4/../../ofed/drivers/net/mlx4/cmd.c:36:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/pci.h:48:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/dmapool.h:35:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/device.h:36:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/module.h:47:
In file included from @/sys/linker.h:34:
In file included from ./machine/elf.h:42:
@/sys/elf_generic.h:58:1: error: unknown type name 'Elf'
__ElfType(Addr);
^
@/sys/elf_generic.h:56:30: note: expanded from:
#define __ElfType(x)    typedef __ElfN(x) __CONCAT(Elf_,x)
                                ^
@/sys/elf_generic.h:54:46: note: expanded from:
#define __ElfN(x)       __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x)
                                                   ^
@/sys/cdefs.h:148:23: note: expanded from:
#define __CONCAT(x,y)   x/**/y
                        ^
@/sys/cdefs.h:148:23: note: expanded from:
#define __CONCAT(x,y)   x/**/y
                        ^
@/sys/cdefs.h:148:23: note: expanded from:
#define __CONCAT(x,y)   x/**/y
                        ^
In file included from /usr/src/sys/modules/mlx4/../../ofed/drivers/net/mlx4/cmd.c:36:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/pci.h:48:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/dmapool.h:35:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/device.h:36:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/module.h:47:
In file included from @/sys/linker.h:34:
In file included from ./machine/elf.h:42:
@/sys/elf_generic.h:58:1: error: expected identifier or '('
__ElfType(Addr);
^
@/sys/elf_generic.h:56:30: note: expanded from:
#define __ElfType(x)    typedef __ElfN(x) __CONCAT(Elf_,x)
                                ^
@/sys/elf_generic.h:54:50: note: expanded from:
#define __ElfN(x)       __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x)
                                                       ^
./machine/elf.h:38:25: note: expanded from:
#define __ELF_WORD_SIZE 64      /* Used by <sys/elf_generic.h> */
                        ^
@/sys/cdefs.h:148:28: note: expanded from:
#define __CONCAT(x,y)   x/**/y
                             ^
@/sys/cdefs.h:148:23: note: expanded from:
#define __CONCAT(x,y)   x/**/y
                        ^
@/sys/cdefs.h:148:23: note: expanded from:
#define __CONCAT(x,y)   x/**/y
                        ^
In file included from /usr/src/sys/modules/mlx4/../../ofed/drivers/net/mlx4/cmd.c:36:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/pci.h:48:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/dmapool.h:35:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/device.h:36:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/module.h:47:
In file included from @/sys/linker.h:34:
In file included from ./machine/elf.h:42:
@/sys/elf_generic.h:59:1: error: unknown type name 'Elf'
__ElfType(Half);
^
@/sys/elf_generic.h:56:30: note: expanded from:
#define __ElfType(x)    typedef __ElfN(x) __CONCAT(Elf_,x)
                                ^
@/sys/elf_generic.h:54:46: note: expanded from:
#define __ElfN(x)       __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x)
                                                   ^
@/sys/cdefs.h:148:23: note: expanded from:
#define __CONCAT(x,y)   x/**/y
                        ^
@/sys/cdefs.h:148:23: note: expanded from:
#define __CONCAT(x,y)   x/**/y
                        ^
@/sys/cdefs.h:148:23: note: expanded from:
#define __CONCAT(x,y)   x/**/y
                        ^
In file included from /usr/src/sys/modules/mlx4/../../ofed/drivers/net/mlx4/cmd.c:36:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/pci.h:48:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/dmapool.h:35:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/device.h:36:
In file included from /usr/src/sys/modules/mlx4/../../ofed/include/linux/module.h:47:
In file included from @/sys/linker.h:34:
In file included from ./machine/elf.h:42:
@/sys/elf_generic.h:59:1: error: expected identifier or '('
__ElfType(Half);
...

>How-To-Repeat:
Build the kernel with WITH_OFED=YES using clang.
>Fix:



>Release-Note:
>Audit-Trail:

From: Garrett Cooper <yanegomi@gmail.com>
To: bug-followup@FreeBSD.org, tplou@lbl.gov
Cc:  
Subject: Re: kern/163619: OFED failed to build with clang
Date: Tue, 11 Dec 2012 21:58:01 -0800

 All issues with /sys have been resolved with OFED on recent versions
 of CURRENT/9-STABLE. Userspace build issues still exist, but are being
 tracked with PR bin/174214 .
 -Garrett
State-Changed-From-To: open->closed 
State-Changed-By: eadler 
State-Changed-When: Mon Dec 17 05:19:40 UTC 2012 
State-Changed-Why:  
see 174214  - thanks for making FreeBSD better. 

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