aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2015-03-16 15:11:14 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2015-03-16 15:11:14 +0800
commit82d29e4a85507816e28199b108209a643a8b6a93 (patch)
tree3b3be511835284414f5e8749d30b3ef4d41b1bf3
parentb6b2ce5f9f87a09b14499cb00c600c601f022634 (diff)
downloadlibc-bench-82d29e4a85507816e28199b108209a643a8b6a93.tar.gz
Make it compile for Android Lollipop 5.1
Change-Id: Ib8555c9d31f9375c65e8a05e9ed4ec0c0fcde30a Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--Android.mk23
-rw-r--r--README2
-rw-r--r--main.c4
-rw-r--r--regex.c4
-rw-r--r--string.c4
5 files changed, 31 insertions, 6 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..1dc1a0b
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,23 @@
+LOCAL_PATH := $(my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= main.c \
+ malloc.c \
+ pthread.c \
+ regex.c \
+ stdio.c \
+ string.c \
+
+LOCAL_MODULE := libcbench
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+
+LOCAL_MULTILIB := both
+LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)
+LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
+
+LOCAL_MODULE_TAGS := debug
+
+LOCAL_CFLAGS += -std=gnu99 -D_XOPEN_SOURCE=700
+
+include $(BUILD_EXECUTABLE)
diff --git a/README b/README
new file mode 100644
index 0000000..fc8f806
--- /dev/null
+++ b/README
@@ -0,0 +1,2 @@
+The original repository is here:
+ git://git.musl-libc.org/libc-bench
diff --git a/main.c b/main.c
index 12bb541..e33a790 100644
--- a/main.c
+++ b/main.c
@@ -85,8 +85,8 @@ int main()
RUN(b_pthread_createjoin_minimal1, 0);
RUN(b_pthread_createjoin_minimal2, 0);
- RUN(b_utf8_bigbuf, 0);
- RUN(b_utf8_onebyone, 0);
+ //RUN(b_utf8_bigbuf, 0);
+ //RUN(b_utf8_onebyone, 0);
RUN(b_stdio_putcgetc, 0);
RUN(b_stdio_putcgetc_unlocked, 0);
diff --git a/regex.c b/regex.c
index 46cfe37..dfb60f1 100644
--- a/regex.c
+++ b/regex.c
@@ -4,7 +4,7 @@
#include <regex.h>
#include <locale.h>
-size_t b_regex_compile(void *s)
+void b_regex_compile(void *s)
{
regex_t re;
size_t i;
@@ -15,7 +15,7 @@ size_t b_regex_compile(void *s)
}
}
-size_t b_regex_search(void *s)
+void b_regex_search(void *s)
{
char buf[260000];
regex_t re;
diff --git a/string.c b/string.c
index 158b828..8134ea5 100644
--- a/string.c
+++ b/string.c
@@ -19,7 +19,7 @@ size_t b_string_strstr(void *dummy)
memcpy(haystack + l*i, needle, l+1);
for (i=0; i<50; i++) {
haystack[0]^=1;
- cs += (int)strstr(haystack, needle);
+ cs += (char *)strstr(haystack, needle);
}
free(haystack);
return cs;
@@ -45,7 +45,7 @@ size_t b_string_strchr(void *dummy)
buf[BUFLEN-2] = 'b';
for (i=0; i<100; i++) {
buf[i] = '0'+i%8;
- cs += (int)strchr(buf, 'b');
+ cs += (char *)strchr(buf, 'b');
}
free(buf);
return cs;