summaryrefslogtreecommitdiff
path: root/src/pal/tools
diff options
context:
space:
mode:
authorMatt Mitchell <mmitche@microsoft.com>2015-08-05 16:59:34 -0700
committerMatt Mitchell <mmitche@microsoft.com>2015-08-05 16:59:34 -0700
commitf61a9bf5fc676bd9384458fad8433391cc0f0a9b (patch)
tree6a67bcf9176fbfb607416fc8f5c024792b2a44cd /src/pal/tools
parentf86d9bd03c21d07e934e5bde1eb54dfecececced (diff)
parent3587984322e62e7035234ad72a2d22797e10fd9a (diff)
downloadcoreclr-f61a9bf5fc676bd9384458fad8433391cc0f0a9b.tar.gz
coreclr-f61a9bf5fc676bd9384458fad8433391cc0f0a9b.tar.bz2
coreclr-f61a9bf5fc676bd9384458fad8433391cc0f0a9b.zip
Merge pull request #1343 from benpye/cross-compilation
Add cross compilation support for ARM and ARM64
Diffstat (limited to 'src/pal/tools')
-rwxr-xr-xsrc/pal/tools/gen-buildsys-clang.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/pal/tools/gen-buildsys-clang.sh b/src/pal/tools/gen-buildsys-clang.sh
index 91ac5c821a..c9f915ed7c 100755
--- a/src/pal/tools/gen-buildsys-clang.sh
+++ b/src/pal/tools/gen-buildsys-clang.sh
@@ -3,12 +3,13 @@
# This file invokes cmake and generates the build system for gcc.
#
-if [ $# -lt 3 -o $# -gt 4 ]
+if [ $# -lt 4 -o $# -gt 5 ]
then
echo "Usage..."
- echo "gen-buildsys-clang.sh <path to top level CMakeLists.txt> <ClangMajorVersion> <ClangMinorVersion> [build flavor]"
+ echo "gen-buildsys-clang.sh <path to top level CMakeLists.txt> <ClangMajorVersion> <ClangMinorVersion> <Architecture> [build flavor]"
echo "Specify the path to the top level CMake file - <ProjectK>/src/NDP"
echo "Specify the clang version to use, split into major and minor version"
+ echo "Specify the target architecture."
echo "Optionally specify the build configuration (flavor.) Defaults to DEBUG."
exit 1
fi
@@ -31,14 +32,16 @@ else
exit 1
fi
+build_arch="$4"
+
# Possible build types are DEBUG, RELEASE, RELWITHDEBINFO, MINSIZEREL.
# Default to DEBUG
-if [ -z "$4" ]
+if [ -z "$5" ]
then
echo "Defaulting to DEBUG build."
buildtype="DEBUG"
else
- buildtype="$4"
+ buildtype="$5"
fi
OS=`uname`
@@ -102,6 +105,14 @@ fi
if [[ -n "$LLDB_INCLUDE_DIR" ]]; then
cmake_extra_defines="$cmake_extra_defines -DWITH_LLDB_INCLUDES=$LLDB_INCLUDE_DIR"
fi
+if [[ -n "$CROSSCOMPILE" ]]; then
+ if ! [[ -n "$ROOTFS_DIR" ]]; then
+ echo "ROOTFS_DIR not set for crosscompile"
+ exit 1
+ fi
+ cmake_extra_defines="$cmake_extra_defines -C $1/cross/$build_arch/tryrun.cmake"
+ cmake_extra_defines="$cmake_extra_defines -DCMAKE_TOOLCHAIN_FILE=$1/cross/$build_arch/toolchain.cmake"
+fi
cmake \
"-DCMAKE_USER_MAKE_RULES_OVERRIDE=$1/src/pal/tools/clang-compiler-override.txt" \