#!/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 # Patches that have already been applied on master... # Not directly clang related, but let's fix the build... cherrypick build 311384fec340a7f2f76ca7f45599987df4341d5b # build infrastructure apply --linaro build 15270/2 # Clang related build fixes cherrypick external/libunwind 999f963cb70225fbd27e6846fdb490abd2368529 cherrypick external/libunwind 5f0b9af0e9dbf486b220cec1168a9321222ab7f7 cherrypick external/libunwind f760bf5b2c822d21442aa9f765da0e62284e4f48 cherrypick bionic ae558d6b4bcee740f7e61434982eb5f2c999fb97 echo "Applied $PATCHES patches" exit 0 #============================================ # Patches needed to make it build with clang #============================================ # Don't #define snprintf # https://android-review.googlesource.com/#/c/109026/ apply bionic 109026/1 # Don't force external/chromium_org to be built with gcc # https://android-review.googlesource.com/#/c/112764/ #apply external/chromium_org 112764/3 # Work around register usage and superfluous functions in chromium # https://android-review.googlesource.com/#/c/109153/ #apply external/chromium_org 109153/5 # Array subscript of type 'char' # https://android-review.googlesource.com/#/c/109380/1 #apply external/chromium_org 109380/1 # Work around register usage # https://android-review.googlesource.com/109681 #apply external/chromium_org/third_party/WebKit 109681/1 # Overloaded virtual # https://android-review.googlesource.com/#/c/109786/ apply frameworks/base 109786/1 # Remove unused function # https://android-review.googlesource.com/#/c/109762/ apply frameworks/base 109762/1 # Remove unused variable # https://android-review.googlesource.com/#/c/109787/ apply frameworks/base 109787/1 # More unused variables # https://android-review.googlesource.com/#/c/109777/ apply frameworks/base 109777/1 # Remove check for an impossible condition # https://android-review.googlesource.com/#/c/109776/ apply frameworks/av 109776/1 # undefined internals in Binder # https://android-review.googlesource.com/#/c/109553/ apply frameworks/native 109553/1 # __attribute__((__aligned__)) workaround # https://android-review.googlesource.com/#/c/109567/ apply system/core 109567/2 # Fix checks for {Front,Side,Back}ElementIsCpe # https://android-review.googlesource.com/#/c/109025/ apply external/aac 109025/2 # Unused parameters # https://android-review.googlesource.com/#/c/109785/ apply external/skia 109785/2 # Unused parameters (ugly part) # https://android-review.googlesource.com/#/c/109860/ apply external/skia 109860/1 # Check for condition that can't happen # https://android-review.googlesource.com/#/c/109765/ apply hardware/invensense 109765/1 # Fix Nexus 10 build # https://android-review.googlesource.com/#/c/110220/ apply hardware/samsung_slsi/exynos5 110220/1 # Nexus 5 # checks for conditions that can't happen # https://android-review.googlesource.com/#/c/110291/ apply hardware/qcom/camera 110291/2 # more of the same # https://android-review.googlesource.com/#/c/110109/ apply hardware/qcom/camera 110109/1 # more of the same, also optimize out a double-to-string-and-back conv # https://android-review.googlesource.com/#/c/110292/ apply hardware/qcom/camera 110292/1 # Assorted clang build fixes # https://android-review.googlesource.com/#/c/110324/ apply device/lge/mako 110324/1 # Weird K&R issue seen on android-build but not locally # https://android-review.googlesource.com/#/c/111267/ apply external/ipsec-tools 111267/3 # Increase max. allowed stack frame size, needed for art::dex2oat for now # https://android-review.googlesource.com/#/c/107300/ apply art 107300/2 echo "Applied $PATCHES patches"