blob: e8883144af49437c25ae53eb2f11273d28c7e701 [file] [log] [blame]
Stephen Hinese72448a2014-11-26 18:02:45 -08001#!/bin/bash -e
2
3# Copy binaries
4for 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
14done
15
16# Copy libraries
17echo Copying libc++.so
Stephen Hines7a0f45b2014-12-03 19:14:52 -080018cp -a ${ANDROID_HOST_OUT}/lib/libc++.so lib/
19cp -a ${ANDROID_HOST_OUT}/lib64/libc++.so lib64/
Stephen Hinese72448a2014-11-26 18:02:45 -080020
21# Copy header files
22rm -rf lib/clang/*/include/*
23for 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/
26done
27
Stephen Hinese72448a2014-11-26 18:02:45 -080028# Copy over stdatomic.h from bionic
29echo Copying stdatomic.h
30cp -a ${ANDROID_BUILD_TOP}/bionic/libc/include/stdatomic.h lib/clang/*/include/
31
32echo Copying arm_neon.h
Stephen Hines9866aaf2015-03-19 16:40:06 -070033cp -a `find ${ANDROID_PRODUCT_OUT} -name arm_neon.h | head -n 1` lib/clang/*/include
Stephen Hinese72448a2014-11-26 18:02:45 -080034
Dan Albert23a26262015-01-25 16:17:26 -080035function 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
44function 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
53copy_profile_rt generic arm
54copy_profile_rt generic_arm64 aarch64
55copy_profile_rt generic_mips mipsel
56copy_profile_rt generic_mips64 mips64el
57copy_profile_rt generic_x86 i686
58copy_profile_rt generic_x86_64 x86_64
59
60copy_host_profile_rt x86_64
61copy_host_profile_rt i686 32
Dan Albert1c8e9412014-12-12 13:58:35 -080062
63sh update-sanitizers.sh