[compiler-rt] r245669 - builtins: restrict aliases

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 21:39:53 PDT 2015


Author: compnerd
Date: Thu Aug 20 23:39:52 2015
New Revision: 245669

URL: http://llvm.org/viewvc/llvm-project?rev=245669&view=rev
Log:
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.

Modified:
    compiler-rt/trunk/lib/builtins/comparedf2.c
    compiler-rt/trunk/lib/builtins/comparesf2.c
    compiler-rt/trunk/lib/builtins/comparetf2.c
    compiler-rt/trunk/lib/builtins/int_lib.h

Modified: compiler-rt/trunk/lib/builtins/comparedf2.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/comparedf2.c?rev=245669&r1=245668&r2=245669&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/comparedf2.c (original)
+++ compiler-rt/trunk/lib/builtins/comparedf2.c Thu Aug 20 23:39:52 2015
@@ -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,

Modified: compiler-rt/trunk/lib/builtins/comparesf2.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/comparesf2.c?rev=245669&r1=245668&r2=245669&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/comparesf2.c (original)
+++ compiler-rt/trunk/lib/builtins/comparesf2.c Thu Aug 20 23:39:52 2015
@@ -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,

Modified: compiler-rt/trunk/lib/builtins/comparetf2.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/comparetf2.c?rev=245669&r1=245668&r2=245669&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/comparetf2.c (original)
+++ compiler-rt/trunk/lib/builtins/comparetf2.c Thu Aug 20 23:39:52 2015
@@ -79,8 +79,10 @@ COMPILER_RT_ABI enum LE_RESULT __letf2(f
     }
 }
 
+#if defined(__ELF__)
 // Alias for libgcc compatibility
 FNALIAS(__cmptf2, __letf2);
+#endif
 
 enum GE_RESULT {
     GE_LESS      = -1,

Modified: compiler-rt/trunk/lib/builtins/int_lib.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/int_lib.h?rev=245669&r1=245668&r2=245669&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/int_lib.h (original)
+++ compiler-rt/trunk/lib/builtins/int_lib.h Thu Aug 20 23:39:52 2015
@@ -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 */
 




More information about the llvm-commits mailing list