public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/105659] New: error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
@ 2022-05-19 12:21 ibuclaw at gdcproject dot org
  2022-05-19 14:29 ` [Bug d/105659] " ibuclaw at gdcproject dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ibuclaw at gdcproject dot org @ 2022-05-19 12:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105659

            Bug ID: 105659
           Summary: error: #error You must define PREFERRED_DEBUGGING_TYPE
                    if DWARF is not supported
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: ibuclaw at gdcproject dot org
  Target Milestone: ---

This was discussed in gcc-patches a while back, creating an issue for
tracking/fixing it.
---
g++  -fno-PIE -c  -DIN_GCC_FRONTEND -g -O2   -DIN_GCC 
-DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common 
-DHAVE_CONFIG_H -I. -I. -I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/.
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/../include
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/../libcpp/include
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/../libcody 
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/../libdecnumber
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/../libdecnumber/dpd
-I../libdecnumber
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/../libbacktrace   -o default-d.o
-MT default-d.o -MMD -MP -MF ./.deps/default-d.TPo
/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/config/default-d.cc
In file included from ./tm_d.h:9,
                 from
/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/config/default-d.cc:22:
/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/defaults.h:908:2: error: #error
You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
  908 | #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not
supported
      |  ^~~~~
make[1]: *** [Makefile:2329: default-d.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory
'/home/ibuclaw/src/gcc/crossbuilds/aarch64-rtems/gcc'
make: *** [Makefile:4594: all-gcc] Error 2

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug d/105659] error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
  2022-05-19 12:21 [Bug d/105659] New: error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported ibuclaw at gdcproject dot org
@ 2022-05-19 14:29 ` ibuclaw at gdcproject dot org
  2022-05-20 13:04 ` ibuclaw at gdcproject dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ibuclaw at gdcproject dot org @ 2022-05-19 14:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105659

--- Comment #1 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
If I recall the conversation correctly, either the CPU-specific D language
hooks should be moved to macros - equivalent to TARGET_CPU_CPP_BUILTINS and
others.  Or the tm_d file should be packed with a lot more headers within -
possibly tricky as it would mean handling it in every possible path in
config.gcc.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug d/105659] error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
  2022-05-19 12:21 [Bug d/105659] New: error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported ibuclaw at gdcproject dot org
  2022-05-19 14:29 ` [Bug d/105659] " ibuclaw at gdcproject dot org
@ 2022-05-20 13:04 ` ibuclaw at gdcproject dot org
  2022-09-02 20:30 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ibuclaw at gdcproject dot org @ 2022-05-20 13:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105659

--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
(In reply to Iain Buclaw from comment #1)
> If I recall the conversation correctly, either the CPU-specific D language
> hooks should be moved to macros - equivalent to TARGET_CPU_CPP_BUILTINS and
> others.  Or the tm_d file should be packed with a lot more headers within -
> possibly tricky as it would mean handling it in every possible path in
> config.gcc.
Or I do away with tm_d.h and just include tm.h and tm_p.h in all D-specific
target files, so that the CPU version macros will always be picked up by
default-d.cc and others.

I note that there's also a similar hack done for darwin-d.cc, where tm-dwarf2.h
is explicitly added to the tm_d.h file in order to get around this.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug d/105659] error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
  2022-05-19 12:21 [Bug d/105659] New: error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported ibuclaw at gdcproject dot org
  2022-05-19 14:29 ` [Bug d/105659] " ibuclaw at gdcproject dot org
  2022-05-20 13:04 ` ibuclaw at gdcproject dot org
@ 2022-09-02 20:30 ` cvs-commit at gcc dot gnu.org
  2022-11-30 21:01 ` cvs-commit at gcc dot gnu.org
  2022-11-30 21:32 ` ibuclaw at gdcproject dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-09-02 20:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105659

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain Buclaw <ibuclaw@gcc.gnu.org>:

https://gcc.gnu.org/g:d5ad6f8415171798adaff5787400505ce9882144

commit r13-2385-gd5ad6f8415171798adaff5787400505ce9882144
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Tue Aug 16 16:18:02 2022 +0200

    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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug d/105659] error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
  2022-05-19 12:21 [Bug d/105659] New: error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported ibuclaw at gdcproject dot org
                   ` (2 preceding siblings ...)
  2022-09-02 20:30 ` cvs-commit at gcc dot gnu.org
@ 2022-11-30 21:01 ` cvs-commit at gcc dot gnu.org
  2022-11-30 21:32 ` ibuclaw at gdcproject dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-30 21:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105659

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Iain Buclaw
<ibuclaw@gcc.gnu.org>:

https://gcc.gnu.org/g:17d46f069ceb55faa0db80a47c31710c7e6bcb11

commit r12-8950-g17d46f069ceb55faa0db80a47c31710c7e6bcb11
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Tue Aug 16 16:18:02 2022 +0200

    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.

    (cherry picked from commit d5ad6f8415171798adaff5787400505ce9882144)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug d/105659] error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
  2022-05-19 12:21 [Bug d/105659] New: error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported ibuclaw at gdcproject dot org
                   ` (3 preceding siblings ...)
  2022-11-30 21:01 ` cvs-commit at gcc dot gnu.org
@ 2022-11-30 21:32 ` ibuclaw at gdcproject dot org
  4 siblings, 0 replies; 6+ messages in thread
From: ibuclaw at gdcproject dot org @ 2022-11-30 21:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105659

Iain Buclaw <ibuclaw at gdcproject dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
Fix now backported to gcc-12.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-30 21:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 12:21 [Bug d/105659] New: error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported ibuclaw at gdcproject dot org
2022-05-19 14:29 ` [Bug d/105659] " ibuclaw at gdcproject dot org
2022-05-20 13:04 ` ibuclaw at gdcproject dot org
2022-09-02 20:30 ` cvs-commit at gcc dot gnu.org
2022-11-30 21:01 ` cvs-commit at gcc dot gnu.org
2022-11-30 21:32 ` ibuclaw at gdcproject dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).