提交 e673cd54 编写于 作者: G Gaurav Khanna 提交者: GitHub

Merge pull request dotnet/corefx#14843 from chunseoklee/armel_ci

Enable armel for CI script

Commit migrated from https://github.com/dotnet/corefx/commit/f053a6cb8cf24cc1ce41f3f216819ebc0af83408
......@@ -20,6 +20,36 @@ usage()
exit 1
}
initHostDistroRid()
{
if [ "$__HostOS" == "Linux" ]; then
if [ ! -e /etc/os-release ]; then
echo "WARNING: Can not determine runtime id for current distro."
__HostDistroRid=""
else
source /etc/os-release
__HostDistroRid="$ID.$VERSION_ID-$__HostArch"
fi
fi
}
initTargetDistroRid()
{
if [ $__CrossBuild == 1 ]; then
if [ "$__BuildOS" == "Linux" ]; then
if [ ! -e $ROOTFS_DIR/etc/os-release ]; then
echo "WARNING: Can not determine runtime id for current distro."
export __DistroRid=""
else
source $ROOTFS_DIR/etc/os-release
export __DistroRid="$ID.$VERSION_ID-$__BuildArch"
fi
fi
else
export __DistroRid="$__HostDistroRid"
fi
}
setup_dirs()
{
echo Setting up directories for build
......@@ -272,6 +302,12 @@ if [ "$__CrossBuild" == 1 ]; then
fi
fi
# init the host distro name
initHostDistroRid
# init the target distro name
initTargetDistroRid
# Check prereqs.
check_native_prereqs
......
......@@ -11,6 +11,16 @@ add_compile_options(-mthumb)
add_compile_options(-mfpu=vfpv3)
add_compile_options(-mfloat-abi=softfp)
add_compile_options(--sysroot=${CROSS_ROOTFS})
if("$ENV{__DistroRid}" MATCHES "tizen.*")
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/include/c++/ ${CROSS_ROOTFS}/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) # compile-time option
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/usr/lib")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2")
endif()
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target ${TOOLCHAIN}")
set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}")
......
......@@ -389,7 +389,7 @@ def testNugetRuntimeIdConfiguration = ['Debug': 'win7-x86',
// Call the arm32_ci_script.sh script to perform the cross build of native corefx
def script = "./scripts/arm32_ci_script.sh --emulatorPath=${armemul_path} --mountPath=${armrootfs_mountpath} --buildConfig=${configurationGroup.toLowerCase()} --verbose"
if (abi == "SoftFP") {
script += " --softfp"
script += " --armel"
}
shell(script)
......
......@@ -12,7 +12,7 @@ function usage {
echo ' --emulatorPath=/opt/linux-arm-emulator'
echo ' --mountPath=/opt/linux-arm-emulator-root'
echo ' --buildConfig=Release'
echo ' --softfp'
echo ' --armel'
echo ' --verbose'
echo ''
echo 'Required Arguments:'
......@@ -23,7 +23,7 @@ function usage {
echo ' --buildConfig=<config> : The value of config should be either Debug or Release'
echo ' Any other value is not accepted'
echo 'Optional Arguments:'
echo ' --softfp : Build as arm-softfp'
echo ' --armel : Build as armel'
echo ' -v --verbose : Build made verbose'
echo ' -h --help : Prints this usage message and exits'
echo ''
......@@ -165,24 +165,17 @@ function mount_emulator {
#Cross builds corefx
function cross_build_corefx {
#Apply fixes for softfp
if [ "$__buildArch" == "arm-softfp" ]; then
#Apply fixes for armel
if [ "$__buildArch" == "armel" ]; then
#Export the needed environment variables
(set +x; echo 'Exporting LINUX_ARM_* environment variable')
source "$__ARMRootfsMountPath"/dotnet/setenv/setenv_incpath.sh "$__ARMRootfsMountPath"
#Apply the changes needed to build for the emulator rootfs
(set +x; echo 'Applying cross build patch to suit Linux ARM emulator rootfs')
git am < "$__ARMRootfsMountPath"/dotnet/setenv/corefx_cross.patch
fi
#Cross building for emulator rootfs
ROOTFS_DIR="$__ARMRootfsMountPath" CPLUS_INCLUDE_PATH=$LINUX_ARM_INCPATH CXXFLAGS=$LINUX_ARM_CXXFLAGS ./build-native.sh -buildArch=$__buildArch -$__buildConfig -- cross $__verboseFlag
ROOTFS_DIR="$__ARMRootfsMountPath" CPLUS_INCLUDE_PATH=$LINUX_ARM_INCPATH CXXFLAGS=$LINUX_ARM_CXXFLAGS ./build-managed.sh -$__buildConfig -skipTests
#Reset the code to the upstream version
(set +x; echo 'Rewinding HEAD to master code')
git reset --hard HEAD^
}
#Define script variables
......@@ -210,9 +203,9 @@ do
exit_with_error "--buildConfig can be only Debug or Release" true
fi
;;
--softfp)
--armel)
__ARMRootfsImageBase="rootfs-t30.ext4"
__buildArch="arm-softfp"
__buildArch="armel"
;;
-v|--verbose)
__verboseFlag="verbose"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册