Hi! On 2022-10-11T08:40:02+0200, Richard Biener via Gcc-patches wrote: > On Mon, Oct 10, 2022 at 4:23 PM Tom de Vries wrote: >> FWIW, nvptx change looks in the obvious category to me. I hadn't put you on CC for approval of the one-line '#include' change, but rather to inform you about the GCC/nvptx breakage generally. ;-) > Can you rename the functions as default_asm_out_* and instead of > reviving dbxout.cc > put them into targhooks.cc? ACK. Pushed to master branch commit a05d8e1d15ea08526639ba154e59b6822b704f4c "Better integrate default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR'", see attached. With that, the actual 'diff' is simply: gcc/target-def.h | 4 ++++ gcc/targhooks.cc | 20 ++++++++++++++++++++ gcc/targhooks.h | 2 ++ 3 files changed, 26 insertions(+) diff --git gcc/target-def.h gcc/target-def.h index f81f8fe3bb3..5e5cc3b767e 100644 --- gcc/target-def.h +++ gcc/target-def.h @@ -62,6 +62,8 @@ # else # ifdef TARGET_ASM_NAMED_SECTION # define TARGET_ASM_CONSTRUCTOR default_named_section_asm_out_constructor +# else +# define TARGET_ASM_CONSTRUCTOR default_asm_out_constructor # endif # endif #endif @@ -72,6 +74,8 @@ # else # ifdef TARGET_ASM_NAMED_SECTION # define TARGET_ASM_DESTRUCTOR default_named_section_asm_out_destructor +# else +# define TARGET_ASM_DESTRUCTOR default_asm_out_destructor # endif # endif #endif diff --git gcc/targhooks.cc gcc/targhooks.cc index d17d393baed..12a58456b39 100644 --- gcc/targhooks.cc +++ gcc/targhooks.cc @@ -1405,6 +1405,26 @@ default_generate_pic_addr_diff_vec (void) return flag_pic; } +/* Record an element in the table of global constructors. SYMBOL is + a SYMBOL_REF of the function to be called; PRIORITY is a number + between 0 and MAX_INIT_PRIORITY. */ + +void +default_asm_out_constructor (rtx symbol ATTRIBUTE_UNUSED, + int priority ATTRIBUTE_UNUSED) +{ + sorry ("global constructors not supported on this target"); +} + +/* Likewise for global destructors. */ + +void +default_asm_out_destructor (rtx symbol ATTRIBUTE_UNUSED, + int priority ATTRIBUTE_UNUSED) +{ + sorry ("global destructors not supported on this target"); +} + /* By default, do no modification. */ tree default_mangle_decl_assembler_name (tree decl ATTRIBUTE_UNUSED, tree id) diff --git gcc/targhooks.h gcc/targhooks.h index ecce55ebe79..a6a423c1abb 100644 --- gcc/targhooks.h +++ gcc/targhooks.h @@ -178,6 +178,8 @@ extern void default_target_option_override (void); extern void hook_void_bitmap (bitmap); extern int default_reloc_rw_mask (void); extern bool default_generate_pic_addr_diff_vec (void); +extern void default_asm_out_constructor (rtx, int); +extern void default_asm_out_destructor (rtx, int); extern tree default_mangle_decl_assembler_name (tree, tree); extern tree default_emutls_var_fields (tree, tree *); extern tree default_emutls_var_init (tree, tree, tree); Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955