From a2fd19176bb1d9111ba0826b979ae0cdf50957dc Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sun, 9 Oct 2022 22:39:02 +0200 Subject: [PATCH] [WIP] Restore default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR' ... that got lost in commit 7e0db0cdf01e9c885a29cb37415f5bc00d90c029 "STABS: remove -gstabs and -gxcoff functionality". --- gcc/Makefile.in | 1 + gcc/config/nvptx/nvptx.cc | 1 + gcc/config/pdp11/pdp11.cc | 1 + gcc/config/rs6000/rs6000-call.cc | 4 +++ gcc/config/rs6000/rs6000-logue.cc | 3 +++ gcc/dbxout.cc | 43 +++++++++++++++++++++++++++++++ gcc/dbxout.h | 25 ++++++++++++++++++ gcc/target-def.h | 4 +++ 8 files changed, 82 insertions(+) create mode 100644 gcc/dbxout.cc create mode 100644 gcc/dbxout.h diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 59b67d994415..4808f6770ca1 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1354,6 +1354,7 @@ OBJS = \ data-streamer.o \ data-streamer-in.o \ data-streamer-out.o \ + dbxout.o \ dbgcnt.o \ dce.o \ ddg.o \ diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc index 2fe120b38730..4cb5d02d40cd 100644 --- a/gcc/config/nvptx/nvptx.cc +++ b/gcc/config/nvptx/nvptx.cc @@ -52,6 +52,7 @@ #include "tm-preds.h" #include "tm-constrs.h" #include "langhooks.h" +#include "dbxout.h" #include "cfgrtl.h" #include "gimple.h" #include "stor-layout.h" diff --git a/gcc/config/pdp11/pdp11.cc b/gcc/config/pdp11/pdp11.cc index 380223439a47..ae73c1f7bb98 100644 --- a/gcc/config/pdp11/pdp11.cc +++ b/gcc/config/pdp11/pdp11.cc @@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see #include "calls.h" #include "expr.h" #include "builtins.h" +//TODO #include "dbxout.h" #include "explow.h" #include "expmed.h" diff --git a/gcc/config/rs6000/rs6000-call.cc b/gcc/config/rs6000/rs6000-call.cc index ac3cb7e3d362..27971ecd0333 100644 --- a/gcc/config/rs6000/rs6000-call.cc +++ b/gcc/config/rs6000/rs6000-call.cc @@ -67,6 +67,10 @@ #include "rs6000-internal.h" +#if TARGET_MACHO +//TODO #include "dbxout.h" /* dbxout_ */ +#endif + #ifndef TARGET_PROFILE_KERNEL #define TARGET_PROFILE_KERNEL 0 #endif diff --git a/gcc/config/rs6000/rs6000-logue.cc b/gcc/config/rs6000/rs6000-logue.cc index a11d020ccd0c..3aa60719f3b8 100644 --- a/gcc/config/rs6000/rs6000-logue.cc +++ b/gcc/config/rs6000/rs6000-logue.cc @@ -47,6 +47,9 @@ #include "diagnostic-core.h" #include "alias.h" #include "rs6000-internal.h" +#if TARGET_MACHO +//TODO #include "dbxout.h" /* dbxout_ */ +#endif static int rs6000_ra_ever_killed (void); static void is_altivec_return_reg (rtx, void *); diff --git a/gcc/dbxout.cc b/gcc/dbxout.cc new file mode 100644 index 000000000000..161eeb196537 --- /dev/null +++ b/gcc/dbxout.cc @@ -0,0 +1,43 @@ +/* Copyright (C) 1987-2022 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "diagnostic-core.h" +#include "dbxout.h" + +/* Record an element in the table of global destructors. SYMBOL is + a SYMBOL_REF of the function to be called; PRIORITY is a number + between 0 and MAX_INIT_PRIORITY. */ + +void +default_stabs_asm_out_destructor (rtx symbol ATTRIBUTE_UNUSED, + int priority ATTRIBUTE_UNUSED) +{ + sorry ("global destructors not supported on this target"); +} + +/* Likewise for global constructors. */ + +void +default_stabs_asm_out_constructor (rtx symbol ATTRIBUTE_UNUSED, + int priority ATTRIBUTE_UNUSED) +{ + sorry ("global constructors not supported on this target"); +} diff --git a/gcc/dbxout.h b/gcc/dbxout.h new file mode 100644 index 000000000000..ad0b538cabf1 --- /dev/null +++ b/gcc/dbxout.h @@ -0,0 +1,25 @@ +/* Copyright (C) 1998-2022 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#ifndef GCC_DBXOUT_H +#define GCC_DBXOUT_H + +extern void default_stabs_asm_out_destructor (rtx, int); +extern void default_stabs_asm_out_constructor (rtx, int); + +#endif /* GCC_DBXOUT_H */ diff --git a/gcc/target-def.h b/gcc/target-def.h index f81f8fe3bb39..1c4aa2963dc4 100644 --- a/gcc/target-def.h +++ b/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_stabs_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_stabs_asm_out_destructor # endif # endif #endif -- 2.35.1