This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Configuration issues on Itanium VMS
"Douglas B Rupp" <rupp@gnat.com> writes:
>> The TARGET_INIT_BUILTINS hook could, perhaps, be used to construct
>> invisible declarations for every function that requires a prefix (or
>> augment the invisible declarations for the functions that already have
>> them), setting DECL_ASSEMBLER_NAME appropriately.
>
> Something like this? It seems to work OK for functions that are not
> listed in builtins.def For those functions, e.g. memmove, my new
> libname gets overwritten/ignored when the builtin is "built" Not
> sure how to fix that...
Something like that, yes. You should be using
lang_hooks.builtin_function instead of calling build_decl and pushdecl
directly. For functions not already in builtins.def, a call similar
to
lang_hooks.builtin_function (name, type, *, BUILT_IN_NORMAL, libname, 0);
should suffice. [I am not sure what ought to go in the slot marked
with an *.]
It would be better to provide accurate prototypes for them whenever
possible, but I recognize that this is intractable in some cases
(e.g. those involving FILE*).
To deal properly with builtins with a target-independent meaning, I
think you should be able to call identifier_global_value at this
point, and if it returns something, just set its DECL_ASSEMBLER_NAME
rather than creating a new decl. Note that this may cause link errors
in front ends other than C/C++/ObjC - the appropriate thing would be
to turn i_g_v into a langhook.
zw