summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Rosenkraenzer <bero@linaro.org>2017-08-22 12:30:59 +0200
committerBernhard Rosenkraenzer <bero@linaro.org>2017-08-22 12:30:59 +0200
commitd5488e80af8afcea18c52aa43645c4756a6dca1f (patch)
tree9a60df9f9f0ab7247983ca62cc80844e7a404056
parent40b246a3b04ab1cb527bc0937aba25dc69919773 (diff)
downloadaarch64-buildhosts-d5488e80af8afcea18c52aa43645c4756a6dca1f.tar.gz
Add extra patches, helper scripts
-rwxr-xr-xbuild-prebuilts14
-rw-r--r--build_make-aarch64-host.patch137
-rw-r--r--build_tools-aarch64-host.patch115
-rwxr-xr-xdo_build5
-rw-r--r--llvm-5.0-libc++-libc++abi-dependency.patch20
-rwxr-xr-xpatch-aosp28
6 files changed, 64 insertions, 255 deletions
diff --git a/build-prebuilts b/build-prebuilts
index 97101b4..3c99285 100755
--- a/build-prebuilts
+++ b/build-prebuilts
@@ -11,8 +11,8 @@ export OPTFLAGS="-O2"
export WITH_TESTS=true
NINJA_VERSION=1.7.2
-LLVM_REV=tags/RELEASE_401/final
-CLANG_VERSION=4.0.1
+LLVM_REV=branches/release_50 #tags/RELEASE_401/final
+CLANG_VERSION=5.0 #4.0.1
GO_VERSION=1.8
BINUTILS_VERSION=2.28
GCC_VERSION=linaro-snapshot-6.3-2017.05
@@ -109,7 +109,11 @@ else
svn co http://llvm.org/svn/llvm-project/libcxx/$LLVM_REV llvm/projects/libcxx
svn co http://llvm.org/svn/llvm-project/libcxxabi/$LLVM_REV llvm/projects/libcxxabi
cd llvm
- patch -p1 <$MYDIR/llvm-4.0-libc++-libc++abi-dependency.patch
+ if [ $(echo $CLANG_VERSION |cut -d. -f1) -lt 5 ]; then
+ patch -p1 <$MYDIR/llvm-4.0-libc++-libc++abi-dependency.patch
+ else
+ patch -p1 <$MYDIR/llvm-5.0-libc++-libc++abi-dependency.patch
+ fi
cd ..
fi
fi
@@ -216,6 +220,10 @@ if $EVIL_WORKAROUND; then
cp -af llvm/llvm/lib/Fuzzer/*.h ${OUTDIR}/prebuilts/clang/host/linux-x86/clang-${CLANG_VERSION}/prebuilt_include/llvm/lib/Fuzzer/
fi
+# Inject soong related build files that aren't part of llvm/clang
+[ -d linux-x86 ] || git clone --depth 1 https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86
+cp -a linux-x86/soong ${OUTDIR}/prebuilts/clang/host/$OS-$ARCH/clang-${CLANG_VERSION}/
+[ "$ARCH" != "x86" ] && sed -i -e "s,x86,$ARCH,g" ${OUTDIR}/prebuilts/clang/host/$OS-$ARCH/clang-${CLANG_VERSION}/soong/*
##############################################################################
### Build go ###
diff --git a/build_make-aarch64-host.patch b/build_make-aarch64-host.patch
index d864ad9..c9099fc 100644
--- a/build_make-aarch64-host.patch
+++ b/build_make-aarch64-host.patch
@@ -1,140 +1,3 @@
-diff --git a/core/config.mk b/core/config.mk
-index 5ff582a13..7ff3b368f 100644
---- a/core/config.mk
-+++ b/core/config.mk
-@@ -383,7 +383,7 @@ ifeq (,$(filter 1 true,$(WITH_TIDY_ONLY)))
- endif
-
- PATH_TO_CLANG_TIDY := \
-- $(LLVM_PREBUILTS_BASE)/$(BUILD_OS)-x86/$(LLVM_PREBUILTS_VERSION)/bin/clang-tidy
-+ $(LLVM_PREBUILTS_BASE)/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/$(LLVM_PREBUILTS_VERSION)/bin/clang-tidy
- ifeq ($(wildcard $(PATH_TO_CLANG_TIDY)),)
- ifneq (,$(filter 1 true,$(WITH_TIDY)))
- $(warning *** Disable WITH_TIDY because $(PATH_TO_CLANG_TIDY) does not exist)
-diff --git a/core/envsetup.mk b/core/envsetup.mk
-index 43593e63c..acf755f15 100644
---- a/core/envsetup.mk
-+++ b/core/envsetup.mk
-@@ -116,13 +116,15 @@ HOST_OS_EXTRA:=$(shell python -c "import platform; print(platform.platform())")
- BUILD_OS := $(HOST_OS)
-
- HOST_CROSS_OS :=
--# We can cross-build Windows binaries on Linux
-+# We can cross-build Windows binaries on x86 Linux
- ifeq ($(HOST_OS),linux)
-+ifeq ($(HOST_ARCH),x86)
- HOST_CROSS_OS := windows
- HOST_CROSS_ARCH := x86
- HOST_CROSS_2ND_ARCH := x86_64
- 2ND_HOST_CROSS_IS_64_BIT := true
- endif
-+endif
-
- ifeq ($(HOST_OS),)
- $(error Unable to determine HOST_OS from uname -sm: $(UNAME)!)
-@@ -134,10 +136,15 @@ ifneq (,$(findstring x86_64,$(UNAME)))
- HOST_2ND_ARCH := x86
- HOST_IS_64_BIT := true
- else
-+ifneq (,$(findstring aarch64,$(UNAME)))
-+ HOST_ARCH := arm64
-+ HOST_IS_64_BIT := true
-+else
- ifneq (,$(findstring i686,$(UNAME))$(findstring x86,$(UNAME)))
- $(error Building on a 32-bit x86 host is not supported: $(UNAME)!)
- endif
- endif
-+endif
-
- BUILD_ARCH := $(HOST_ARCH)
- BUILD_2ND_ARCH := $(HOST_2ND_ARCH)
-@@ -157,8 +164,12 @@ $(error HOST_BUILD_TYPE must be either release or debug, not '$(HOST_BUILD_TYPE)
- endif
- endif
-
-+ifneq (,$(findstring x86_64,$(UNAME)))
- # We don't want to move all the prebuilt host tools to a $(HOST_OS)-x86_64 dir.
- HOST_PREBUILT_ARCH := x86
-+else
-+HOST_PREBUILT_ARCH := $(HOST_ARCH)
-+endif
- # This is the standard way to name a directory containing prebuilt host
- # objects. E.g., prebuilt/$(HOST_PREBUILT_TAG)/cc
- HOST_PREBUILT_TAG := $(BUILD_OS)-$(HOST_PREBUILT_ARCH)
-diff --git a/core/main.mk b/core/main.mk
-index bc4ed0421..34e87f6ec 100644
---- a/core/main.mk
-+++ b/core/main.mk
-@@ -14,6 +14,12 @@ ifndef KATI
- host_prebuilts := linux-x86
- ifeq ($(shell uname),Darwin)
- host_prebuilts := darwin-x86
-+else
-+ifeq (aarch64,$(shell uname -m))
-+host_prebuilts := linux-arm64
-+else
-+ $(error not arm64)
-+endif
- endif
-
- .PHONY: run_soong_ui
-diff --git a/core/soong_config.mk b/core/soong_config.mk
-index e21083d7c..09d4b5814 100644
---- a/core/soong_config.mk
-+++ b/core/soong_config.mk
-@@ -71,11 +71,11 @@ $(SOONG_VARIABLES): FORCE
- echo ' "DeviceSecondaryAbi": ["$(TARGET_2ND_CPU_ABI)", "$(TARGET_2ND_CPU_ABI2)"],'; \
- echo ''; \
- echo ' "HostArch": "$(HOST_ARCH)",'; \
-- echo ' "HostSecondaryArch": "$(HOST_2ND_ARCH)",'; \
-+ test $(shell uname -m) = aarch64 || echo ' "HostSecondaryArch": "$(HOST_2ND_ARCH)",'; \
- echo ''; \
-- echo ' "CrossHost": "$(HOST_CROSS_OS)",'; \
-- echo ' "CrossHostArch": "$(HOST_CROSS_ARCH)",'; \
-- echo ' "CrossHostSecondaryArch": "$(HOST_CROSS_2ND_ARCH)",'; \
-+ test $(shell uname -m) = aarch64 || echo ' "CrossHost": "$(HOST_CROSS_OS)",'; \
-+ test $(shell uname -m) = aarch64 || echo ' "CrossHostArch": "$(HOST_CROSS_ARCH)",'; \
-+ test $(shell uname -m) = aarch64 || echo ' "CrossHostSecondaryArch": "$(HOST_CROSS_2ND_ARCH)",'; \
- echo ' "Safestack": $(if $(filter true,$(USE_SAFESTACK)),true,false),'; \
- echo ' "EnableCFI": $(if $(filter false,$(ENABLE_CFI)),false,true),'; \
- echo ' "Device_uses_hwc2": $(if $(filter true,$(TARGET_USES_HWC2)),true,false),'; \
-diff --git a/envsetup.sh b/envsetup.sh
-index b71a8256a..aa400e4c7 100644
---- a/envsetup.sh
-+++ b/envsetup.sh
-@@ -728,7 +728,9 @@ function getdriver()
- # c++-analyzer and ccc-analyzer.
- local CLANG_VERSION=$(get_build_var LLVM_PREBUILTS_VERSION)
- local BUILD_OS=$(get_build_var BUILD_OS)
-- local CLANG_DIR="$T/prebuilts/clang/host/${BUILD_OS}-x86/${CLANG_VERSION}"
-+ local BUILD_ARCH="x86"
-+ test $(uname -m) = "aarch64" && BUILD_ARCH=arm64
-+ local CLANG_DIR="$T/prebuilts/clang/host/${BUILD_OS}-${BUILD_ARCH}/${CLANG_VERSION}"
- echo "\
- ${CLANG_DIR}/tools/scan-build/bin/scan-build \
- --use-analyzer ${CLANG_DIR}/bin/clang \
-diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
-index 652fadf56..17d851b3c 100644
---- a/tools/releasetools/common.py
-+++ b/tools/releasetools/common.py
-@@ -38,10 +38,15 @@ from hashlib import sha1 as sha1
-
- class Options(object):
- def __init__(self):
-- platform_search_path = {
-+ if platform.processor() == 'aarch64':
-+ platform_search_path = {
-+ "linux2": "out/host/linux-arm64",
-+ }
-+ else:
-+ platform_search_path = {
- "linux2": "out/host/linux-x86",
- "darwin": "out/host/darwin-x86",
-- }
-+ }
-
- self.search_path = platform_search_path.get(sys.platform, None)
- self.signapk_path = "framework/signapk.jar" # Relative to search_path
--- /dev/null 2017-05-30 12:59:06.809484016 +0000
+++ make/core/clang/HOST_arm.mk 2017-06-08 16:05:39.563015342 +0000
@@ -0,0 +1 @@
diff --git a/build_tools-aarch64-host.patch b/build_tools-aarch64-host.patch
index 256970e..6593217 100644
--- a/build_tools-aarch64-host.patch
+++ b/build_tools-aarch64-host.patch
@@ -1,118 +1,3 @@
-diff --git a/core/config.mk b/core/config.mk
-index 5ff582a13..7ff3b368f 100644
---- a/core/config.mk
-+++ b/core/config.mk
-@@ -383,7 +383,7 @@ ifeq (,$(filter 1 true,$(WITH_TIDY_ONLY)))
- endif
-
- PATH_TO_CLANG_TIDY := \
-- $(LLVM_PREBUILTS_BASE)/$(BUILD_OS)-x86/$(LLVM_PREBUILTS_VERSION)/bin/clang-tidy
-+ $(LLVM_PREBUILTS_BASE)/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/$(LLVM_PREBUILTS_VERSION)/bin/clang-tidy
- ifeq ($(wildcard $(PATH_TO_CLANG_TIDY)),)
- ifneq (,$(filter 1 true,$(WITH_TIDY)))
- $(warning *** Disable WITH_TIDY because $(PATH_TO_CLANG_TIDY) does not exist)
-diff --git a/core/envsetup.mk b/core/envsetup.mk
-index 43593e63c..acf755f15 100644
---- a/core/envsetup.mk
-+++ b/core/envsetup.mk
-@@ -116,13 +116,15 @@ HOST_OS_EXTRA:=$(shell python -c "import platform; print(platform.platform())")
- BUILD_OS := $(HOST_OS)
-
- HOST_CROSS_OS :=
--# We can cross-build Windows binaries on Linux
-+# We can cross-build Windows binaries on x86 Linux
- ifeq ($(HOST_OS),linux)
-+ifeq ($(HOST_ARCH),x86)
- HOST_CROSS_OS := windows
- HOST_CROSS_ARCH := x86
- HOST_CROSS_2ND_ARCH := x86_64
- 2ND_HOST_CROSS_IS_64_BIT := true
- endif
-+endif
-
- ifeq ($(HOST_OS),)
- $(error Unable to determine HOST_OS from uname -sm: $(UNAME)!)
-@@ -134,10 +136,15 @@ ifneq (,$(findstring x86_64,$(UNAME)))
- HOST_2ND_ARCH := x86
- HOST_IS_64_BIT := true
- else
-+ifneq (,$(findstring aarch64,$(UNAME)))
-+ HOST_ARCH := arm64
-+ HOST_IS_64_BIT := true
-+else
- ifneq (,$(findstring i686,$(UNAME))$(findstring x86,$(UNAME)))
- $(error Building on a 32-bit x86 host is not supported: $(UNAME)!)
- endif
- endif
-+endif
-
- BUILD_ARCH := $(HOST_ARCH)
- BUILD_2ND_ARCH := $(HOST_2ND_ARCH)
-@@ -157,8 +164,12 @@ $(error HOST_BUILD_TYPE must be either release or debug, not '$(HOST_BUILD_TYPE)
- endif
- endif
-
-+ifneq (,$(findstring x86_64,$(UNAME)))
- # We don't want to move all the prebuilt host tools to a $(HOST_OS)-x86_64 dir.
- HOST_PREBUILT_ARCH := x86
-+else
-+HOST_PREBUILT_ARCH := $(HOST_ARCH)
-+endif
- # This is the standard way to name a directory containing prebuilt host
- # objects. E.g., prebuilt/$(HOST_PREBUILT_TAG)/cc
- HOST_PREBUILT_TAG := $(BUILD_OS)-$(HOST_PREBUILT_ARCH)
-diff --git a/core/main.mk b/core/main.mk
-index bc4ed0421..34e87f6ec 100644
---- a/core/main.mk
-+++ b/core/main.mk
-@@ -14,6 +14,12 @@ ifndef KATI
- host_prebuilts := linux-x86
- ifeq ($(shell uname),Darwin)
- host_prebuilts := darwin-x86
-+else
-+ifeq (aarch64,$(shell uname -m))
-+host_prebuilts := linux-arm64
-+else
-+ $(error not arm64)
-+endif
- endif
-
- .PHONY: run_soong_ui
-diff --git a/core/soong_config.mk b/core/soong_config.mk
-index e21083d7c..09d4b5814 100644
---- a/core/soong_config.mk
-+++ b/core/soong_config.mk
-@@ -71,11 +71,11 @@ $(SOONG_VARIABLES): FORCE
- echo ' "DeviceSecondaryAbi": ["$(TARGET_2ND_CPU_ABI)", "$(TARGET_2ND_CPU_ABI2)"],'; \
- echo ''; \
- echo ' "HostArch": "$(HOST_ARCH)",'; \
-- echo ' "HostSecondaryArch": "$(HOST_2ND_ARCH)",'; \
-+ test $(shell uname -m) = aarch64 || echo ' "HostSecondaryArch": "$(HOST_2ND_ARCH)",'; \
- echo ''; \
-- echo ' "CrossHost": "$(HOST_CROSS_OS)",'; \
-- echo ' "CrossHostArch": "$(HOST_CROSS_ARCH)",'; \
-- echo ' "CrossHostSecondaryArch": "$(HOST_CROSS_2ND_ARCH)",'; \
-+ test $(shell uname -m) = aarch64 || echo ' "CrossHost": "$(HOST_CROSS_OS)",'; \
-+ test $(shell uname -m) = aarch64 || echo ' "CrossHostArch": "$(HOST_CROSS_ARCH)",'; \
-+ test $(shell uname -m) = aarch64 || echo ' "CrossHostSecondaryArch": "$(HOST_CROSS_2ND_ARCH)",'; \
- echo ' "Safestack": $(if $(filter true,$(USE_SAFESTACK)),true,false),'; \
- echo ' "EnableCFI": $(if $(filter false,$(ENABLE_CFI)),false,true),'; \
- echo ' "Device_uses_hwc2": $(if $(filter true,$(TARGET_USES_HWC2)),true,false),'; \
-diff --git a/envsetup.sh b/envsetup.sh
-index b71a8256a..aa400e4c7 100644
---- a/envsetup.sh
-+++ b/envsetup.sh
-@@ -728,7 +728,9 @@ function getdriver()
- # c++-analyzer and ccc-analyzer.
- local CLANG_VERSION=$(get_build_var LLVM_PREBUILTS_VERSION)
- local BUILD_OS=$(get_build_var BUILD_OS)
-- local CLANG_DIR="$T/prebuilts/clang/host/${BUILD_OS}-x86/${CLANG_VERSION}"
-+ local BUILD_ARCH="x86"
-+ test $(uname -m) = "aarch64" && BUILD_ARCH=arm64
-+ local CLANG_DIR="$T/prebuilts/clang/host/${BUILD_OS}-${BUILD_ARCH}/${CLANG_VERSION}"
- echo "\
- ${CLANG_DIR}/tools/scan-build/bin/scan-build \
- --use-analyzer ${CLANG_DIR}/bin/clang \
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 652fadf56..17d851b3c 100644
--- a/tools/releasetools/common.py
diff --git a/do_build b/do_build
new file mode 100755
index 0000000..929feb4
--- /dev/null
+++ b/do_build
@@ -0,0 +1,5 @@
+#!/bin/sh
+rm -rf out
+. build/envsetup.sh
+lunch hikey-userdebug
+make LLVM_PREBUILTS_VERSION="clang-4.0.1" LLVM_PREBUILTS_BASE="clang-4.0.1" TARGET_GCC_VERSION_EXP=6.3 FORCE_BUILD_LLVM_COMPONENTS=true droidcore
diff --git a/llvm-5.0-libc++-libc++abi-dependency.patch b/llvm-5.0-libc++-libc++abi-dependency.patch
new file mode 100644
index 0000000..4116bf7
--- /dev/null
+++ b/llvm-5.0-libc++-libc++abi-dependency.patch
@@ -0,0 +1,20 @@
+--- llvm/projects/libcxx/lib/CMakeLists.txt.omv~ 2017-06-08 21:41:58.711179229 +0000
++++ llvm/projects/libcxx/lib/CMakeLists.txt 2017-06-08 21:42:21.121479585 +0000
+@@ -195,7 +195,7 @@ set(LIBCXX_TARGETS)
+ # Build the shared library.
+ if (LIBCXX_ENABLE_SHARED)
+ add_library(cxx_shared SHARED $<TARGET_OBJECTS:cxx_objects>)
+- target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES})
++ target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES} cxxabi_shared)
+ set_target_properties(cxx_shared
+ PROPERTIES
+ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
+@@ -242,7 +242,7 @@ endif()
+ # Build the static library.
+ if (LIBCXX_ENABLE_STATIC)
+ add_library(cxx_static STATIC $<TARGET_OBJECTS:cxx_objects>)
+- target_link_libraries(cxx_static ${LIBCXX_LIBRARIES})
++ target_link_libraries(cxx_static ${LIBCXX_LIBRARIES} cxxabi_static)
+ set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
+ set_target_properties(cxx_static
+ PROPERTIES
diff --git a/patch-aosp b/patch-aosp
new file mode 100755
index 0000000..e693613
--- /dev/null
+++ b/patch-aosp
@@ -0,0 +1,28 @@
+#!/bin/sh
+if ! [ -d bionic ]; then
+ echo "Please run this script from a fresh AOSP master checkout."
+ exit 1
+fi
+
+set -x
+set -e
+
+PATCHDIR=$(realpath $(dirname $0))
+
+#binutils-2.25aosp-gcc7-buildfix.patch
+cd bionic
+patch -p1 -b -z .bi64~ <$PATCHDIR/bionic-aarch64-host.patch
+cd ../build/core
+patch -p2 -b -z .bc64~ <$PATCHDIR/build_core-aarch64-host.patch
+cd ../make
+patch -p1 -b -z .bm64~ <$PATCHDIR/build_make-aarch64-host.patch
+cd ../soong
+patch -p1 -b -z .bs64~ <$PATCHDIR/build_soong-aarch64-host.patch
+cd ../tools
+patch -p2 -b -z .bt64~ <$PATCHDIR/build_tools-aarch64-host.patch
+#llvm-4.0-libc++-libc++abi-dependency.patch
+#ndk-diffs.patch
+#ndk-libc++-bionic.patch
+#ndkrepo-aarch64-host.patch
+cd ../../prebuilts/build-tools
+patch -p1 -b -z .pb64~ <$PATCHDIR/prebuilts_build-tools-aarch64-host.patch