diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-08-16 16:18:02 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-09-02 22:20:26 +0200 |
commit | d5ad6f8415171798adaff5787400505ce9882144 (patch) | |
tree | f317623f379959fa1fda7c065704d3ba327fccdf /gcc/config/i386 | |
parent | bb9d434404b559a11bd2f85f0ce8085c77b8c4c8 (diff) | |
download | gcc-d5ad6f8415171798adaff5787400505ce9882144.zip gcc-d5ad6f8415171798adaff5787400505ce9882144.tar.gz gcc-d5ad6f8415171798adaff5787400505ce9882144.tar.bz2 |
d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
This moves all D front-end specific target definitions out of the main
target headers, and into its own header that is included by tm_d.h
instead of pulling in the same headers as tm_p.h.
This fixes the build on target configurations that pull in the default D
language target hooks, and subsequently trigger an error because the
definition of PREFERRED_DEBUGGING_TYPE is behind tm.h, the one header
that is avoided from being included in default-d.cc.
PR d/105659
gcc/ChangeLog:
* config.gcc: Set tm_d_file to ${cpu_type}/${cpu_type}-d.h.
* config/aarch64/aarch64-d.cc: Include tm_d.h.
* config/aarch64/aarch64-protos.h (aarch64_d_target_versions): Move to
config/aarch64/aarch64-d.h.
(aarch64_d_register_target_info): Likewise.
* config/aarch64/aarch64.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* config/arm/arm-d.cc: Include tm_d.h and arm-protos.h instead of
tm_p.h.
* config/arm/arm-protos.h (arm_d_target_versions): Move to
config/arm/arm-d.h.
(arm_d_register_target_info): Likewise.
* config/arm/arm.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* config/default-d.cc: Remove memmodel.h include.
* config/freebsd-d.cc: Include tm_d.h instead of tm_p.h.
* config/glibc-d.cc: Likewise.
* config/i386/i386-d.cc: Include tm_d.h.
* config/i386/i386-protos.h (ix86_d_target_versions): Move to
config/i386/i386-d.h.
(ix86_d_register_target_info): Likewise.
(ix86_d_has_stdcall_convention): Likewise.
* config/i386/i386.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
(TARGET_D_HAS_STDCALL_CONVENTION): Likewise.
* config/i386/winnt-d.cc: Include tm_d.h instead of tm_p.h.
* config/mips/mips-d.cc: Include tm_d.h.
* config/mips/mips-protos.h (mips_d_target_versions): Move to
config/mips/mips-d.h.
(mips_d_register_target_info): Likewise.
* config/mips/mips.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* config/netbsd-d.cc: Include tm_d.h instead of tm.h and memmodel.h.
* config/openbsd-d.cc: Likewise.
* config/pa/pa-d.cc: Include tm_d.h.
* config/pa/pa-protos.h (pa_d_target_versions): Move to
config/pa/pa-d.h.
(pa_d_register_target_info): Likewise.
* config/pa/pa.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* config/riscv/riscv-d.cc: Include tm_d.h.
* config/riscv/riscv-protos.h (riscv_d_target_versions): Move to
config/riscv/riscv-d.h.
(riscv_d_register_target_info): Likewise.
* config/riscv/riscv.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* config/rs6000/rs6000-d.cc: Include tm_d.h.
* config/rs6000/rs6000-protos.h (rs6000_d_target_versions): Move to
config/rs6000/rs6000-d.h.
(rs6000_d_register_target_info): Likewise.
* config/rs6000/rs6000.h (TARGET_D_CPU_VERSIONS) Likewise.:
(TARGET_D_REGISTER_CPU_TARGET_INFO) Likewise.:
* config/s390/s390-d.cc: Include tm_d.h.
* config/s390/s390-protos.h (s390_d_target_versions): Move to
config/s390/s390-d.h.
(s390_d_register_target_info): Likewise.
* config/s390/s390.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* config/sol2-d.cc: Include tm_d.h instead of tm.h and memmodel.h.
* config/sparc/sparc-d.cc: Include tm_d.h.
* config/sparc/sparc-protos.h (sparc_d_target_versions): Move to
config/sparc/sparc-d.h.
(sparc_d_register_target_info): Likewise.
* config/sparc/sparc.h (TARGET_D_CPU_VERSIONS): Likewise.
(TARGET_D_REGISTER_CPU_TARGET_INFO): Likewise.
* configure: Regenerate.
* configure.ac (tm_d_file): Remove defaults.h.
(tm_d_include_list): Remove options.h and insn-constants.h.
* config/aarch64/aarch64-d.h: New file.
* config/arm/arm-d.h: New file.
* config/i386/i386-d.h: New file.
* config/mips/mips-d.h: New file.
* config/pa/pa-d.h: New file.
* config/riscv/riscv-d.h: New file.
* config/rs6000/rs6000-d.h: New file.
* config/s390/s390-d.h: New file.
* config/sparc/sparc-d.h: New file.
Diffstat (limited to 'gcc/config/i386')
-rw-r--r-- | gcc/config/i386/i386-d.cc | 1 | ||||
-rw-r--r-- | gcc/config/i386/i386-d.h | 26 | ||||
-rw-r--r-- | gcc/config/i386/i386-protos.h | 5 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 5 | ||||
-rw-r--r-- | gcc/config/i386/winnt-d.cc | 2 |
5 files changed, 28 insertions, 11 deletions
diff --git a/gcc/config/i386/i386-d.cc b/gcc/config/i386/i386-d.cc index a62339c..27e2b75 100644 --- a/gcc/config/i386/i386-d.cc +++ b/gcc/config/i386/i386-d.cc @@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" +#include "tm_d.h" #include "d/d-target.h" #include "d/d-target-def.h" diff --git a/gcc/config/i386/i386-d.h b/gcc/config/i386/i386-d.h new file mode 100644 index 0000000..b980688 --- /dev/null +++ b/gcc/config/i386/i386-d.h @@ -0,0 +1,26 @@ +/* Definitions for the D front end on the x86 architecture. + Copyright (C) 2022 Free Software Foundation, Inc. + +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 +<http://www.gnu.org/licenses/>. */ + +/* In i386-d.cc */ +extern void ix86_d_target_versions (void); +extern void ix86_d_register_target_info (void); +extern bool ix86_d_has_stdcall_convention (unsigned int *, unsigned int *); + +/* Target hooks for D language. */ +#define TARGET_D_CPU_VERSIONS ix86_d_target_versions +#define TARGET_D_REGISTER_CPU_TARGET_INFO ix86_d_register_target_info +#define TARGET_D_HAS_STDCALL_CONVENTION ix86_d_has_stdcall_convention diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index e27c14f..3b94efe 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -277,11 +277,6 @@ extern bool ix86_extract_perm_from_pool_constant (int*, rtx); extern void ix86_target_macros (void); extern void ix86_register_pragmas (void); -/* In i386-d.cc */ -extern void ix86_d_target_versions (void); -extern void ix86_d_register_target_info (void); -extern bool ix86_d_has_stdcall_convention (unsigned int *, unsigned int *); - /* In winnt.cc */ extern void i386_pe_unique_section (tree, int); extern void i386_pe_declare_function_type (FILE *, const char *, int); diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 0de5c77..716bace 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -608,11 +608,6 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); /* Target Pragmas. */ #define REGISTER_TARGET_PRAGMAS() ix86_register_pragmas () -/* Target hooks for D language. */ -#define TARGET_D_CPU_VERSIONS ix86_d_target_versions -#define TARGET_D_REGISTER_CPU_TARGET_INFO ix86_d_register_target_info -#define TARGET_D_HAS_STDCALL_CONVENTION ix86_d_has_stdcall_convention - #ifndef CC1_SPEC #define CC1_SPEC "%(cc1_cpu) " #endif diff --git a/gcc/config/i386/winnt-d.cc b/gcc/config/i386/winnt-d.cc index 3d990a1..00c28c3 100644 --- a/gcc/config/i386/winnt-d.cc +++ b/gcc/config/i386/winnt-d.cc @@ -21,9 +21,9 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "target.h" +#include "tm_d.h" #include "d/d-target.h" #include "d/d-target-def.h" -#include "tm_p.h" /* Implement TARGET_D_OS_VERSIONS for Windows targets. */ |