builtins: mark functions as aapcs on Windows
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 22 May 2015 21:47:24 +0000 (21:47 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 22 May 2015 21:47:24 +0000 (21:47 +0000)
Windows does not use AAPCS, but rather AAPCS-VFP, and thus the functions which
are assumed to be AAPCS will cause invalid argument setup.  Ensure that the
functions are marked as AAPCS.

llvm-svn: 238056

compiler-rt/lib/builtins/int_lib.h

index ff314da..bca5d81 100644 (file)
 # define COMPILER_RT_ABI __attribute__((pcs("aapcs")))
 #else
 # define ARM_EABI_FNALIAS(aeabi_name, name)
-# define COMPILER_RT_ABI
+# if defined(__arm__) && defined(_WIN32)
+#   define COMPILER_RT_ABI __attribute__((pcs("aapcs")))
+# else
+#   define COMPILER_RT_ABI
+# endif
 #endif
 
 #if defined(__NetBSD__) && (defined(_KERNEL) || defined(_STANDALONE))