diff --git a/cross/armel/sources.list.jessie b/cross/armel/sources.list.jessie new file mode 100644 index 00000000000..3d9c3059d89 --- /dev/null +++ b/cross/armel/sources.list.jessie @@ -0,0 +1,3 @@ +# Debian (jessie) # Stable +deb http://ftp.debian.org/debian/ jessie main contrib non-free +deb-src http://ftp.debian.org/debian/ jessie main contrib non-free diff --git a/cross/armel/tizen-build-rootfs.sh b/cross/armel/tizen-build-rootfs.sh new file mode 100755 index 00000000000..87c48e78fbb --- /dev/null +++ b/cross/armel/tizen-build-rootfs.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +set -e + +__ARM_SOFTFP_CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +__TIZEN_CROSSDIR="$__ARM_SOFTFP_CrossDir/tizen" + +if [[ -z "$ROOTFS_DIR" ]]; then + echo "ROOTFS_DIR is not defined." + exit 1; +fi + +# Clean-up (TODO-Cleanup: We may already delete $ROOTFS_DIR at ./cross/build-rootfs.sh.) +# hk0110 +if [ -d "$ROOTFS_DIR" ]; then + umount $ROOTFS_DIR/* + rm -rf $ROOTFS_DIR +fi + +TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp +mkdir -p $TIZEN_TMP_DIR + +# Download files +echo ">>Start downloading files" +VERBOSE=1 $__ARM_SOFTFP_CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR +echo "<>Start constructing Tizen rootfs" +TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm` +cd $ROOTFS_DIR +for f in $TIZEN_RPM_FILES; do + rpm2cpio $f | cpio -idm --quiet +done +echo "<>Start configuring Tizen rootfs" +rm ./usr/lib/libunwind.so +ln -s libunwind.so.8 ./usr/lib/libunwind.so +ln -sfn asm-arm ./usr/include/asm +patch -p1 < $__TIZEN_CROSSDIR/tizen.patch +echo "</dev/null; then + VERBOSE=0 +fi + +Log() +{ + if [ $VERBOSE -ge $1 ]; then + echo ${@:2} + fi +} + +Inform() +{ + Log 1 -e "\x1B[0;34m$@\x1B[m" +} + +Debug() +{ + Log 2 -e "\x1B[0;32m$@\x1B[m" +} + +Error() +{ + >&2 Log 0 -e "\x1B[0;31m$@\x1B[m" +} + +Fetch() +{ + URL=$1 + FILE=$2 + PROGRESS=$3 + if [ $VERBOSE -ge 1 ] && [ $PROGRESS ]; then + CURL_OPT="--progress-bar" + else + CURL_OPT="--silent" + fi + curl $CURL_OPT $URL > $FILE +} + +hash curl 2> /dev/null || { Error "Require 'curl' Aborting."; exit 1; } +hash xmllint 2> /dev/null || { Error "Require 'xmllint' Aborting."; exit 1; } +hash sha256sum 2> /dev/null || { Error "Require 'sha256sum' Aborting."; exit 1; } + +TMPDIR=$1 +if [ ! -d $TMPDIR ]; then + TMPDIR=./tizen_tmp + Debug "Create temporary directory : $TMPDIR" + mkdir -p $TMPDIR +fi + +TIZEN_URL=http://download.tizen.org/releases/weekly/tizen +BUILD_XML=build.xml +REPOMD_XML=repomd.xml +PRIMARY_XML=primary.xml +TARGET_URL="http://__not_initialized" + +Xpath_get() +{ + XPATH_RESULT='' + XPATH=$1 + XML_FILE=$2 + RESULT=$(xmllint --xpath $XPATH $XML_FILE) + if [[ -z ${RESULT// } ]]; then + Error "Can not find target from $XML_FILE" + Debug "Xpath = $XPATH" + exit 1 + fi + XPATH_RESULT=$RESULT +} + +fetch_tizen_pkgs_init() +{ + TARGET=$1 + PROFILE=$2 + Debug "Initialize TARGET=$TARGET, PROFILE=$PROFILE" + + TMP_PKG_DIR=$TMPDIR/tizen_${PROFILE}_pkgs + if [ -d $TMP_PKG_DIR ]; then rm -rf $TMP_PKG_DIR; fi + mkdir -p $TMP_PKG_DIR + + PKG_URL=$TIZEN_URL/$PROFILE/latest + + BUILD_XML_URL=$PKG_URL/$BUILD_XML + TMP_BUILD=$TMP_PKG_DIR/$BUILD_XML + TMP_REPOMD=$TMP_PKG_DIR/$REPOMD_XML + TMP_PRIMARY=$TMP_PKG_DIR/$PRIMARY_XML + TMP_PRIMARYGZ=${TMP_PRIMARY}.gz + + Fetch $BUILD_XML_URL $TMP_BUILD + + Debug "fetch $BUILD_XML_URL to $TMP_BUILD" + + TARGET_XPATH="//build/buildtargets/buildtarget[@name=\"$TARGET\"]/repo[@type=\"binary\"]/text()" + Xpath_get $TARGET_XPATH $TMP_BUILD + TARGET_PATH=$XPATH_RESULT + TARGET_URL=$PKG_URL/$TARGET_PATH + + REPOMD_URL=$TARGET_URL/repodata/repomd.xml + PRIMARY_XPATH='string(//*[local-name()="data"][@type="primary"]/*[local-name()="location"]/@href)' + + Fetch $REPOMD_URL $TMP_REPOMD + + Debug "fetch $REPOMD_URL to $TMP_REPOMD" + + Xpath_get $PRIMARY_XPATH $TMP_REPOMD + PRIMARY_XML_PATH=$XPATH_RESULT + PRIMARY_URL=$TARGET_URL/$PRIMARY_XML_PATH + + Fetch $PRIMARY_URL $TMP_PRIMARYGZ + + Debug "fetch $PRIMARY_URL to $TMP_PRIMARYGZ" + + gunzip $TMP_PRIMARYGZ + + Debug "unzip $TMP_PRIMARYGZ to $TMP_PRIMARY" +} + +fetch_tizen_pkgs() +{ + PROFILE=$1 + PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]]/*[local-name()="location"]/@href)' + + PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]]/*[local-name()="checksum"]/text())' + + for pkg in ${@:2} + do + Inform "Fetching... $pkg" + XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg} + Xpath_get $XPATH $TMP_PRIMARY + PKG_PATH=$XPATH_RESULT + + XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg} + Xpath_get $XPATH $TMP_PRIMARY + CHECKSUM=$XPATH_RESULT + + PKG_URL=$TARGET_URL/$PKG_PATH + PKG_FILE=$(basename $PKG_PATH) + PKG_PATH=$TMPDIR/$PKG_FILE + + Debug "Download $PKG_URL to $PKG_PATH" + Fetch $PKG_URL $PKG_PATH true + + echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null + if [ $? -ne 0 ]; then + Error "Fail to fetch $PKG_URL to $PKG_PATH" + Debug "Checksum = $CHECKSUM" + exit 1 + fi + + done +} + +Inform "Initialize arm base" +fetch_tizen_pkgs_init arm base +Inform "fetch base common packages" +fetch_tizen_pkgs base gcc glibc glibc-devel linux-glibc-devel +Inform "fetch base coreclr packages" +fetch_tizen_pkgs base lldb lldb-devel libuuid libuuid-devel libgcc libstdc++ libstdc++-devel +Inform "fetch base corefx packages" +fetch_tizen_pkgs base libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel + +Inform "initialize arm mobile" +fetch_tizen_pkgs_init arm-wayland mobile +Inform "fetch mobile common packages" +fetch_tizen_pkgs mobile libicu-devel +Inform "fetch mobile coreclr packages" +fetch_tizen_pkgs mobile libunwind libunwind-devel tizen-release +Inform "fetch mobile corefx packages" +fetch_tizen_pkgs mobile gssdp gssdp-devel krb5 krb5-devel libcurl libcurl-devel + + diff --git a/cross/armel/tizen/tizen.patch b/cross/armel/tizen/tizen.patch new file mode 100644 index 00000000000..c92dc02809a --- /dev/null +++ b/cross/armel/tizen/tizen.patch @@ -0,0 +1,33 @@ +diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so +--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 ++++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf32-littlearm) +-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.3 ) ) ++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.3 ) ) +diff -u -r a/usr/lib/libpthread.so b/usr/lib/libpthread.so +--- a/usr/lib/libpthread.so 2016-12-30 23:00:19.408951841 +0900 ++++ b/usr/lib/libpthread.so 2016-12-30 23:00:39.068951801 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf32-littlearm) +-GROUP ( /lib/libpthread.so.0 /usr/lib/libpthread_nonshared.a ) ++GROUP ( libpthread.so.0 libpthread_nonshared.a ) +diff -u -r a/usr/lib/libpthread.so b/usr/lib/libpthread.so +--- a/etc/os-release 2016-10-17 23:39:36.000000000 +0900 ++++ b/etc/os-release 2017-01-05 14:34:39.099867682 +0900 +@@ -1,7 +1,7 @@ + NAME=Tizen +-VERSION="3.0.0 (Tizen3/Mobile)" ++VERSION="4.0.0 (Tizen4/Mobile)" + ID=tizen +-VERSION_ID=3.0.0 +-PRETTY_NAME="Tizen 3.0.0 (Tizen3/Mobile)" ++VERSION_ID=4.0.0 ++PRETTY_NAME="Tizen 4.0.0 (Tizen4/Mobile)" + ANSI_COLOR="0;36" +-CPE_NAME="cpe:/o:tizen:tizen:3.0.0" ++CPE_NAME="cpe:/o:tizen:tizen:4.0.0" diff --git a/cross/armel/toolchain.cmake b/cross/armel/toolchain.cmake new file mode 100644 index 00000000000..95bff0878b4 --- /dev/null +++ b/cross/armel/toolchain.cmake @@ -0,0 +1,59 @@ +set(CROSS_ROOTFS $ENV{ROOTFS_DIR}) + +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_PROCESSOR armv7l) + +## Specify the toolchain +set(TOOLCHAIN "arm-linux-gnueabi") +set(TOOLCHAIN_PREFIX ${TOOLCHAIN}-) +#set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) +#set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++) +#set(CMAKE_ASM_COMPILER ${TOOLCHAIN_PREFIX}as) +#set(CMAKE_AR ${TOOLCHAIN_PREFIX}ar) +#set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy) +#set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump) + +add_compile_options(-target armv7-linux-gnueabi) +add_compile_options(-mthumb) +add_compile_options(-mfpu=vfpv3) +add_compile_options(--sysroot=${CROSS_ROOTFS}) + +set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target ${TOOLCHAIN}") +set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}") + +if("$ENV{__DistroRid}" MATCHES "tizen.*") + add_compile_options(-I$ENV{ROOTFS_DIR}/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/include/c++/) + add_compile_options(-I$ENV{ROOTFS_DIR}/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/include/c++/armv7l-tizen-linux-gnueabi) + add_compile_options(-Wno-deprecated-declarations) # compile-time option + add_compile_options(-D__extern_always_inline=inline) + set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi/4.9.2") + set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}") + set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}") +else() + # TODO: this setting assumes debian armel rootfs + include_directories(SYSTEM ${CROSS_ROOTFS}/usr/include/c++/4.9 ${CROSS_ROOTFS}/usr/include/${TOOLCHAIN}/c++/4.9 ) + set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}/4.9") + set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}/4.9") +endif() + +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) +set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) + +set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}") +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + +set(LLVM_ARM_DIR "$ENV{LLVM_ARM_HOME}") +if(LLVM_ARM_DIR) + set(WITH_LLDB_LIBS "${LLVM_ARM_DIR}/lib/" CACHE STRING "") + set(WITH_LLDB_INCLUDES "${LLVM_ARM_DIR}/include" CACHE STRING "") + set(LLDB_H "${WITH_LLDB_INCLUDES}" CACHE STRING "") + set(LLDB "${LLVM_ARM_DIR}/lib/liblldb.so" CACHE STRING "") +else() + set(WITH_LLDB_LIBS "${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}" CACHE STRING "") + set(WITH_LLDB_INCLUDES "${CROSS_ROOTFS}/usr/lib/llvm-3.6/include" CACHE STRING "") +endif() diff --git a/cross/armel/tryrun.cmake b/cross/armel/tryrun.cmake new file mode 100644 index 00000000000..26a30e5e409 --- /dev/null +++ b/cross/armel/tryrun.cmake @@ -0,0 +1,123 @@ +SET( REALPATH_SUPPORTS_NONEXISTENT_FILES_EXITCODE + 1 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( SSCANF_SUPPORT_ll_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( SSCANF_CANNOT_HANDLE_MISSING_EXPONENT_EXITCODE + 1 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_LARGE_SNPRINTF_SUPPORT_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_SCHED_GET_PRIORITY_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_WORKING_GETTIMEOFDAY_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_WORKING_CLOCK_GETTIME_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_CLOCK_MONOTONIC_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_MMAP_DEV_ZERO_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS_EXITCODE + 1 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( PTHREAD_CREATE_MODIFIES_ERRNO_EXITCODE + 1 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( SEM_INIT_MODIFIES_ERRNO_EXITCODE + 1 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_COMPATIBLE_ACOS_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_COMPATIBLE_ASIN_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_COMPATIBLE_POW_EXITCODE + 1 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_VALID_NEGATIVE_INF_POW_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_VALID_POSITIVE_INF_POW_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_COMPATIBLE_ATAN2_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_COMPATIBLE_LOG_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_COMPATIBLE_LOG10_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( UNGETC_NOT_RETURN_EOF_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAS_POSIX_SEMAPHORES_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( GETPWUID_R_SETS_ERRNO_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE + 1 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_CLOCK_THREAD_CPUTIME_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_SCHED_GETCPU_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_CLOCK_MONOTONIC_COARSE_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_PROCFS_CTL_EXITCODE + 1 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_PROCFS_MAPS_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_PROCFS_STAT_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) + +SET( HAVE_PROCFS_STATUS_EXITCODE + 0 + CACHE STRING "Result from TRY_RUN" FORCE) diff --git a/cross/build-rootfs.sh b/cross/build-rootfs.sh index 78309f766a5..16c67b116d9 100755 --- a/cross/build-rootfs.sh +++ b/cross/build-rootfs.sh @@ -14,8 +14,11 @@ __BuildArch=arm __UbuntuArch=armhf __UbuntuRepo="http://ports.ubuntu.com/" __UbuntuPackages="build-essential lldb-3.6-dev libunwind8-dev gettext symlinks liblttng-ust-dev libicu-dev" +__LLDB_Package="lldb-3.6-dev" __MachineTriple=arm-linux-gnueabihf __UnprocessedBuildArgs= +__SkipUnmount=0 + for i in "$@" do lowerI="$(echo $i | awk '{print tolower($0)}')" @@ -38,22 +41,84 @@ for i in "$@" __UbuntuPackages="build-essential libunwind8-dev gettext symlinks liblttng-ust-dev libicu-dev" __MachineTriple=aarch64-linux-gnu ;; + armel) + __BuildArch=armel + __UbuntuArch=armel + __UbuntuRepo="http://ftp.debian.org/debian/" + __LinuxCodeName=jessie + ;; + lldb3.6) + __LLDB_Package="lldb-3.6-dev" + ;; + lldb3.8) + __LLDB_Package="lldb-3.8-dev" + ;; + vivid) + if [ "$__LinuxCodeName" != "jessie" ]; then + __LinuxCodeName=vivid + fi + ;; + wily) + if [ "$__LinuxCodeName" != "jessie" ]; then + __LinuxCodeName=wily + fi + ;; + xenial) + if [ "$__LinuxCodeName" != "jessie" ]; then + __LinuxCodeName=xenial + fi + ;; + jessie) + __LinuxCodeName=jessie + __UbuntuRepo="http://ftp.debian.org/debian/" + ;; + tizen) + if [ "$__BuildArch" != "armel" ]; then + echo "Tizen is available only for armel." + usage; + exit 1; + fi + __LinuxCodeName= + __UbuntuRepo= + __Tizen=tizen + ;; + --skipunmount) + __SkipUnmount=1 + ;; *) __UnprocessedBuildArgs="$__UnprocessedBuildArgs $i" esac done +if [ "$__BuildArch" == "armel" ]; then + __LLDB_Package="lldb-3.5-dev" +fi + __RootfsDir="$__CrossDir/rootfs/$__BuildArch" +__UbuntuPackages="$__UbuntuPackagesBase $__LLDB_Package" + if [[ -n "$ROOTFS_DIR" ]]; then __RootfsDir=$ROOTFS_DIR fi -umount $__RootfsDir/* -rm -rf $__RootfsDir -qemu-debootstrap --arch $__UbuntuArch trusty $__RootfsDir $__UbuntuRepo -cp $__CrossDir/$__BuildArch/sources.list $__RootfsDir/etc/apt/sources.list -chroot $__RootfsDir apt-get update -chroot $__RootfsDir apt-get -y install $__UbuntuPackages -chroot $__RootfsDir symlinks -cr /usr -umount $__RootfsDir/* \ No newline at end of file +if [ -d "$__RootfsDir" ]; then + if [ $__SkipUnmount == 0 ]; then + umount $__RootfsDir/* + fi + rm -rf $__RootfsDir +fi + +if [ "$__Tizen" == "tizen" ]; then + ROOTFS_DIR=$__RootfsDir $__CrossDir/$__BuildArch/tizen-build-rootfs.sh +else + qemu-debootstrap --arch $__UbuntuArch trusty $__RootfsDir $__UbuntuRepo + cp $__CrossDir/$__BuildArch/sources.list $__RootfsDir/etc/apt/sources.list + chroot $__RootfsDir apt-get update + chroot $__RootfsDir apt-get -y install $__UbuntuPackages + chroot $__RootfsDir symlinks -cr /usr + + if [ $__SkipUnmount == 0 ]; then + umount $__RootfsDir/* + fi +fi diff --git a/src/Native/Runtime/PalRedhawkCommon.h b/src/Native/Runtime/PalRedhawkCommon.h index de0406a2a54..36f28e85631 100644 --- a/src/Native/Runtime/PalRedhawkCommon.h +++ b/src/Native/Runtime/PalRedhawkCommon.h @@ -62,6 +62,7 @@ struct PAL_LIMITED_CONTEXT UIntNative GetSp() const { return SP; } UIntNative GetFp() const { return R7; } UIntNative GetLr() const { return LR; } + void SetIp(UIntNative ip) { IP = ip; } #elif defined(_TARGET_ARM64_) // @TODO: Add ARM64 registers UIntNative IP; diff --git a/src/Native/Runtime/arm/AllocFast.S b/src/Native/Runtime/arm/AllocFast.S new file mode 100644 index 00000000000..de818954b6a --- /dev/null +++ b/src/Native/Runtime/arm/AllocFast.S @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include + +// TODO: Implement Arm support diff --git a/src/Native/Runtime/arm/AsmOffsetsCpu.h b/src/Native/Runtime/arm/AsmOffsetsCpu.h index 1c1d1978cd2..52f5bb575db 100644 --- a/src/Native/Runtime/arm/AsmOffsetsCpu.h +++ b/src/Native/Runtime/arm/AsmOffsetsCpu.h @@ -8,7 +8,7 @@ // // NOTE: the offsets MUST be in hex notation WITHOUT the 0x prefix -PLAT_ASM_SIZEOF(130, ExInfo) +PLAT_ASM_SIZEOF(148, ExInfo) PLAT_ASM_OFFSET(0, ExInfo, m_pPrevExInfo) PLAT_ASM_OFFSET(4, ExInfo, m_pExContext) PLAT_ASM_OFFSET(8, ExInfo, m_exception) @@ -16,7 +16,7 @@ PLAT_ASM_OFFSET(0c, ExInfo, m_kind) PLAT_ASM_OFFSET(0d, ExInfo, m_passNumber) PLAT_ASM_OFFSET(10, ExInfo, m_idxCurClause) PLAT_ASM_OFFSET(18, ExInfo, m_frameIter) -PLAT_ASM_OFFSET(128, ExInfo, m_notifyDebuggerSP) +PLAT_ASM_OFFSET(140, ExInfo, m_notifyDebuggerSP) PLAT_ASM_OFFSET(4, PInvokeTransitionFrame, m_RIP) PLAT_ASM_OFFSET(8, PInvokeTransitionFrame, m_FramePointer) @@ -24,7 +24,7 @@ PLAT_ASM_OFFSET(0c, PInvokeTransitionFrame, m_pThread) PLAT_ASM_OFFSET(10, PInvokeTransitionFrame, m_dwFlags) PLAT_ASM_OFFSET(14, PInvokeTransitionFrame, m_PreservedRegs) -PLAT_ASM_SIZEOF(110, StackFrameIterator) +PLAT_ASM_SIZEOF(128, StackFrameIterator) PLAT_ASM_OFFSET(08, StackFrameIterator, m_FramePointer) PLAT_ASM_OFFSET(0c, StackFrameIterator, m_ControlPC) PLAT_ASM_OFFSET(10, StackFrameIterator, m_RegDisplay) @@ -44,7 +44,7 @@ PLAT_ASM_OFFSET(20, PAL_LIMITED_CONTEXT, R11) PLAT_ASM_OFFSET(28, PAL_LIMITED_CONTEXT, SP) PLAT_ASM_OFFSET(2c, PAL_LIMITED_CONTEXT, LR) -PLAT_ASM_SIZEOF(88, REGDISPLAY) +PLAT_ASM_SIZEOF(a0, REGDISPLAY) PLAT_ASM_OFFSET(38, REGDISPLAY, SP) PLAT_ASM_OFFSET(10, REGDISPLAY, pR4) diff --git a/src/Native/Runtime/arm/CallDescrWorker.S b/src/Native/Runtime/arm/CallDescrWorker.S new file mode 100644 index 00000000000..de818954b6a --- /dev/null +++ b/src/Native/Runtime/arm/CallDescrWorker.S @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include + +// TODO: Implement Arm support diff --git a/src/Native/Runtime/arm/CallingConventionConverterHelpers.S b/src/Native/Runtime/arm/CallingConventionConverterHelpers.S new file mode 100644 index 00000000000..de818954b6a --- /dev/null +++ b/src/Native/Runtime/arm/CallingConventionConverterHelpers.S @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include + +// TODO: Implement Arm support diff --git a/src/Native/Runtime/arm/ExceptionHandling.S b/src/Native/Runtime/arm/ExceptionHandling.S new file mode 100644 index 00000000000..de818954b6a --- /dev/null +++ b/src/Native/Runtime/arm/ExceptionHandling.S @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include + +// TODO: Implement Arm support diff --git a/src/Native/Runtime/arm/PInvoke.S b/src/Native/Runtime/arm/PInvoke.S new file mode 100644 index 00000000000..de818954b6a --- /dev/null +++ b/src/Native/Runtime/arm/PInvoke.S @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include + +// TODO: Implement Arm support diff --git a/src/Native/Runtime/arm/UniversalTransition.S b/src/Native/Runtime/arm/UniversalTransition.S new file mode 100644 index 00000000000..de818954b6a --- /dev/null +++ b/src/Native/Runtime/arm/UniversalTransition.S @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include + +// TODO: Implement Arm support diff --git a/src/Native/Runtime/coreclr/gcinfodecoder.cpp b/src/Native/Runtime/coreclr/gcinfodecoder.cpp index 1a8eb7ecaad..c9eddc2242a 100644 --- a/src/Native/Runtime/coreclr/gcinfodecoder.cpp +++ b/src/Native/Runtime/coreclr/gcinfodecoder.cpp @@ -1476,7 +1476,11 @@ OBJECTREF* GcInfoDecoder::GetRegisterSlot( _ASSERTE(regNum >= 0 && regNum <= 14); _ASSERTE(regNum != 13); // sp +#ifdef FEATURE_REDHAWK + PTR_UIntNative *ppReg; +#else DWORD **ppReg; +#endif if(regNum <= 3) { diff --git a/src/Native/Runtime/regdisplay.h b/src/Native/Runtime/regdisplay.h index 098286b2e0c..d68b84ad3ef 100644 --- a/src/Native/Runtime/regdisplay.h +++ b/src/Native/Runtime/regdisplay.h @@ -49,6 +49,36 @@ struct REGDISPLAY #elif defined(_TARGET_ARM_) +typedef struct _ArmVolatileContextPointer +{ + PTR_UIntNative R0; + PTR_UIntNative R1; + PTR_UIntNative R2; + PTR_UIntNative R3; + PTR_UIntNative R12; +} ArmVolatileContextPointer; + +typedef struct _ArmNonVolatileContextPointer { + PTR_UIntNative R4; + PTR_UIntNative R5; + PTR_UIntNative R6; + PTR_UIntNative R7; + PTR_UIntNative R8; + PTR_UIntNative R9; + PTR_UIntNative R10; + PTR_UIntNative R11; + PTR_UIntNative Lr; + + PTR_UInt64 D8; + PTR_UInt64 D9; + PTR_UInt64 D10; + PTR_UInt64 D11; + PTR_UInt64 D12; + PTR_UInt64 D13; + PTR_UInt64 D14; + PTR_UInt64 D15; +} ArmNonVolatileContextPointer; + struct REGDISPLAY { PTR_UIntNative pR0; @@ -75,6 +105,9 @@ struct REGDISPLAY // for EH, but not adjusted, so we only need // their values, not their addresses + ArmNonVolatileContextPointer *pCurrentContextPointers; + ArmVolatileContextPointer volatileCurrContextPointers; + inline PCODE GetIP() { return IP; } inline PTR_PCODE GetAddrOfIP() { return pIP; } inline UIntNative GetSP() { return SP; } diff --git a/src/Native/Runtime/unix/UnixContext.cpp b/src/Native/Runtime/unix/UnixContext.cpp index 02caacf8fde..38933096682 100644 --- a/src/Native/Runtime/unix/UnixContext.cpp +++ b/src/Native/Runtime/unix/UnixContext.cpp @@ -207,12 +207,12 @@ static void RegDisplayToUnwindContext(REGDISPLAY* regDisplay, unw_context_t *unw // initialized by unw_init_local(), which are not updated by // unw_set_reg(). -#define ASSIGN_REG(regIndex, regName) \ - unwContext->regs[regIndex] = regDisplay->regName2; +#define ASSIGN_REG(regIndex, regName) \ + unwContext->data[regIndex] = (uint64_t)(regDisplay->regName); #define ASSIGN_REG_PTR(regIndex, regName) \ - if (regDisplay->p##regName2 != NULL) \ - unwContext->regs[regIndex] = *(regDisplay->p##regName2); + if (regDisplay->p##regName != NULL) \ + unwContext->data[regIndex] = (uint64_t)*(regDisplay->p##regName); ASSIGN_REG_PTR(4, R4); ASSIGN_REG_PTR(5, R5); diff --git a/src/Native/libunwind/include/__libunwind_config.h b/src/Native/libunwind/include/__libunwind_config.h index 17a1a192db9..93a3be1eb96 100644 --- a/src/Native/libunwind/include/__libunwind_config.h +++ b/src/Native/libunwind/include/__libunwind_config.h @@ -44,8 +44,8 @@ # define _LIBUNWIND_CONTEXT_SIZE 76 # define _LIBUNWIND_CURSOR_SIZE 83 # else -# define _LIBUNWIND_CONTEXT_SIZE 58 -# define _LIBUNWIND_CURSOR_SIZE 65 +# define _LIBUNWIND_CONTEXT_SIZE 50 +# define _LIBUNWIND_CURSOR_SIZE 57 # endif # define _LIBUNWIND_HIGHEST_DWARF_REGISTER 96 # elif defined(__or1k__)