Subject: Problems crossbuilding -current from i386-current
To: None <port-dreamcast@netbsd.org>
From: Harold Gutch <logix@foobar.franken.de>
List: port-dreamcast
Date: 11/24/2003 00:23:16
Hi,

I'm trying to crossbuild -current from i386 to dreamcast, but
it's aborting here: (sorry for overlong lines)

  #    create  symbolcheck.d
  CC=/usr/obj/usr/src/tooldir.NetBSD-1.6ZF-i386/bin/shle--netbsdelf-gcc /usr/obj/usr/src/tooldir.NetBSD-1.6ZF-i386/bin/nbmkdep -f symbolcheck.d -- -nostdinc -isystem /usr/obj/usr/src/destdir.dreamcast/usr/include /usr/src/regress/include/okheaders/symbolcheck.c
  In file included from /usr/src/regress/include/okheaders/symbolcheck.c:18:
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:11: warning: `_C_LABEL' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:37: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:24: warning: `__indr_reference' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:52: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:28: warning: `__warn_references' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:65: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:49: warning: `__IDSTRING' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:98: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:69: warning: `__KERNEL_COPYRIGHT' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:115: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:75: warning: `__link_set_make_entry' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:121: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:81: warning: `__link_set_add_text' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:127: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:82: warning: `__link_set_add_rodata' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:128: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:83: warning: `__link_set_add_data' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:129: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:84: warning: `__link_set_add_bss' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:130: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:90: warning: `__link_set_decl' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:134: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:92: warning: `__link_set_start' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:136: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:94: warning: `__link_set_end' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:137: warning: this is the location of the previous definition
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_aout.h:96: warning: `__link_set_count' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/sys/cdefs_elf.h:140: warning: this is the location of the previous definition
  In file included from /usr/src/regress/include/okheaders/symbolcheck.c:309:
  /usr/obj/usr/src/destdir.dreamcast/usr/include/soundcard.h:303: warning: `ioctl' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/rmt.h:46: warning: this is the location of the previous definition
  /usr/src/regress/include/okheaders/symbolcheck.c:312: stdbool.h: No such file or directory
  In file included from /usr/src/regress/include/okheaders/symbolcheck.c:333:
  /usr/obj/usr/src/destdir.dreamcast/usr/include/unctrl.h:40: warning: `unctrl' redefined
  /usr/obj/usr/src/destdir.dreamcast/usr/include/curses.h:185: warning: this is the location of the previous definition
  nbmkdep: compile failed.


I suppose mkdep will pretty much ignore the warnings, so the only
problem that's still there, is the non-existance of stdbool.h.

From /usr/src/include/Makefile:

  .include <bsd.own.mk>

  .if ${HAVE_GCC3} == "yes"
  INCS+=  stdbool.h
  .endif

and in <bsd.own.mk> you can see that all archs except for sh3eb,
sh3el and vax set HAVE_GCC3 to "yes" - the remaining three set it
to "no".  So, it's no wonder that there's no <stdbool.h>.  The
question is, what's a clean way to work around this in symbolcheck.c?
I don't really have too deep knowledge about the existing
preprocessor definitions, so I don't know how to check wether the
target platform we're compiling for is sh3el in symbolcheck.c.
Does anybody have an idea how to fix this?


bye,
  Harold