diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2015-08-21 04:39:52 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2015-08-21 04:39:52 +0000 |
commit | d3a8aba4e20d86187867fc360eebeb09da929533 (patch) | |
tree | 6805830b2cf58ec1df2810031132a4c2ad789687 | |
parent | c852516dc611dbee4f18683fb16bb96b53211690 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245669 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/builtins/comparedf2.c | 2 | ||||
-rw-r--r-- | lib/builtins/comparesf2.c | 2 | ||||
-rw-r--r-- | lib/builtins/comparetf2.c | 2 | ||||
-rw-r--r-- | lib/builtins/int_lib.h | 4 |
4 files changed, 10 insertions, 0 deletions
diff --git a/lib/builtins/comparedf2.c b/lib/builtins/comparedf2.c index 9d5330c23..9e2975223 100644 --- a/lib/builtins/comparedf2.c +++ b/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/lib/builtins/comparesf2.c b/lib/builtins/comparesf2.c index f15a147e8..1fd50636a 100644 --- a/lib/builtins/comparesf2.c +++ b/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/lib/builtins/comparetf2.c b/lib/builtins/comparetf2.c index c92ddc1a1..c0ad8ed0a 100644 --- a/lib/builtins/comparetf2.c +++ b/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/lib/builtins/int_lib.h b/lib/builtins/int_lib.h index 70773e377..9a74d1e53 100644 --- a/lib/builtins/int_lib.h +++ b/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 */ |