Bug 210857 - benchmarks/iozone: 'CACHE_LINE_SIZE' macro redefined (overriding machine/param.h ) (armv6 -mcpu=cortex-a7 for/on rpi2)
Summary: benchmarks/iozone: 'CACHE_LINE_SIZE' macro redefined (overriding machine/para...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Josh Paetzel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-05 21:05 UTC by Mark Millard
Modified: 2016-07-29 13:01 UTC (History)
2 users (show)

See Also:
jbeich: maintainer-feedback? (jpaetzel)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Millard 2016-07-05 21:05:04 UTC
As reported by the compiler doing the build:

iozone.c:762:9: warning: 'CACHE_LINE_SIZE' macro redefined [-Wmacro-redefined]
#define CACHE_LINE_SIZE 32
        ^
/usr/include/machine/param.h:109:9: note: previous definition is here
#define CACHE_LINE_SIZE         (1 << CACHE_LINE_SHIFT)
        ^
Comment 1 Mark Millard 2016-07-18 05:07:02 UTC
(In reply to Mark Millard from comment #0)

The line number in FreeBSD's param.h is possibly machine-type specific.

# grep CACHE_LINE_SIZE /usr/include/machine/param.h
 * CACHE_LINE_SIZE is the compile-time maximum cache line size for an
#define	CACHE_LINE_SIZE		(1 << CACHE_LINE_SHIFT)

(Both amd64 and armv6 show this grep result.)

If /usr/include/machine/param.h is (indirectly) included by the header file handling then there is likely a CACHE_LINE_SIZE macro definition present in FreeBSD based compiles for those architectures that have cache lines.

I've been using the system clang 3.8.0 from 11.0 (-STABLE these days). Other compilers or compiler vintages may not necessarily report the redefinition by default.

My /etc/make.conf has just:

WANT_QT_VERBOSE_CONFIGURE=1
#
DEFAULT_VERSIONS+=perl5=5.22
WRKDIRPREFIX=/usr/obj/portswork
WITH_DEBUG=
WITH_DEBUG_FILES=
MALLOC_PRODUCTION=
Comment 2 Jan Beich freebsd_committer freebsd_triage 2016-07-20 19:39:31 UTC
(Assign to the new maintainer since ports r418841.)
Comment 3 Mark Millard 2016-07-20 20:20:04 UTC
Upstream ( capps@iozone.org ) reports:

	The changes for :
	* FreeBSD handling of definition of __off_t 
	* Definition CACHE_LINE_SIZE changed to MY_CACHE_LINE_SIZE
	Have been merged into the official Iozone source tree and will
appear in 3.445 and later releases.

He later reported:

	Revision 3.446 will appear on the Iozone web site within 24 hours.
Comment 4 Walter Schwarzenfeld 2016-07-21 08:23:42 UTC
Revision 3.446 is upstream, but if I am write, nothing changed. It compiles without problems, but the the warnings all still there. Also, I saw no change with CACHE_LINE_SIZE.
Comment 5 Walter Schwarzenfeld 2016-07-21 08:24:17 UTC
correct:
if I am right.
Comment 6 Mark Millard 2016-07-21 08:42:08 UTC
(In reply to w.schwarzenfeld from comment #5)

http://www.iozone.org/src/current/iozone.c has:

#if defined(__FreeBSD__)
#define __off64_t_defined
typedef off_t off64_t;
#endif

(before dragonfly's equivalent)

It has:

#ifndef solaris
#ifndef off64_t
#ifndef _OFF64_T
#ifndef __AIX__
#ifndef __off64_t_defined
#ifndef SCO_Unixware_gcc
#ifndef UWIN
#ifndef __DragonFly__
#ifndef __FreeBSD__
typedef long long off64_t;
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif

(So __FreeBSD__ was added here as well, although the __off64_t_defined would have covered it.)

It has:

#define MY_CACHE_LINE_SIZE 32

so CACHE_LINE_SIZE from FreeBSD will no longer be redefined.


It generally does not have %lld related casting changes from what I see.
Comment 7 Mark Millard 2016-07-21 08:57:24 UTC
(In reply to Mark Millard from comment #6)

FYI for the 3.446 update:

[Latest tarball] [Latest files] [Stable tarball] [Stable files]

on http://www.iozone.org all link into http://www.iozone.org/src/current/ but http://www.iozone.org/src/stable/ is older (2009).

It appears that going to http://www.iozone.org/src/stable/ is not currently the right thing to do.
Comment 8 Walter Schwarzenfeld 2016-07-28 21:10:55 UTC
Also fixed with update to 3.457 (changed to       #define MY_CACHE_LINE_SIZE). Could closed.