From nobody@FreeBSD.org  Wed Jan 22 16:39:23 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 7C547206
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 22 Jan 2014 16:39:23 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 5C6E019FE
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 22 Jan 2014 16:39:23 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id s0MGdNo1090006
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 22 Jan 2014 16:39:23 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id s0MGdNdq090003;
	Wed, 22 Jan 2014 16:39:23 GMT
	(envelope-from nobody)
Message-Id: <201401221639.s0MGdNdq090003@oldred.freebsd.org>
Date: Wed, 22 Jan 2014 16:39:23 GMT
From: John Howie <john@thehowies.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: buildworld libc build error "'MALLOC_PRODUCTION' macro redefined [-Werror]" in 10.0-RELEASE in jemalloc_jemalloc.c
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         186006
>Category:       misc
>Synopsis:       buildworld libc build error "'MALLOC_PRODUCTION' macro redefined [-Werror]" in 10.0-RELEASE in jemalloc_jemalloc.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 22 16:40:00 UTC 2014
>Closed-Date:    
>Last-Modified:  Tue Jan 28 06:40:00 UTC 2014
>Originator:     John Howie
>Release:        10.0-RELEASE
>Organization:
>Environment:
FreeBSD freebsd.thehowies.com 9.1-RELEASE-p3 FreeBSD 9.1-RELEASE-p3 #9: Sun May 12 15:34:42 PDT 2013     root@freebsd.thehowies.com:/sys/amd64/compile/IPFIREWALL  amd64
>Description:
Build world for ARMv6 (Raspbery Pi) build fails with following error in jemalloc_jemalloc.c:

cc   -O -pipe  -I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/include -I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/../../include -I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/arm -DNLS   -D__DBINTERFACE_PRIVATE -I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/../../contrib/gdtoa -I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/../../contrib/libc-vis -DINET6 -I/mount/devel/FreeBSD/10.0-RELEASE/obj/arm.armv6/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc -I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/../../contrib/jemalloc/include -DMALLOC_PRODUCTION -I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/../../contrib/tzcode/stdtime -I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/stdtime  -I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/rpc -I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/arm/softfloat -
 I/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/softfloat -DSOFTFLOAT_FOR_GCC -DYP -DNS_CACHING -DSYMBOL_VERSIONING -std=gnu99 -Qunused-arguments -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -c jemalloc_jemalloc.c -o jemalloc_jemalloc.o
In file included from jemalloc_jemalloc.c:2:
In file included from /mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h:64:
In file included from /mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/../jemalloc.h:18:
/mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/../jemalloc_FreeBSD.h:7:9: error: 
      'MALLOC_PRODUCTION' macro redefined [-Werror]
#define MALLOC_PRODUCTION
        ^
<command line>:6:9: note: previous definition is here
#define MALLOC_PRODUCTION 1
        ^
1 error generated.
*** Error code 1

Stop.
bmake[3]: stopped in /mount/devel/FreeBSD/10.0-RELEASE/src/lib/libc
*** Error code 1

Stop.
bmake[2]: stopped in /mount/devel/FreeBSD/10.0-RELEASE/src
*** Error code 1

Stop.
bmake[1]: stopped in /mount/devel/FreeBSD/10.0-RELEASE/src
*** Error code 1

Stop.
bmake: stopped in /mount/devel/FreeBSD/10.0-RELEASE/src
*** [buildworld] Error code 1

Stop in /mount/devel/FreeBSD/10.0-RELEASE/src.

>How-To-Repeat:
Run buildworld on release obtained via svn co svn:svn.freebsd.org/base/release/10.0.0

>Fix:
Need to determine if this is an ARM specific problem, first. I doubt it is, though.

>Release-Note:
>Audit-Trail:

From: John Howie <john@thehowies.com>
To: "bug-followup@FreeBSD.org" <bug-followup@FreeBSD.org>, John Howie
	<john@thehowies.com>
Cc:  
Subject: Re: misc/186006: buildworld libc build error
 &quot;&#39;MALLOC_PRODUCTION&#39; macro redefined [-Werror]&quot; in
 10.0-RELEASE in jemalloc_jemalloc.c
Date: Tue, 28 Jan 2014 06:36:16 +0000

 Did some digging and found the problem. The build script for ARM has the
 following line:
 
 make -C $SRCROOT MALLOC_PRODUCTION=3Dyes buildworld
 
 In the file contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h the
 following lines exist:
 
 #define MALLOC_PRODUCTION
 
 #ifndef MALLOC_PRODUCTION
 #define JEMALLOC_DEBUG
 #endif
 
 The bug is therefor not limited to the ARM processor build of
 10.0-RELEASE. Recommendation is to remove the definition of
 MALLOC_PRODUCTION from the header file, and document MALLOC_PRODUCTION
 properly (it is referenced in
 https://wiki.freebsd.org/DefaultDebuggingKnobs and a few other places).
 
 Regards,
 
 John
 
 
>Unformatted:
