Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cross/armel/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion netci.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
19 changes: 6 additions & 13 deletions scripts/arm32_ci_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:'
Expand All @@ -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 ''
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
36 changes: 36 additions & 0 deletions src/Native/build-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down