Re: Fwd: Regarding the sid simulator [patch][commit]
Dave Brolley <[email protected]> Wed, 29 Nov 2006 16:20:40 -0500
| Newsgroups | gmane.comp.emulators.sid.devel |
|---|---|
| Message-ID | <[email protected]> |
I've committed the attached patch which should correct the problem of shCfg.cxx being compiled and linked twice. Dave Avinash Malik wrote: > On 11/28/06, Frank Ch. Eigler <[email protected]> wrote: >> Hi - >> >> On Tue, Nov 28, 2006 at 12:31:01PM +1300, Avinash Malik wrote: >> > [...] >> > After a lot of work arounds I could get sid compiled and >> installed. >> > But I still cannot target the SHboard since that gives me a internal >> > compiler error: segmentation fault. >> >> These are the errors I'm seeing building today's cvs sid with FC5's >> gcc-4.1.1: >> >> make[1]: Entering directory `..../sid/main/dynamic' >> /bin/sh ./libtool --tag=CXX --mode=link c++ -DSIDTARGET_SH >> -DSIDTARGET_SH64 -g -O2 -o sid -export-dynamic -static >> -export-symbols-regex '[a-zA-Z0-9]*_library$' >> ../../component/cfgroot/libconfig.la mainDynamic.o baseCfg.o >> commonCfg.o shCfg.o shCfg.o -L../../../libiberty/pic >> -L../../../libiberty -liberty >> c++ -DSIDTARGET_SH -DSIDTARGET_SH64 -g -O2 -o sid mainDynamic.o >> baseCfg.o commonCfg.o shCfg.o shCfg.o -Wl,--export-dynamic >> ../../component/cfgroot/.libs/libconfig.a -ldl -L....libiberty/pic >> -L....libiberty -liberty >> shCfg.o: In function `~ShBoardCfg': >> ../../../../src/sid/main/dynamic/shCfg.cxx:13: multiple definition of >> `ShBoardCfg::ShBoardCfg(std::basic_string<char, >> std::char_traits<char>, std::allocator<char> > const&, >> std::basic_string<char, std::char_traits<char>, std::allocator<char> >> > const&, SessionCfg*, std::basic_string<char, >> std::char_traits<char>, std::allocator<char> > const&)' >> shCfg.o:../../../../src/sid/main/dynamic/shCfg.cxx:13: first defined >> here >> shCfg.o: In function `mk_sh5_64media(std::basic_string<char, >> std::char_traits<char>, std::allocator<char> >, SessionCfg*)': >> ../../../../src/sid/main/dynamic/shCfg.cxx:219: multiple definition >> of `mk_sh5_64media(std::basic_string<char, std::char_traits<char>, >> std::allocator<char> >, SessionCfg*)' >> shCfg.o:../../../../src/sid/main/dynamic/shCfg.cxx:219: first defined >> here >> shCfg.o: In function `mk_sh5_32media(std::basic_string<char, >> std::char_traits<char>, std::allocator<char> >, SessionCfg*)': >> >> So there is definitely a problem. And from the compiler command line, >> it's easy to see: shCfg.o is being listed and linked twice. Dave? >
sh-config.ChangeLog
(text/plain, 380 B)
2006-11-29 Dave Brolley <[email protected]> * sidtargets.m4 (sidtarget_sh_or_sh64): New variable. (SIDTARGET_SH_OR_SH64): New automake conditional using sidtarget_sh_or_sh64. 2006-11-29 Dave Brolley <[email protected]> * Makefile.am (TARGETCFGS): Set based on SIDTARGET_SH_OR_SH64. * Makefile.in: Regenerated. * aclocal.m4: Regenerated. * configure: Regenerated.
sh-config.patch.txt
(text/plain, 2.9 KB)
Index: sid/config/sidtargets.m4
===================================================================
RCS file: /cvs/src/src/sid/config/sidtargets.m4,v
retrieving revision 1.8
diff -c -p -r1.8 sidtargets.m4
*** sid/config/sidtargets.m4 18 Oct 2006 18:42:36 -0000 1.8
--- sid/config/sidtargets.m4 29 Nov 2006 21:07:56 -0000
*************** sidtarget_mt=$sidtarget_default
*** 45,50 ****
--- 45,51 ----
sidtarget_ppc=$sidtarget_default
sidtarget_sh=$sidtarget_default
sidtarget_sh64=$sidtarget_default
+ sidtarget_sh_or_sh64=$sidtarget_default
sidtarget_xstormy16=$sidtarget_default
dnl Iterate over all listed targets
*************** do
*** 60,67 ****
mt*) sidtarget_mt=1 ;;
powerpc*) sidtarget_ppc=1 ;;
ppc*) sidtarget_ppc=1 ;;
! sh64*) sidtarget_sh64=1 ;;
! sh*) sidtarget_sh=1 ;;
xstormy16*) sidtarget_xstormy16=1 ;;
*) AC_MSG_WARN("Unknown target $targ") ;;
esac
--- 61,70 ----
mt*) sidtarget_mt=1 ;;
powerpc*) sidtarget_ppc=1 ;;
ppc*) sidtarget_ppc=1 ;;
! sh64*) sidtarget_sh64=1
! sidtarget_sh_or_sh64=1 ;;
! sh*) sidtarget_sh=1
! sidtarget_sh_or_sh64=1 ;;
xstormy16*) sidtarget_xstormy16=1 ;;
*) AC_MSG_WARN("Unknown target $targ") ;;
esac
*************** AC_SUBST(sidtarget_sh64)
*** 132,137 ****
--- 135,145 ----
AM_CONDITIONAL(SIDTARGET_SH64,[test "x$sidtarget_sh64" = x1])
AC_MSG_RESULT($sidtarget_sh64)
+ AC_MSG_CHECKING(SH or SH64 family support)
+ AC_SUBST(sidtarget_sh_or_sh64)
+ AM_CONDITIONAL(SIDTARGET_SH_OR_SH64,[test "x$sidtarget_sh_or_sh64" = x1])
+ AC_MSG_RESULT($sidtarget_sh_or_sh64)
+
AC_MSG_CHECKING(Sanyo Xstormy16 family support)
AC_SUBST(sidtarget_xstormy16)
AM_CONDITIONAL(SIDTARGET_XSTORMY16,[test "x$sidtarget_xstormy16" = x1])
Index: sid/main/dynamic/Makefile.am
===================================================================
RCS file: /cvs/src/src/sid/main/dynamic/Makefile.am,v
retrieving revision 1.13
diff -c -p -r1.13 Makefile.am
*** sid/main/dynamic/Makefile.am 18 Oct 2006 18:46:17 -0000 1.13
--- sid/main/dynamic/Makefile.am 29 Nov 2006 21:07:56 -0000
*************** TARGETCFGS = ""
*** 11,23 ****
TARGETDEFINES =
if SIDTARGET_SH
- TARGETCFGS += shCfg.cxx
TARGETDEFINES += -DSIDTARGET_SH
endif
if SIDTARGET_SH64
- TARGETCFGS += shCfg.cxx
TARGETDEFINES += -DSIDTARGET_SH64
endif
# If sid is being compiled without shared library support, arrange to
# statically link in a bunch of component libraries using libtool's
--- 11,24 ----
TARGETDEFINES =
if SIDTARGET_SH
TARGETDEFINES += -DSIDTARGET_SH
endif
if SIDTARGET_SH64
TARGETDEFINES += -DSIDTARGET_SH64
endif
+ if SIDTARGET_SH_OR_SH64
+ TARGETCFGS += shCfg.cxx
+ endif
# If sid is being compiled without shared library support, arrange to
# statically link in a bunch of component libraries using libtool's