Subject: Re: Self build error
To: None <port-dreamcast@netbsd.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-dreamcast
Date: 01/25/2003 05:45:27
In article <yf9r8bb27hn.fsf@mc.pp.se>
marcus@mc.pp.se wrote:

> > checking that C++ static constructors and destructors
> > are called... no
> > configure: error: a working C++ compiler is required
> > ***Error code 1
> > Stop.
> > nbmake: stopped in /usr/src/tools/groff
> > ***Error code 1

> Sounds more like "crt.o doesn't do .init/.fini".
> Not a problem with the compiler, but with csu.

The following patch seems to fix the problem.
(though I don't know gas statements..)

Index: sh3_elf/dot_init.h
===================================================================
RCS file: /cvsroot/src/lib/csu/sh3_elf/dot_init.h,v
retrieving revision 1.2
diff -u -r1.2 dot_init.h
--- sh3_elf/dot_init.h	2002/11/22 06:45:00	1.2
+++ sh3_elf/dot_init.h	2003/01/24 20:26:11
@@ -80,6 +80,7 @@
  */
 #define MD_CALL_STATIC_FUNCTION(section, func) \
 asm(".section " #section "\n"		\
+"    .globl " #func "	\n"		\
 "    mov.l 1f, r1	\n"		\
 "    mova 2f, r0	\n"		\
 "    braf r1		\n"		\

---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp