Stephen Hines | e72448a | 2014-11-26 18:02:45 -0800 | [diff] [blame] | 1 | #!/bin/bash -e |
| 2 | |
| 3 | # Copy binaries |
| 4 | for b in bin/*; do |
| 5 | file=`basename $b` |
| 6 | # Don't copy symlinks like clang++ |
| 7 | if test -h $b; then |
| 8 | echo Skipping $file |
| 9 | else |
| 10 | echo Copying $file |
| 11 | cp -a `find ${ANDROID_HOST_OUT}/bin -name $file` $b |
| 12 | strip $b |
| 13 | fi |
| 14 | done |
| 15 | |
| 16 | # Copy libraries |
| 17 | echo Copying libc++.so |
Stephen Hines | 7a0f45b | 2014-12-03 19:14:52 -0800 | [diff] [blame] | 18 | cp -a ${ANDROID_HOST_OUT}/lib/libc++.so lib/ |
| 19 | cp -a ${ANDROID_HOST_OUT}/lib64/libc++.so lib64/ |
Stephen Hines | e72448a | 2014-11-26 18:02:45 -0800 | [diff] [blame] | 20 | |
| 21 | # Copy header files |
| 22 | rm -rf lib/clang/*/include/* |
| 23 | for i in `find ${ANDROID_BUILD_TOP}/external/clang/lib/Headers -mindepth 1 ! -name \*.mk -a ! -name Makefile -a ! -name CMakeLists.txt`; do |
| 24 | echo Copying `basename $i` |
| 25 | cp -a $i lib/clang/*/include/ |
| 26 | done |
| 27 | |
Stephen Hines | e72448a | 2014-11-26 18:02:45 -0800 | [diff] [blame] | 28 | # Copy over stdatomic.h from bionic |
| 29 | echo Copying stdatomic.h |
| 30 | cp -a ${ANDROID_BUILD_TOP}/bionic/libc/include/stdatomic.h lib/clang/*/include/ |
| 31 | |
| 32 | echo Copying arm_neon.h |
Stephen Hines | 9866aaf | 2015-03-19 16:40:06 -0700 | [diff] [blame] | 33 | cp -a `find ${ANDROID_PRODUCT_OUT} -name arm_neon.h | head -n 1` lib/clang/*/include |
Stephen Hines | e72448a | 2014-11-26 18:02:45 -0800 | [diff] [blame] | 34 | |
Dan Albert | 23a2626 | 2015-01-25 16:17:26 -0800 | [diff] [blame] | 35 | function copy_profile_rt() { |
| 36 | target=$1 |
| 37 | arch=$2 |
| 38 | obj=${ANDROID_BUILD_TOP}/out/target/product/${target}/obj/STATIC_LIBRARIES |
| 39 | libdir=$(echo lib/clang/*)/lib/linux |
| 40 | lib=${libdir}/libclang_rt.profile-${arch}-android.a |
| 41 | cp -a ${obj}/libprofile_rt_intermediates/libprofile_rt.a ${lib} |
| 42 | } |
| 43 | |
| 44 | function copy_host_profile_rt() { |
| 45 | arch=$1 |
| 46 | obj_suffix=$2 |
| 47 | obj=${ANDROID_BUILD_TOP}/out/host/linux-x86/obj$obj_suffix/STATIC_LIBRARIES |
| 48 | libdir=$(echo lib/clang/*)/lib/linux |
| 49 | lib=${libdir}/libclang_rt.profile-${arch}.a |
| 50 | cp -a ${obj}/libprofile_rt_intermediates/libprofile_rt.a ${lib} |
| 51 | } |
| 52 | |
| 53 | copy_profile_rt generic arm |
| 54 | copy_profile_rt generic_arm64 aarch64 |
| 55 | copy_profile_rt generic_mips mipsel |
| 56 | copy_profile_rt generic_mips64 mips64el |
| 57 | copy_profile_rt generic_x86 i686 |
| 58 | copy_profile_rt generic_x86_64 x86_64 |
| 59 | |
| 60 | copy_host_profile_rt x86_64 |
| 61 | copy_host_profile_rt i686 32 |
Dan Albert | 1c8e941 | 2014-12-12 13:58:35 -0800 | [diff] [blame] | 62 | |
| 63 | sh update-sanitizers.sh |