#!/bin/sh . $(dirname $0)/functions PATCHES=0 if [ -n "$1" ]; then AOSP="$1" else AOSP="`pwd`" fi if ! [ -d "$AOSP" ] && ! [ -d "$AOSP/bionic" ] && [ -d "$AOSP"/build ]; then echo "This script must be run from the AOSP source directory" echo "or with the AOSP source directory as its first parameter." exit 1 fi init #============================================ # Patches needed to make it build with clang #============================================ # Don't #define snprintf # https://android-review.googlesource.com/#/c/109026/ apply bionic 109026/1 # Bluedroid cleanups # https://android-review.googlesource.com/#/c/114282/ apply external/bluetooth/bluedroid 114282/2 # __attribute__((__aligned__)) workaround # https://android-review.googlesource.com/#/c/109567/ apply system/core 109567/2 # Fix Nexus 10 build # https://android-review.googlesource.com/#/c/110220/ apply hardware/samsung_slsi/exynos5 110220/3 # https://android-review.googlesource.com/#/c/120763/ apply hardware/invensense 120763/1 # gcc pragmas # https://android-review.googlesource.com/115662 apply frameworks/base 115662/2 # C++11 extensions in C++98 code # https://android-review.googlesource.com/114951 --- ultimately to be replaced by 115674 apply frameworks/av 114951/1 # Workaround for clang bug # https://android-review.googlesource.com/115666 apply frameworks/av 115666/1 # C++11 in C++98 mode # https://android-review.googlesource.com/115876 apply hardware/ril 115876/1 # Fixes needed only after C++11 switch apply external/aac 116625/1 apply hardware/qcom/media 116672/1 apply hardware/libhardware 119290/1 # Unused functions/label apply system/core 119241/1 # Check for condition that is always true apply external/iptables 119300/1 # 64-bit support apply art 116717/1 apply frameworks/base 116780/2 apply external/libvpx 119303/1 apply external/valgrind 119291/1 apply external/vixl 119292/1 # Restore ABI needed by Nexus 10 blobs apply frameworks/native 120810/1 echo "Applied $PATCHES patches"