diff --git a/cross/armel/toolchain.cmake b/cross/armel/toolchain.cmake index 2985ce544270..bcfc2e5fbb69 100644 --- a/cross/armel/toolchain.cmake +++ b/cross/armel/toolchain.cmake @@ -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}") diff --git a/netci.groovy b/netci.groovy index e0567dde7d22..1826af668b9c 100644 --- a/netci.groovy +++ b/netci.groovy @@ -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) diff --git a/scripts/arm32_ci_script.sh b/scripts/arm32_ci_script.sh index 3297aacaa66a..4c15dc2fed77 100755 --- a/scripts/arm32_ci_script.sh +++ b/scripts/arm32_ci_script.sh @@ -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= : 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" diff --git a/src/Native/build-native.sh b/src/Native/build-native.sh index a58546a83898..5c5f3a12306f 100755 --- a/src/Native/build-native.sh +++ b/src/Native/build-native.sh @@ -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