[Bug target/44037] builtin ffs vs. renamed ffs (vms-crtl.h)#8207;

2010-05-25 Thread jay dot krell at cornell dot edu


--- Comment #3 from jay dot krell at cornell dot edu  2010-05-26 04:56 
---
Also this needed at top after #includes:
+#ifndef TARGET_ABI_OPEN_VMS
+#define TARGET_ABI_OPEN_VMS 0
+#endif


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44037



[Bug target/44037] builtin ffs vs. renamed ffs (vms-crtl.h)#8207;

2010-05-22 Thread jay dot krell at cornell dot edu


--- Comment #2 from jay dot krell at cornell dot edu  2010-05-22 12:16 
---
Thanks, good pointer. I found what you mean based on your recommendation. I
tried many things like it then. Nothing worked. I don't know why.


Notice that there is __builtin_foo and foo.
Darwin appears to only rename __builtin_foo.
I need to rename foo.
I didn't figure out what the implicit builtins are, but I don't think
figuring that out would help me.


This is a little bit lame but worked:

jbook2:gcc jay$ diff -u /src/orig/gcc-4.5.0/gcc/c-common.c c-common.c
--- /src/orig/gcc-4.5.0/gcc/c-common.c  2010-04-02 12:54:46.0 -0700
+++ c-common.c  2010-05-22 04:59:55.0 -0700
@@ -5181,6 +5181,7 @@
 {
   tree decl;
   const char *libname;
+  const char *libname2;

   if (fntype == error_mark_node)
 return;
@@ -5190,11 +5191,16 @@
   strlen (__builtin_)));

   libname = name + strlen (__builtin_);
+  libname2 = libname;
+  if (TARGET_ABI_OPEN_VMS  strcmp(libname, ffs) == 0)
+libname = decc$ffs;
+
   decl = add_builtin_function (name, fntype, fncode, fnclass,
   (fallback_p ? libname : NULL),
   fnattrs);
   if (both_p
!flag_no_builtin  !builtin_function_disabled_p (libname)
+   !builtin_function_disabled_p (libname2)
!(nonansi_p  flag_no_nonansi_builtin))
 add_builtin_function (libname, libtype, fncode, fnclass,
  NULL, fnattrs);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44037