summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2015-08-21 04:39:52 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2015-08-21 04:39:52 +0000
commit0d6094b992d800babedb77112e647a388a86a6eb (patch)
treee9bcf6f10d5dbdbb86443e7ab04563f8ce7c9b86 /compiler-rt
parent667395f334daa1b5161b18c8a6e8171567d22b4b (diff)
downloadbcm5719-llvm-0d6094b992d800babedb77112e647a388a86a6eb.tar.gz
bcm5719-llvm-0d6094b992d800babedb77112e647a388a86a6eb.zip
builtins: restrict aliases
MachO and COFF do not support aliases. Restrict the alias to ELF targets. This should also fix the Darwin build. Make the FNALIAS usage an error on non-ELF targets. llvm-svn: 245669
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/builtins/comparedf2.c2
-rw-r--r--compiler-rt/lib/builtins/comparesf2.c2
-rw-r--r--compiler-rt/lib/builtins/comparetf2.c2
-rw-r--r--compiler-rt/lib/builtins/int_lib.h4
4 files changed, 10 insertions, 0 deletions
diff --git a/compiler-rt/lib/builtins/comparedf2.c b/compiler-rt/lib/builtins/comparedf2.c
index 9d5330c2361..9e29752231e 100644
--- a/compiler-rt/lib/builtins/comparedf2.c
+++ b/compiler-rt/lib/builtins/comparedf2.c
@@ -80,8 +80,10 @@ __ledf2(fp_t a, fp_t b) {
}
}
+#if defined(__ELF__)
// Alias for libgcc compatibility
FNALIAS(__cmpdf2, __ledf2);
+#endif
enum GE_RESULT {
GE_LESS = -1,
diff --git a/compiler-rt/lib/builtins/comparesf2.c b/compiler-rt/lib/builtins/comparesf2.c
index f15a147e87d..1fd50636aba 100644
--- a/compiler-rt/lib/builtins/comparesf2.c
+++ b/compiler-rt/lib/builtins/comparesf2.c
@@ -80,8 +80,10 @@ __lesf2(fp_t a, fp_t b) {
}
}
+#if defined(__ELF__)
// Alias for libgcc compatibility
FNALIAS(__cmpsf2, __lesf2);
+#endif
enum GE_RESULT {
GE_LESS = -1,
diff --git a/compiler-rt/lib/builtins/comparetf2.c b/compiler-rt/lib/builtins/comparetf2.c
index c92ddc1a1d5..c0ad8ed0aec 100644
--- a/compiler-rt/lib/builtins/comparetf2.c
+++ b/compiler-rt/lib/builtins/comparetf2.c
@@ -79,8 +79,10 @@ COMPILER_RT_ABI enum LE_RESULT __letf2(fp_t a, fp_t b) {
}
}
+#if defined(__ELF__)
// Alias for libgcc compatibility
FNALIAS(__cmptf2, __letf2);
+#endif
enum GE_RESULT {
GE_LESS = -1,
diff --git a/compiler-rt/lib/builtins/int_lib.h b/compiler-rt/lib/builtins/int_lib.h
index 70773e3779b..9a74d1e53fb 100644
--- a/compiler-rt/lib/builtins/int_lib.h
+++ b/compiler-rt/lib/builtins/int_lib.h
@@ -20,8 +20,12 @@
/* Assumption: Right shift of signed negative is arithmetic shift. */
/* Assumption: Endianness is little or big (not mixed). */
+#if defined(__ELF__)
#define FNALIAS(alias_name, original_name) \
void alias_name() __attribute__((alias(#original_name)))
+#else
+#define FNALIAS(alias, name) _Pragma("GCC error(\"alias unsupported on this file format\")")
+#endif
/* ABI macro definitions */
OpenPOWER on IntegriCloud