------- Comment #4 from aran at 100acres dot us  2009-03-28 01:34 -------
Subject: Re:  cabs and cabsf are named differently on NetBSD 5

What is beyond me is how darwin_patch_builtings gets called.  
It looks like it is called from rs6000.c in 
rs6000_init_builtins via the macro SUBTARGET_INIT_BUILTINS.  
i386.c doesn't appear to have this infrastructure.  I am 
not familiar enough with gcc internals to know what the 
impacts might be on other platforms if I start making 
changes here.  

Also, these renames are only for NetBSD 5.  How do I detect 
the os version.  The darwin example uses 
darwin_macosx_version_min.  Is there a NetBSD analog?

Aran

On Friday 27 March 2009 18:02:48 steven at gcc dot gnu dot 
org wrote:
> ------- Comment #3 from steven at gcc dot gnu dot org 
> 2009-03-28 01:02 ------- Completely beyond you, how?
>
> What gcc does for darwin (and this is a hack, mind you),
> is basically replace the standard C99 builtins with
> darwin-specific ones.  You have to do the same for
> NetBSD.
>
> See the following files in gcc/config/:
> * darwin.c
> * darwin-ppc-ldouble-patch.def
>
> The code in darwin_patch_builtin() changes the assembler
> name of the builtin function to a custom, darwin-specific
> version.  E.g. cabsl has a PATCH_BUILTIN defines, so its
> DECL_NAME is the normal cabls name but its assembler name
> becomes _cabsl_$LDBL128.
>
> You need to do something similar (but probably less ugly)
> for NetBSD to make this work.


-- 


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

Reply via email to