set(CLR_CMAKE_PLATFORM_UNIX_TARGET_ARM 1)
# Because we don't use CMAKE_C_COMPILER/CMAKE_CXX_COMPILER to use clang
# we have to set the triple by adding a compiler argument
- add_compile_options(-target armv7-linux-gnueabihf)
add_compile_options(-mthumb)
add_compile_options(-mfpu=vfpv3)
+ if(ARM_SOFTFP)
+ add_compile_options(-mfloat-abi=softfp)
+ add_compile_options(-target armv7-linux-gnueabi)
+ else()
+ add_compile_options(-target armv7-linux-gnueabihf)
+ endif(ARM_SOFTFP)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
set(CLR_CMAKE_PLATFORM_UNIX_TARGET_ARM64 1)
else()
usage()
{
echo "Usage: $0 [BuildArch] [BuildType] [clean] [verbose] [coverage] [cross] [clangx.y] [ninja] [configureonly] [skipconfigure] [skipnative] [skipmscorlib] [skiptests] [cmakeargs]"
- echo "BuildArch can be: x64, x86, arm, arm64"
+ echo "BuildArch can be: x64, x86, arm, arm-softfp, arm64"
echo "BuildType can be: debug, checked, release"
echo "clean - optional argument to force a clean build."
echo "verbose - optional argument to enable verbose build output."
__BuildArch=arm
;;
+ arm-softfp)
+ __BuildArch=arm-softfp
+ ;;
+
arm64)
__BuildArch=arm64
;;
--- /dev/null
+# Debian (sid) # UNSTABLE
+deb http://ftp.debian.org/debian/ sid main contrib non-free
+deb-src http://ftp.debian.org/debian/ sid main contrib non-free
--- /dev/null
+set(CROSS_ROOTFS $ENV{ROOTFS_DIR})
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_VERSION 1)
+set(CMAKE_SYSTEM_PROCESSOR armv7l)
+
+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 arm-linux-gnueabi")
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}/usr/lib/arm-linux-gnueabi")
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/arm-linux-gnueabi -L${CROSS_ROOTFS}/usr/lib/arm-linux-gnueabi")
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")
+
+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(WITH_LLDB_LIBS "${CROSS_ROOTFS}/usr/lib/arm-linux-gnueabi" CACHE STRING "")
+set(WITH_LLDB_INCLUDES "${CROSS_ROOTFS}/usr/lib/llvm-3.6/include" CACHE STRING "")
--- /dev/null
+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( MMAP_IGNORES_HINT_EXITCODE
+ 1
+ CACHE STRING "Result from TRY_RUN" FORCE)
+
+SET( MMAP_DOESNOT_ALLOW_REMAP_EXITCODE
+ 1
+ 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)
+
usage()
{
echo "Usage: $0 [BuildArch]"
- echo "BuildArch can be: arm, arm64"
+ echo "BuildArch can be: arm, arm-softfp, arm64"
exit 1
}
+__UbuntuCodeName=trusty
+
__CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
__InitialDir=$PWD
__BuildArch=arm
__UbuntuPackages="build-essential libunwind8-dev gettext symlinks liblttng-ust-dev libicu-dev"
__MachineTriple=aarch64-linux-gnu
;;
+ arm-softfp)
+ __BuildArch=arm-softfp
+ __UbuntuArch=armel
+ __UbuntuRepo="http://ftp.debian.org/debian/"
+ __UbuntuPackages="build-essential lldb-3.6-dev libunwind8-dev gettext symlinks liblttng-ust-dev libicu-dev"
+ __MachineTriple=arm-linux-gnueabi
+ __UbuntuCodeName=stable
+ ;;
*)
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $i"
esac
umount $__RootfsDir/*
rm -rf $__RootfsDir
-qemu-debootstrap --arch $__UbuntuArch trusty $__RootfsDir $__UbuntuRepo
+qemu-debootstrap --arch $__UbuntuArch $__UbuntuCodeName $__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
+umount $__RootfsDir/*
+
add_definitions(-DFEATURE_AVX_SUPPORT)
endif (CLR_CMAKE_PLATFORM_ARCH_AMD64)
+if (ARM_SOFTFP)
+ add_definitions(-DARM_SOFTFP)
+endif (ARM_SOFTFP)
+
set( JIT_SOURCES
alloc.cpp
assertionprop.cpp
(varDsc->lvType == TYP_STRUCT) ||
(varDsc->lvAddrExposed && compiler->info.compIsVarArgs));
#else // LEGACY_BACKEND
- noway_assert(varDsc->lvType == TYP_STRUCT || (varDsc->lvAddrExposed && compiler->info.compIsVarArgs));
+ noway_assert(varDsc->lvType == TYP_STRUCT || (varDsc->lvAddrExposed && (compiler->info.compIsVarArgs || compiler->opts.compUseSoftFP)));
#endif // LEGACY_BACKEND
#endif // !_TARGET_X86_
}
emitAttr attr = EA_UNKNOWN;
if (compiler->info.compRetType == TYP_VOID ||
- (!compiler->info.compIsVarArgs && (varTypeIsFloating(compiler->info.compRetType) || compiler->IsHfa(compiler->info.compMethodInfo->args.retTypeClass))))
+ (!compiler->opts.compUseSoftFP && !compiler->info.compIsVarArgs && (varTypeIsFloating(compiler->info.compRetType) || compiler->IsHfa(compiler->info.compMethodInfo->args.retTypeClass))))
{
r0Trashed = false;
}
if (call->gtType == TYP_FLOAT || call->gtType == TYP_DOUBLE)
{
#ifdef _TARGET_ARM_
- if (call->gtCall.IsVarargs())
+ if (call->gtCall.IsVarargs() || compiler->opts.compUseSoftFP)
{
// Result return for vararg methods is in r0, r1, but our callers would
// expect the return in s0, s1 because of floating type. Do the move now.
bool compTailCallLoopOpt;
#endif
+#ifdef ARM_SOFTFP
+ static const bool compUseSoftFP = true;
+#else // !ARM_SOFTFP
+ static const bool compUseSoftFP = false;
+#endif
+
GCPollType compGCPollType;
}
opts;
var_types Compiler::mangleVarArgsType(var_types type)
{
#ifdef _TARGET_ARMARCH_
- if (info.compIsVarArgs)
+ if (info.compIsVarArgs || opts.compUseSoftFP)
{
switch (type) {
case TYP_FLOAT:
{
#ifdef _TARGET_ARM_
// TODO-ARM64-NYI: HFA
- if (!info.compIsVarArgs && IsHfa(info.compMethodInfo->args.retTypeClass))
+ if (!info.compIsVarArgs && !opts.compUseSoftFP && IsHfa(info.compMethodInfo->args.retTypeClass))
{
info.compRetNativeType = TYP_STRUCT;
}
#ifdef _TARGET_ARM_
var_types hfaType = (varTypeIsStruct(argType)) ? GetHfaType(typeHnd) : TYP_UNDEF;
- bool isHfaArg = !info.compIsVarArgs && varTypeIsFloating(hfaType);
+ bool isHfaArg = !info.compIsVarArgs && !opts.compUseSoftFP && varTypeIsFloating(hfaType);
// On ARM we pass the first 4 words of integer arguments and non-HFA structs in registers.
// But we pre-spill user arguments in varargs methods and structs.
//
unsigned cAlign;
- bool preSpill = info.compIsVarArgs;
+ bool preSpill = info.compIsVarArgs || opts.compUseSoftFP;
switch (argType)
{
#else // !FEATURE_UNIX_AMD64_STRUCT_PASSING
compArgSize += argSize;
#endif // !FEATURE_UNIX_AMD64_STRUCT_PASSING
- if (info.compIsVarArgs)
+ if (info.compIsVarArgs || opts.compUseSoftFP)
{
#if defined(_TARGET_X86_)
varDsc->lvStkOffs = compArgSize;
if (!compIsProfilerHookNeeded())
#endif
{
- bool cond = (info.compIsVarArgs &&
+ bool cond = ((info.compIsVarArgs || opts.compUseSoftFP) &&
// Does cur stk arg require double alignment?
((varDsc->lvType == TYP_STRUCT && varDsc->lvStructDoubleAlign) ||
(varDsc->lvType == TYP_DOUBLE) ||
// this can't be a struct.
assert(argx->gtType != TYP_STRUCT);
+ // FIXME: Issue #4025 Why do we need floating type for 'this' argument
/* Increment the argument register count and argument index */
- if (!varTypeIsFloating(argx->gtType))
+ if (!varTypeIsFloating(argx->gtType) || opts.compUseSoftFP)
{
intArgRegNum++;
#if defined(_TARGET_AMD64_) && !defined(UNIX_AMD64_ABI)
#ifdef _TARGET_ARM_
bool passUsingIntRegs;
-
if (lateArgsComputed)
{
passUsingFloatRegs = isValidFloatArgReg(argEntry->regNum);
}
else
{
- passUsingFloatRegs = !callIsVararg && (isHfaArg || varTypeIsFloating(argx));
+ passUsingFloatRegs = !callIsVararg && (isHfaArg || varTypeIsFloating(argx)) && !opts.compUseSoftFP;
passUsingIntRegs = passUsingFloatRegs ? false : (intArgRegNum < MAX_REG_ARG);
}
continue;
// only process args that apply to the current register file
- if ((argDsc->IsFloatRegType() && !info.compIsVarArgs) != regState->rsIsFloat)
+ if ((argDsc->IsFloatRegType() && !info.compIsVarArgs && !opts.compUseSoftFP) != regState->rsIsFloat)
{
continue;
}
#ifdef _TARGET_ARM_
if (argDsc->lvType == TYP_DOUBLE)
{
- if (info.compIsVarArgs)
+ if (info.compIsVarArgs || opts.compUseSoftFP)
{
assert((inArgReg == REG_R0) || (inArgReg == REG_R2));
assert(!regState->rsIsFloat);
genCodeForTreeFloat(op1, pref);
inst_RV_TT(ins_FloatConv(tree->TypeGet(), op1->TypeGet()), REG_FLOATRET, op1);
- if (compiler->info.compIsVarArgs)
+ if (compiler->info.compIsVarArgs || compiler->opts.compUseSoftFP)
{
if (tree->TypeGet() == TYP_FLOAT)
{
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
+if [ "$build_arch" == "arm-softfp" ]; then
+ cmake_extra_defines="$cmake_extra_defines -DARM_SOFTFP=1"
+fi
cmake \
-G "$generator" \