On Sun, 24 Oct 2021, Jan-Benedict Glaw wrote:

> Hi Richard,
> 
> On Sun, 2021-10-24 08:36:36 +0200, Richard Biener <rguent...@suse.de> wrote:
> > On October 23, 2021 10:00:05 PM GMT+02:00, Jan-Benedict Glaw 
> > <jbg...@lug-owl.de> wrote:
> > >On Tue, 2021-09-21 16:25:19 +0200, Richard Biener via Gcc-patches 
> > ><gcc-patches@gcc.gnu.org> wrote:
> > >> I have built all targets from contrib/config-list.mk to make sure we
> > >> don't run into the #error and the following makes the STABS usage
> > >> explicit for pdp11 and hppa with SOM.
> > >
> > >I'm running build tests based on config-list.mk as well and see a good
> > >number of targets failing, all about the same, ie. for moxie-elf:
> > 
> > That's odd. I did test the patch using config-list.mk - the patch
> > sat in the comit tree for quite a while since that exercise (but
> > unchanged), but I doubt anything significant changed in between. 
> > 
> > >[all 2021-10-17 00:01:19] /usr/lib/gcc-snapshot/bin/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 -Wno-error=format-diag 
> > >-Wmissing-format-attribute -Woverloaded-virtual -pedantic 
> > >-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror 
> > >-fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. 
> > >-I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include 
> > >-I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber 
> > >-I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber 
> > >-I../../gcc/gcc/../libbacktrace -o default-d.o -MT default-d.o -MMD 
> > >-MP -MF ./.deps/default-d.TPo ../../gcc/gcc/config/default-d.c [all 
> > >2021-10-17 00:01:19] In file included from ./tm_d.h:9, [all 
> > >2021-10-17 00:01:19] from ../../gcc/gcc/config/default-d.c:22: [all 
> > >2021-10-17 00:01:19] ../../gcc/gcc/defaults.h:908:2: error: #error 
> > >You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
> > 
> > Is that building the D frontend? I remember restricting the builds to C... 
> 
> Probably. I configure as
> 
> .../gcc/configure --target=moxie-elf --enable-werror-always
> --enable-languages=all --disable-gcov --disable-shared
> --disable-threads --without-headers
> --prefix=/var/lib/laminar/run/gcc-moxie-elf/13/toolchain-install

So it looks like tm_d.h is much more stripped down compared to regular
tm_p.h but also oddly enough config/default-d.c includes tm_d.h
while config/default-c.c explicitely documents itself to not do that.

In particular tm_d.h includes defaults.h which now has the requirement
that either PREFERRED_DEBUGGING_TYPE is defined or DWARF2_DEBUGGING_INFO
but the latter is usually picked up from config/elfos.h or similar
which are headers _not_ included via tm_d.h.

The old defaults.h resulted in NO_DEBUG if no PREFERRED_DEBUGGING_TYPE
and no DWARF2_DEBUGGING_INFO was defined.

I also note that default-d.o is not built on x86_64-linux?  Looks
like that's built only for

if [ "$target_has_targetdm" = "no" ]; then
  d_target_objs="$d_target_objs default-d.o"
fi

I note that for example config/glibc-d.c includes tm.h and tm_p.h
which would end up in proper definitions.

So ... for moxie-elf, did D really end up with NO_DEBUG previously?
Is that "correct" for D or was that a bug?  moxie-elf seems to use
default-c.c as well but that does not end including defaults.h.

Is it maybe a bug that tm_d.h includes defaults.h at all?  Should
"d defaults" be in a defaults-d.h instead?  If I remove the
defaults.h include from tm_d.h the build for moxie-elf succeeds.

Ian?  Joseph?

Thanks,
Richard.

Reply via email to