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` |
Stephen Hines | f7805e2 | 2015-08-13 22:39:00 -0700 | [diff] [blame] | 6 | # Don't copy symlinks like clang++ or directories |
| 7 | if test -h $b || test -d $b; then |
Stephen Hines | e72448a | 2014-11-26 18:02:45 -0800 | [diff] [blame] | 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 | |
Dan Albert | c0077e3 | 2015-07-28 13:20:39 -0700 | [diff] [blame] | 16 | # Copy static analyzer scripts. |
| 17 | echo Copying static analyzer tools |
| 18 | rm -rf tools/* |
| 19 | mkdir -p tools |
| 20 | cp -ar ${ANDROID_BUILD_TOP}/external/clang/tools/scan-build tools |
| 21 | cp -ar ${ANDROID_BUILD_TOP}/external/clang/tools/scan-view tools |
| 22 | |
Stephen Hines | e72448a | 2014-11-26 18:02:45 -0800 | [diff] [blame] | 23 | # Copy libraries |
| 24 | echo Copying libc++.so |
Stephen Hines | 7a0f45b | 2014-12-03 19:14:52 -0800 | [diff] [blame] | 25 | cp -a ${ANDROID_HOST_OUT}/lib/libc++.so lib/ |
| 26 | cp -a ${ANDROID_HOST_OUT}/lib64/libc++.so lib64/ |
Stephen Hines | e72448a | 2014-11-26 18:02:45 -0800 | [diff] [blame] | 27 | |
| 28 | # Copy header files |
| 29 | rm -rf lib/clang/*/include/* |
| 30 | for i in `find ${ANDROID_BUILD_TOP}/external/clang/lib/Headers -mindepth 1 ! -name \*.mk -a ! -name Makefile -a ! -name CMakeLists.txt`; do |
| 31 | echo Copying `basename $i` |
| 32 | cp -a $i lib/clang/*/include/ |
| 33 | done |
| 34 | |
Stephen Hines | e72448a | 2014-11-26 18:02:45 -0800 | [diff] [blame] | 35 | # Copy over stdatomic.h from bionic |
| 36 | echo Copying stdatomic.h |
| 37 | cp -a ${ANDROID_BUILD_TOP}/bionic/libc/include/stdatomic.h lib/clang/*/include/ |
| 38 | |
| 39 | echo Copying arm_neon.h |
Stephen Hines | 9866aaf | 2015-03-19 16:40:06 -0700 | [diff] [blame] | 40 | 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] | 41 | |
Dan Albert | 23a2626 | 2015-01-25 16:17:26 -0800 | [diff] [blame] | 42 | function copy_profile_rt() { |
| 43 | target=$1 |
| 44 | arch=$2 |
| 45 | obj=${ANDROID_BUILD_TOP}/out/target/product/${target}/obj/STATIC_LIBRARIES |
| 46 | libdir=$(echo lib/clang/*)/lib/linux |
| 47 | lib=${libdir}/libclang_rt.profile-${arch}-android.a |
| 48 | cp -a ${obj}/libprofile_rt_intermediates/libprofile_rt.a ${lib} |
| 49 | } |
| 50 | |
| 51 | function copy_host_profile_rt() { |
| 52 | arch=$1 |
| 53 | obj_suffix=$2 |
| 54 | obj=${ANDROID_BUILD_TOP}/out/host/linux-x86/obj$obj_suffix/STATIC_LIBRARIES |
| 55 | libdir=$(echo lib/clang/*)/lib/linux |
| 56 | lib=${libdir}/libclang_rt.profile-${arch}.a |
| 57 | cp -a ${obj}/libprofile_rt_intermediates/libprofile_rt.a ${lib} |
| 58 | } |
| 59 | |
| 60 | copy_profile_rt generic arm |
| 61 | copy_profile_rt generic_arm64 aarch64 |
| 62 | copy_profile_rt generic_mips mipsel |
| 63 | copy_profile_rt generic_mips64 mips64el |
| 64 | copy_profile_rt generic_x86 i686 |
| 65 | copy_profile_rt generic_x86_64 x86_64 |
| 66 | |
| 67 | copy_host_profile_rt x86_64 |
| 68 | copy_host_profile_rt i686 32 |
Dan Albert | 1c8e941 | 2014-12-12 13:58:35 -0800 | [diff] [blame] | 69 | |
| 70 | sh update-sanitizers.sh |