diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2015-12-28 16:22:32 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2015-12-28 16:22:32 +0800 |
commit | 33561b52f020495b694d43fae58c648649f1956a (patch) | |
tree | 46b29931377c66d76dfc24564493e9fa8f4684c1 | |
parent | 82faa8ecca558c357cafd02f33497b55b0448245 (diff) |
back to use gcc to compile
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r-- | android-tools/static-binary/src/Makefile.64 | 4 | ||||
-rw-r--r-- | android-tools/static-binary/src/main_strcpy.c | 16 | ||||
-rw-r--r-- | android-tools/static-binary/src/strcpy_hikey | 24 | ||||
-rw-r--r-- | android-tools/static-binary/src/strcpy_juno | 121 | ||||
-rw-r--r-- | android-tools/static-binary/src/strcpy_nexus9 | 127 | ||||
-rwxr-xr-x | android-tools/static-binary/src/test_strcpy.sh | 11 |
6 files changed, 272 insertions, 31 deletions
diff --git a/android-tools/static-binary/src/Makefile.64 b/android-tools/static-binary/src/Makefile.64 index 1cdc7a7..177ebec 100644 --- a/android-tools/static-binary/src/Makefile.64 +++ b/android-tools/static-binary/src/Makefile.64 @@ -4,11 +4,11 @@ NDK=/SATA3/android-ndk-r10e/ SYSROOT=$(NDK)/platforms/android-21/arch-arm64/ TOOLCHAIN_GOOGLE_64=$(BASE)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/ INCLUDE_GOOGLE_64=$(OOLCHAIN_GOOGLE_64)/lib/gcc/aarch64-linux-android/4.9.x-google/include -CC_google_64=$(TOOLCHAIN_GOOGLE_64)/bin/aarch64-linux-android-g++ +CC_google_64=$(TOOLCHAIN_GOOGLE_64)/bin/aarch64-linux-android-gcc TOOLCHAIN_LINARO_64=$(BASE)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-5.3-linaro/ INCLUDE_LINARO_64=$(OOLCHAIN_LINARO_64)/lib/gcc/aarch64-linux-android/5.3.0/include -CC_linaro_64=$(TOOLCHAIN_LINARO_64)/bin/aarch64-linux-android-g++ +CC_linaro_64=$(TOOLCHAIN_LINARO_64)/bin/aarch64-linux-android-gcc CFLAGS_INCLUDES := \ -isystem $(BASE)/bionic/libc/arch-arm64/include \ diff --git a/android-tools/static-binary/src/main_strcpy.c b/android-tools/static-binary/src/main_strcpy.c index d730d1e..77ca562 100644 --- a/android-tools/static-binary/src/main_strcpy.c +++ b/android-tools/static-binary/src/main_strcpy.c @@ -4,8 +4,8 @@ #include <sys/time.h> // need to be defined without [ extern "C" ] when compile with gcc -extern "C" void *strcpy_google(void *dest, const void *src); -extern "C" void *strcpy_linaro(void *dest, const void *src); +void *strcpy_google(void *dest, const void *src); +void *strcpy_linaro(void *dest, const void *src); #define START gettimeofday(&tv1, 0); #define END(x) gettimeofday(&tv2, 0); t1 = ((double)tv1.tv_sec)+((double)tv1.tv_usec)/1000000.0; t2 = ((double)tv2.tv_sec)+((double)tv2.tv_usec)/1000000.0; printf("%s: %f seconds\n", x, t2-t1) @@ -29,12 +29,6 @@ int main() { END("1000000 * strcpy_google of 15000 bytes"); START; - for(int i=0; i<100000000; i++) { - strcpy_google(tmp, s); - } - END("100000000 * strcpy_google of 15 bytes"); - - START; for(int i=0; i<1000000; i++) { strcpy_linaro(tmp, l); } @@ -42,6 +36,12 @@ int main() { START; for(int i=0; i<100000000; i++) { + strcpy_google(tmp, s); + } + END("100000000 * strcpy_google of 15 bytes"); + + START; + for(int i=0; i<100000000; i++) { strcpy_linaro(tmp, s); } END("100000000 * strcpy_linaro of 15 bytes"); diff --git a/android-tools/static-binary/src/strcpy_hikey b/android-tools/static-binary/src/strcpy_hikey new file mode 100644 index 0000000..618c749 --- /dev/null +++ b/android-tools/static-binary/src/strcpy_hikey @@ -0,0 +1,24 @@ +======= Start test for strcpy_test_linaro ================= +1000000 * strcpy_google of 15000 bytes: 7.182125 seconds
+100000000 * strcpy_google of 15 bytes: 2.589967 seconds
+1000000 * strcpy_linaro of 15000 bytes: 7.126887 seconds
+100000000 * strcpy_linaro of 15 bytes: 1.668537 seconds
+======= End test for strcpy_test_linaro ================= +======= Start test for strcpy_test_google ================= +1000000 * strcpy_google of 15000 bytes: 7.978572 seconds
+100000000 * strcpy_google of 15 bytes: 3.428169 seconds
+1000000 * strcpy_linaro of 15000 bytes: 8.809340 seconds
+100000000 * strcpy_linaro of 15 bytes: 1.668488 seconds
+======= End test for strcpy_test_google ================= +======= Start test for strcpy_test_linaro_static ================= +1000000 * strcpy_google of 15000 bytes: 10.495679 seconds
+100000000 * strcpy_google of 15 bytes: 4.395195 seconds
+1000000 * strcpy_linaro of 15000 bytes: 11.193272 seconds
+100000000 * strcpy_linaro of 15 bytes: 1.668550 seconds
+======= End test for strcpy_test_linaro_static ================= +======= Start test for strcpy_test_google_static ================= +1000000 * strcpy_google of 15000 bytes: 12.158279 seconds
+100000000 * strcpy_google of 15 bytes: 1.752182 seconds
+1000000 * strcpy_linaro of 15000 bytes: 11.316263 seconds
+100000000 * strcpy_linaro of 15 bytes: 5.107654 seconds
+======= End test for strcpy_test_google_static ================= diff --git a/android-tools/static-binary/src/strcpy_juno b/android-tools/static-binary/src/strcpy_juno new file mode 100644 index 0000000..47c2fb9 --- /dev/null +++ b/android-tools/static-binary/src/strcpy_juno @@ -0,0 +1,121 @@ +======= Start test for strcpy_test_linaro ================= +1000000 * strcpy_google of 15000 bytes: 4.325394 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296659 seconds +100000000 * strcpy_google of 15 bytes: 1.000792 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000885 seconds +======= End test for strcpy_test_linaro ================= +======= Start test for strcpy_test_google ================= +1000000 * strcpy_google of 15000 bytes: 6.853692 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296373 seconds +100000000 * strcpy_google of 15 bytes: 1.000782 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000794 seconds +======= End test for strcpy_test_google ================= +======= Start test for strcpy_test_linaro_static ================= +1000000 * strcpy_google of 15000 bytes: 4.309346 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296387 seconds +100000000 * strcpy_google of 15 bytes: 1.000725 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000864 seconds +======= End test for strcpy_test_linaro_static ================= +======= Start test for strcpy_test_google_static ================= +1000000 * strcpy_google of 15000 bytes: 6.859269 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296439 seconds +100000000 * strcpy_google of 15 bytes: 1.450009 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000778 seconds +======= End test for strcpy_test_google_static ================= +======= Start test for strcpy_test_linaro ================= +1000000 * strcpy_google of 15000 bytes: 4.348596 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296774 seconds +100000000 * strcpy_google of 15 bytes: 1.025744 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000916 seconds +======= End test for strcpy_test_linaro ================= +======= Start test for strcpy_test_google ================= +1000000 * strcpy_google of 15000 bytes: 4.301120 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296461 seconds +100000000 * strcpy_google of 15 bytes: 1.455094 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000788 seconds +======= End test for strcpy_test_google ================= +======= Start test for strcpy_test_linaro_static ================= +1000000 * strcpy_google of 15000 bytes: 4.309311 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296381 seconds +100000000 * strcpy_google of 15 bytes: 1.000732 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000865 seconds +======= End test for strcpy_test_linaro_static ================= +======= Start test for strcpy_test_google_static ================= +1000000 * strcpy_google of 15000 bytes: 6.871441 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.446406 seconds +100000000 * strcpy_google of 15 bytes: 1.428640 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000784 seconds +======= End test for strcpy_test_google_static ================= +======= Start test for strcpy_test_linaro ================= +1000000 * strcpy_google of 15000 bytes: 5.932354 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296354 seconds +100000000 * strcpy_google of 15 bytes: 1.000733 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000869 seconds +======= End test for strcpy_test_linaro ================= +======= Start test for strcpy_test_google ================= +1000000 * strcpy_google of 15000 bytes: 6.865940 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.432224 seconds +100000000 * strcpy_google of 15 bytes: 1.000812 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000785 seconds +======= End test for strcpy_test_google ================= +======= Start test for strcpy_test_linaro_static ================= +1000000 * strcpy_google of 15000 bytes: 4.411464 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.446725 seconds +100000000 * strcpy_google of 15 bytes: 1.000718 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000877 seconds +======= End test for strcpy_test_linaro_static ================= +======= Start test for strcpy_test_google_static ================= +1000000 * strcpy_google of 15000 bytes: 6.871874 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.476179 seconds +100000000 * strcpy_google of 15 bytes: 1.418249 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000776 seconds +======= End test for strcpy_test_google_static ================= +======= Start test for strcpy_test_linaro ================= +1000000 * strcpy_google of 15000 bytes: 6.853871 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296483 seconds +100000000 * strcpy_google of 15 bytes: 1.455301 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000855 seconds +======= End test for strcpy_test_linaro ================= +======= Start test for strcpy_test_google ================= +1000000 * strcpy_google of 15000 bytes: 6.860520 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296348 seconds +100000000 * strcpy_google of 15 bytes: 1.000779 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000803 seconds +======= End test for strcpy_test_google ================= +======= Start test for strcpy_test_linaro_static ================= +1000000 * strcpy_google of 15000 bytes: 4.418231 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.478706 seconds +100000000 * strcpy_google of 15 bytes: 1.004605 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000870 seconds +======= End test for strcpy_test_linaro_static ================= +======= Start test for strcpy_test_google_static ================= +1000000 * strcpy_google of 15000 bytes: 6.859340 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296458 seconds +100000000 * strcpy_google of 15 bytes: 1.420888 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000776 seconds +======= End test for strcpy_test_google_static ================= +======= Start test for strcpy_test_linaro ================= +1000000 * strcpy_google of 15000 bytes: 4.511281 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296597 seconds +100000000 * strcpy_google of 15 bytes: 1.000857 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000736 seconds +======= End test for strcpy_test_linaro ================= +======= Start test for strcpy_test_google ================= +1000000 * strcpy_google of 15000 bytes: 5.328306 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296488 seconds +100000000 * strcpy_google of 15 bytes: 1.002314 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000785 seconds +======= End test for strcpy_test_google ================= +======= Start test for strcpy_test_linaro_static ================= +1000000 * strcpy_google of 15000 bytes: 4.323397 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.314938 seconds +100000000 * strcpy_google of 15 bytes: 1.000858 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000734 seconds +======= End test for strcpy_test_linaro_static ================= +======= Start test for strcpy_test_google_static ================= +1000000 * strcpy_google of 15000 bytes: 6.859379 seconds +1000000 * strcpy_linaro of 15000 bytes: 4.296456 seconds +100000000 * strcpy_google of 15 bytes: 1.442151 seconds +100000000 * strcpy_linaro of 15 bytes: 1.000795 seconds +======= End test for strcpy_test_google_static ================= + diff --git a/android-tools/static-binary/src/strcpy_nexus9 b/android-tools/static-binary/src/strcpy_nexus9 index 58b3360..001f4b2 100644 --- a/android-tools/static-binary/src/strcpy_nexus9 +++ b/android-tools/static-binary/src/strcpy_nexus9 @@ -1,25 +1,118 @@ ======= Start test for strcpy_test_linaro ================= -1000000 * strcpy_google of 15000 bytes: 1.978911 seconds -100000000 * strcpy_google of 15 bytes: 0.964675 seconds -1000000 * strcpy_linaro of 15000 bytes: 1.961538 seconds -100000000 * strcpy_linaro of 15 bytes: 0.334581 seconds +1000000 * strcpy_google of 15000 bytes: 1.999116 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.867722 seconds +100000000 * strcpy_google of 15 bytes: 0.919690 seconds +100000000 * strcpy_linaro of 15 bytes: 0.313454 seconds ======= End test for strcpy_test_linaro ================= ======= Start test for strcpy_test_google ================= -1000000 * strcpy_google of 15000 bytes: 1.981997 seconds -100000000 * strcpy_google of 15 bytes: 0.970816 seconds -1000000 * strcpy_linaro of 15000 bytes: 1.966611 seconds -100000000 * strcpy_linaro of 15 bytes: 0.263881 seconds +1000000 * strcpy_google of 15000 bytes: 1.876463 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.883328 seconds +100000000 * strcpy_google of 15 bytes: 0.923468 seconds +100000000 * strcpy_linaro of 15 bytes: 0.312442 seconds ======= End test for strcpy_test_google ================= ======= Start test for strcpy_test_linaro_static ================= -1000000 * strcpy_google of 15000 bytes: 1.998843 seconds -100000000 * strcpy_google of 15 bytes: 0.974423 seconds -1000000 * strcpy_linaro of 15000 bytes: 1.972505 seconds -100000000 * strcpy_linaro of 15 bytes: 0.560453 seconds +1000000 * strcpy_google of 15000 bytes: 1.912096 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.909330 seconds +100000000 * strcpy_google of 15 bytes: 0.968491 seconds +100000000 * strcpy_linaro of 15 bytes: 0.330528 seconds ======= End test for strcpy_test_linaro_static ================= ======= Start test for strcpy_test_google_static ================= -1000000 * strcpy_google of 15000 bytes: 1.980395 seconds -100000000 * strcpy_google of 15 bytes: 0.921233 seconds -1000000 * strcpy_linaro of 15000 bytes: 1.873095 seconds -100000000 * strcpy_linaro of 15 bytes: 0.319051 seconds +1000000 * strcpy_google of 15000 bytes: 1.926709 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.893056 seconds +100000000 * strcpy_google of 15 bytes: 0.934200 seconds +100000000 * strcpy_linaro of 15 bytes: 0.537363 seconds +======= End test for strcpy_test_google_static ================= +======= Start test for strcpy_test_linaro ================= +1000000 * strcpy_google of 15000 bytes: 1.902512 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.885220 seconds +100000000 * strcpy_google of 15 bytes: 0.928882 seconds +100000000 * strcpy_linaro of 15 bytes: 0.538953 seconds +======= End test for strcpy_test_linaro ================= +======= Start test for strcpy_test_google ================= +1000000 * strcpy_google of 15000 bytes: 1.899437 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.883578 seconds +100000000 * strcpy_google of 15 bytes: 0.940844 seconds +100000000 * strcpy_linaro of 15 bytes: 0.317077 seconds +======= End test for strcpy_test_google ================= +======= Start test for strcpy_test_linaro_static ================= +1000000 * strcpy_google of 15000 bytes: 1.913967 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.876286 seconds +100000000 * strcpy_google of 15 bytes: 0.925260 seconds +100000000 * strcpy_linaro of 15 bytes: 0.308428 seconds +======= End test for strcpy_test_linaro_static ================= +======= Start test for strcpy_test_google_static ================= +1000000 * strcpy_google of 15000 bytes: 1.889965 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.875313 seconds +100000000 * strcpy_google of 15 bytes: 0.925597 seconds +100000000 * strcpy_linaro of 15 bytes: 0.528462 seconds +======= End test for strcpy_test_google_static ================= +======= Start test for strcpy_test_linaro ================= +1000000 * strcpy_google of 15000 bytes: 1.903056 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.908748 seconds +100000000 * strcpy_google of 15 bytes: 0.938575 seconds +100000000 * strcpy_linaro of 15 bytes: 0.318743 seconds +======= End test for strcpy_test_linaro ================= +======= Start test for strcpy_test_google ================= +1000000 * strcpy_google of 15000 bytes: 1.937524 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.885369 seconds +======= End test for strcpy_test_google ================= +======= Start test for strcpy_test_linaro_static ================= +1000000 * strcpy_google of 15000 bytes: 1.898408 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.981369 seconds +100000000 * strcpy_google of 15 bytes: 0.966102 seconds +100000000 * strcpy_linaro of 15 bytes: 0.321927 seconds +======= End test for strcpy_test_linaro_static ================= +======= Start test for strcpy_test_google_static ================= +1000000 * strcpy_google of 15000 bytes: 1.990753 seconds +1000000 * strcpy_linaro of 15000 bytes: 2.034256 seconds +100000000 * strcpy_google of 15 bytes: 0.972545 seconds +100000000 * strcpy_linaro of 15 bytes: 0.554747 seconds +======= End test for strcpy_test_google_static ================= +======= Start test for strcpy_test_linaro ================= +1000000 * strcpy_google of 15000 bytes: 1.965775 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.974137 seconds +100000000 * strcpy_google of 15 bytes: 0.973483 seconds +100000000 * strcpy_linaro of 15 bytes: 0.267212 seconds +======= End test for strcpy_test_linaro ================= +======= Start test for strcpy_test_google ================= +1000000 * strcpy_google of 15000 bytes: 1.989458 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.973354 seconds +100000000 * strcpy_google of 15 bytes: 0.973208 seconds +100000000 * strcpy_linaro of 15 bytes: 0.292583 seconds +======= End test for strcpy_test_google ================= +======= Start test for strcpy_test_linaro_static ================= +1000000 * strcpy_google of 15000 bytes: 2.007854 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.977602 seconds +100000000 * strcpy_google of 15 bytes: 0.967541 seconds +100000000 * strcpy_linaro of 15 bytes: 0.325212 seconds +======= End test for strcpy_test_linaro_static ================= +======= Start test for strcpy_test_google_static ================= +1000000 * strcpy_google of 15000 bytes: 1.981750 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.961036 seconds +100000000 * strcpy_google of 15 bytes: 0.973528 seconds +100000000 * strcpy_linaro of 15 bytes: 0.553320 seconds +======= End test for strcpy_test_google_static ================= +======= Start test for strcpy_test_linaro ================= +1000000 * strcpy_google of 15000 bytes: 1.968332 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.967035 seconds +100000000 * strcpy_google of 15 bytes: 0.971154 seconds +100000000 * strcpy_linaro of 15 bytes: 0.334478 seconds +======= End test for strcpy_test_linaro ================= +======= Start test for strcpy_test_google ================= +1000000 * strcpy_google of 15000 bytes: 2.017407 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.968357 seconds +100000000 * strcpy_google of 15 bytes: 0.969793 seconds +100000000 * strcpy_linaro of 15 bytes: 0.333027 seconds +======= End test for strcpy_test_google ================= +======= Start test for strcpy_test_linaro_static ================= +1000000 * strcpy_google of 15000 bytes: 1.982838 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.961640 seconds +100000000 * strcpy_google of 15 bytes: 0.967267 seconds +100000000 * strcpy_linaro of 15 bytes: 0.322775 seconds +======= End test for strcpy_test_linaro_static ================= +======= Start test for strcpy_test_google_static ================= +1000000 * strcpy_google of 15000 bytes: 1.976444 seconds +1000000 * strcpy_linaro of 15000 bytes: 1.960328 seconds +100000000 * strcpy_google of 15 bytes: 0.991322 seconds +100000000 * strcpy_linaro of 15 bytes: 0.570604 seconds ======= End test for strcpy_test_google_static ================= - diff --git a/android-tools/static-binary/src/test_strcpy.sh b/android-tools/static-binary/src/test_strcpy.sh index b096877..bcd04c1 100755 --- a/android-tools/static-binary/src/test_strcpy.sh +++ b/android-tools/static-binary/src/test_strcpy.sh @@ -11,7 +11,10 @@ function echo_and_run(){ adb shell /data/local/tmp/bin/$cmd echo ======= End test for $cmd ================= } -echo_and_run strcpy_test_linaro -echo_and_run strcpy_test_google -echo_and_run strcpy_test_linaro_static -echo_and_run strcpy_test_google_static + +for i in {1..5..1}; do + echo_and_run strcpy_test_linaro + echo_and_run strcpy_test_google + echo_and_run strcpy_test_linaro_static + echo_and_run strcpy_test_google_static +done |