Bug 186006 - buildworld libc build error "'MALLOC_PRODUCTION' macro redefined [-Werror]" in 10.0-RELEASE in jemalloc_jemalloc.c
Summary: buildworld libc build error "'MALLOC_PRODUCTION' macro redefined [-Werror]" i...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 10.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-22 16:40 UTC by John Howie
Modified: 2018-01-03 05:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Howie 2014-01-22 16:40:00 UTC
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.

Fix: 

Need to determine if this is an ARM specific problem, first. I doubt it is, though.
How-To-Repeat: Run buildworld on release obtained via svn co svn:svn.freebsd.org/base/release/10.0.0
Comment 1 John Howie 2014-01-28 06:36:16 UTC
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
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:04 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped