From 265435623d576d8fb690de658e5b744916e77d65 Mon Sep 17 00:00:00 2001 From: Ben Pye Date: Tue, 4 Aug 2015 18:10:46 +0100 Subject: Add cross compilation support for ARM and ARM64. --- src/pal/inc/unixasmmacrosarm64.inc | 11 +++++++++++ src/pal/tools/gen-buildsys-clang.sh | 19 +++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/pal/inc/unixasmmacrosarm64.inc b/src/pal/inc/unixasmmacrosarm64.inc index dbed7b6123..e5d8ce3353 100644 --- a/src/pal/inc/unixasmmacrosarm64.inc +++ b/src/pal/inc/unixasmmacrosarm64.inc @@ -3,6 +3,17 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. // +.macro NESTED_ENTRY Name, Section, Handler + LEAF_ENTRY \Name, \Section + .ifnc \Handler, NoHandler + .cfi_personality 0, C_FUNC(\Handler) // 0 == DW_EH_PE_absptr + .endif +.endm + +.macro NESTED_END Name, Section + LEAF_END \Name, \Section +.endm + .macro PATCH_LABEL Name .global C_FUNC(\Name) C_FUNC(\Name): 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 [build flavor]" + echo "gen-buildsys-clang.sh [build flavor]" echo "Specify the path to the top level CMake file - /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" \ -- cgit v1.2.3