Currently the benchtests are run with internal GLIBC headers, which is incorrect.
Defining _ISOMAC in the makefile ensures the internal headers are bypassed.
Fix all tests which were relying on internal defines or includes.
* benchtests/Makefile: Define _ISOMAC.
* benchtests/bench-strcoll.c: Add missing sys/stat.h include.
* benchtests/bench-string.h: Define inhibit_loop_to_libcall macro.
* benchtests/bench-strstr.c: Define empty libc_hidden_builtin_def.
* benchtests/bench-strtok.c (oldstrtok): Use rawmemchr.
* benchtests/bench-timing.h: Define attribute_hidden.
+2018-03-15 Wilco Dijkstra <wdijkstr@arm.com>
+
+ * benchtests/Makefile: Define _ISOMAC.
+ * benchtests/bench-strcoll.c: Add missing sys/stat.h include.
+ * benchtests/bench-string.h: Define inhibit_loop_to_libcall macro.
+ * benchtests/bench-strstr.c: Define empty libc_hidden_builtin_def.
+ * benchtests/bench-strtok.c (oldstrtok): Use rawmemchr.
+ * benchtests/bench-timing.h: Define attribute_hidden.
+
2018-03-15 Siddhesh Poyarekar <siddhesh@sourceware.org>
* sysdeps/aarch64/strncmp.S (strncmp): Use lsr instead of
BENCH_DURATION := 10
endif
-CPPFLAGS-nonlib += -DDURATION=$(BENCH_DURATION)
+CPPFLAGS-nonlib += -DDURATION=$(BENCH_DURATION) -D_ISOMAC
# Use clock_gettime to measure performance of functions. The default is to use
# HP_TIMING if it is available.
#include <stdlib.h>
#include <locale.h>
#include <unistd.h>
+#include <sys/stat.h>
#include "json-lib.h"
#include "bench-timing.h"
#include <string.h>
#include <getopt.h>
#include <sys/cdefs.h>
+/* We are compiled under _ISOMAC, so libc-symbols.h does not do this
+ for us. */
+#include "config.h"
+#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
+# define inhibit_loop_to_libcall \
+ __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
+#else
+# define inhibit_loop_to_libcall
+#endif
+
typedef struct
{
const char *name;
#define STRSTR simple_strstr
+#define libc_hidden_builtin_def(X)
#include "../string/strstr.c"
s = strpbrk (token, delim);
if (s == NULL)
/* This token finishes the string. */
- olds = __rawmemchr (token, '\0');
+ olds = rawmemchr (token, '\0');
else
{
/* Terminate the token and make OLDS point past it. */
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#define attribute_hidden
#include <hp-timing.h>
#include <stdint.h>