GNUSH news

GNUSH v11.01

KPIT Cummins Infosystems Limited is releasing the GNUSH v11.01, a cross compiler tool for Renesas SH micro-controllers.

SALIENT FEATURES:

1. The GNUSH v11.01 toolchain is based on gcc-4.5.2 [released], binutils-2.21 [released], newlib-1.18.0 [released] and gdb-7.2.50 [snapshot dated 7th December 2010].

2. The latest patches are applied to gcc, binutils and newlib sources.

Please visit the following link for the patches applied to the GNUSH toolchain:

http://www.kpitgnutools.com/phpmyfaq/index.php?aktion=artikel&rubrik=002004&id=78&lang=en

3. The GNUSH v11.01 ELF toolchain installer supports integration with KPIT Eclipse.

Please visit the following link for information on the latest releases of KPIT Eclipse:

http://www.kpitgnutools.com/releaseNotes.php

ABOUT GNUSH v11.01 :

Release Version: GNUSH v11.01

Release Date: 1st March 2011

Platforms Supported: Red Hat GNU/Linux v8.0 or later (or compatible distribution) Windows NT/2000/XP/Vista/Windows 7

Language: C, C99, C++

Targets:

SH-1

SH-2

SH-2A

SH-2E

SH2-DSP

SH-3

SH-3E

SH3-DSP

SH-4

SH-4A

SH-4AL-DSP

Object File Format: ELF
 
GNUSH v12.01

KPIT Cummins Infosystems Limited is releasing the GNUSH v12.01, a cross compiler tool for Renesas SH micro-controllers.

SALIENT FEATURES:

1. The GNUSH v12.01 toolchain is based on, gcc-4.6.2 [released], binutils-2.22 [released], newlib-1.20.0 [released] and gdb-7.3.1 [released].

2. The latest patches are applied to gcc, binutils and newlib sources.

Please visit the following link for the patches applied to the GNUSH toolchain:

http://www.kpitgnutools.com/phpmyfaq/index.php?aktion=artikel&rubrik=002004&id=78&lang=en

ABOUT GNUSH v12.01 :

Release Version: GNUSH v12.01

Release Date: 13th March 2012

Platforms Supported: Red Hat GNU/Linux v8.0 or later (or compatible distribution) Windows NT/2000/XP/Vista/Windows 7

Language: C, C99, C++

Targets:

SH-1

SH-2

SH-2A

SH-2E

SH2-DSP

SH-3

SH-3E

SH3-DSP

SH-4

SH-4A

SH-4AL-DSP

Object File Format: ELF

CHANGES THE GNUSH-ELF v12.01 RELEASE:

This section describes the enhancements made and the issues fixed in the v12.01 release.

OPTLIB:

1. The LOG10, LOG and POW functions of optimized libraries generated incorrect output for SH4 Single-Only (Little Endian) and SH4A Single-Only (Little Endian) targets. This bug has now been fixed.
 
vbt said:
GNUSH v12.01

It produces smaller (faster?) code, on FBA :

03/11/2011 12:57 4 516 czet.o

03/11/2011 12:57 1 260 burn_sound_c.o

03/11/2011 12:57 3 780 eeprom.o

03/11/2011 12:57 1 856 load.o

03/11/2011 12:57 1 632 kabuki.o

03/11/2011 12:57 5 808 mc8123.o

03/11/2011 12:57 4 032 sn76496.o

03/11/2011 12:57 2 372 psg.o

03/11/2011 12:57 6 228 ay8910.o

03/11/2011 12:57 4 580 msm6295.o

03/11/2011 12:58 14 664 d_bankp.o

12/11/2011 01:24 61 904 d_sys1.o

12/11/2011 01:36 2 416 burn.o

12/11/2011 02:04 17 508 d_mitchell.o

14 File(s) 132 556 bytes

131 848 => gnush 12

03/11/2011 01:12 26 724 cz80.o

1 File(s) 26 724 bytes

27 912 bytes => gnush 12

03/11/2011 12:57 1 248 font.o

11/11/2011 20:10 17 584 saturn.o

11/11/2011 20:46 1 560 file.o

3 File(s) 20 392 bytes

20 380 bytes => gnush 12

12/11/2011 02:04 222 768 sl.bin

221 608 sl.bin => gnush 12
 
problem with wolfenstein3d, it doesn't happen with gnush11

if i link with gnush11 it work (with source compiled with gnush12)

wl_act2.cpp:(.text+0x52d4): undefined reference to `__truncdfsf2'

wl_act2.cpp:(.text+0x52d8): undefined reference to `__gtsf2t'

wl_act2.cpp:(.text+0x52e0): undefined reference to `__extendsfdf2'

wl_act2.cpp:(.text+0x52e4): undefined reference to `__adddf3'

wl_act2.cpp:(.text+0x52f4): undefined reference to `__divdf3'

wl_act2.cpp:(.text+0x52f8): undefined reference to `__muldf3'

wl_act2.cpp:(.text+0x5300): undefined reference to `__fixdfsi'

wl_act2.cpp:(.text+0x5314): undefined reference to `__ashiftrt_r4_8'

wl_draw.o: In function `TransformActor(objstruct*)':

wl_draw.cpp:(.text+0x16c): undefined reference to `__sdivsi3_i4i'

wl_draw.cpp:(.text+0x174): undefined reference to `__ashiftrt_r4_8'

wl_draw.o: In function `TransformTile(int, int, short*, short*)':

wl_draw.cpp:(.text+0x280): undefined reference to `__sdivsi3_i4i'

wl_draw.cpp:(.text+0x288): undefined reference to `__ashiftrt_r4_8'

wl_draw.o: In function `CalcHeight()':

wl_draw.cpp:(.text+0x320): undefined reference to `__ashiftrt_r4_8'

wl_draw.cpp:(.text+0x328): undefined reference to `__sdivsi3_i4i'

wl_draw.o: In function `VGAClearScreen()':

wl_draw.cpp:(.text+0x1128): undefined reference to `memset'

wl_draw.o: In function `ScaleShape(int, int, unsigned int, unsigned long)':

wl_draw.cpp:(.text+0x155c): undefined reference to `__ashiftrt_r4_6'

wl_draw.o: In function `SimpleScaleShape(int, int, unsigned int)':

wl_draw.cpp:(.text+0x180c): undefined reference to `__ashiftrt_r4_6'

wl_draw.o: In function `AsmRefresh()':

wl_draw.cpp:(.text+0x2500): undefined reference to `__ashiftrt_r4_6'

wl_draw.cpp:(.text+0x2728): undefined reference to `__ashiftrt_r4_6'

wl_draw.cpp:(.text+0x2914): undefined reference to `__ashiftrt_r4_6'

wl_draw.o:wl_draw.cpp:(.text+0x2ad4): more undefined references to `__ashiftrt_r

4_6' follow

wl_draw.o: In function `ThreeDRefresh()':

wl_draw.cpp:(.text+0x35c4): undefined reference to `memset'

wl_draw.cpp:(.text+0x3640): undefined reference to `slLocate'

wl_draw.cpp:(.text+0x3644): undefined reference to `slPrint'

wl_draw.cpp:(.text+0x364c): undefined reference to `sprintf'

wl_game.o: In function `SetupGameLevel()':

wl_game.cpp:(.text+0x3d4): undefined reference to `memset'

wl_game.o: In function `LatchNumberHERE(int, int, unsigned int, long)':

wl_game.cpp:(.text+0x13a4): undefined reference to `sprintf'

wl_game.cpp:(.text+0x13ac): undefined reference to `strlen'

wl_game.o: In function `StartDemoRecord(int)':

wl_game.cpp:(.text+0x1514): undefined reference to `malloc'

wl_game.o: In function `FinishDemoRecord()':

wl_game.cpp:(.text+0x1614): undefined reference to `__ashiftrt_r4_8'

wl_game.cpp:(.text+0x1650): undefined reference to `free'

wl_game.cpp:(.text+0x1654): undefined reference to `atoi'

wl_game.o: In function `RecordDemo()':

wl_game.cpp:(.text+0x17f0): undefined reference to `atoi'

wl_game.o: In function `PlayDemo(int)':

wl_game.cpp:(.text+0x1964): undefined reference to `free'

wl_game.o: In function `Died()':

wl_game.cpp:(.text+0x1cf8): undefined reference to `__floatsisf'

wl_game.cpp:(.text+0x1cfc): undefined reference to `__fixsfsi'

wl_game.cpp:(.text+0x1d00): undefined reference to `MTH_Atan'

wl_game.cpp:(.text+0x1d04): undefined reference to `__gtsf2t'

wl_game.cpp:(.text+0x1d0c): undefined reference to `__extendsfdf2'

wl_game.cpp:(.text+0x1d10): undefined reference to `__adddf3'

wl_game.cpp:(.text+0x1d1c): undefined reference to `__truncdfsf2'

wl_game.cpp:(.text+0x1d20): undefined reference to `__divdf3'

wl_game.cpp:(.text+0x1d24): undefined reference to `__muldf3'

wl_game.cpp:(.text+0x1d2c): undefined reference to `__fixdfsi'

wl_game.o: In function `GameLoop()':

wl_game.cpp:(.text+0x2280): undefined reference to `memcpy'

wl_play.o: In function `PollControls()':

wl_play.cpp:(.text+0x340): undefined reference to `__sdivsi3_i4i'

....

l:/saturn/SBL6/SEGALIB/GFS/elf/gfs_cdc2.o: In function `GFCD_Init':

gfs_cdc2.c:(.text+0x14ec): undefined reference to `CDC_AbortFile'

gfs_cdc2.c:(.text+0x14f0): undefined reference to `CDC_CdInit'

gfs_cdc2.c:(.text+0x14f4): undefined reference to `CDC_SetSctLen'

gfs_cdc2.c:(.text+0x1504): undefined reference to `CDC_ClrHirqReq'

gfs_cdc2.c:(.text+0x1508): undefined reference to `CDC_DataEnd'

gfs_cdc2.c:(.text+0x1510): undefined reference to `CDC_TgetToc'

gfs_cdc2.c:(.text+0x1514): undefined reference to `CDC_GetSes'

gfs_cdc2.c:(.text+0x151c): undefined reference to `CDC_ResetSelector'

l:/saturn/SBL6/SEGALIB/GFS/elf/gfs_cdf2.o: In function `GFCF_cnvIntlvOfs':

gfs_cdf2.c:(.text+0x150): undefined reference to `__sdivsi3_i4i'

l:/saturn/SBL6/SEGALIB/GFS/elf/gfs_trn2.o: In function `gftr_getSrcPack':

gfs_trn2.c:(.text+0xec): undefined reference to `__sdivsi3_i4i'

l:/saturn/SBL6/SEGALIB/GFS/elf/gfs_dir2.o: In function `GFDR_NameToId':

gfs_dir2.c:(.text+0x50): undefined reference to `strncmp'

l:/saturn/SBL6/SEGALIB/GFS/elf/gfs_dir2.o: In function `gfdr_read':

gfs_dir2.c:(.text+0x1d0): undefined reference to `memset'

gfs_dir2.c:(.text+0x1d8): undefined reference to `memcpy'

l:/saturn/SBL6/SEGALIB/GFS/elf/gfs_dir2.o: In function `gfdr_setupDirNameTbl':

gfs_dir2.c:(.text+0x7c4): undefined reference to `strncmp'

gfs_dir2.c:(.text+0x7c8): undefined reference to `strncpy'

wl_main.o: In function `main':

wl_main.cpp:(.text.startup+0x1d4): undefined reference to `atexit'

wl_main.cpp:(.text.startup+0x208): undefined reference to `slTVOff'

wl_main.cpp:(.text.startup+0x220): undefined reference to `slTVOn'

wl_main.cpp:(.text.startup+0x224): undefined reference to `slLocate'

wl_main.cpp:(.text.startup+0x228): undefined reference to `slPrint'

wl_main.cpp:(.text.startup+0x454): undefined reference to `printf'

wl_main.cpp:(.text.startup+0x45c): undefined reference to `exit'

wl_main.o: In function `_GLOBAL__sub_I_str':

wl_main.cpp:(.text.startup+0x484): undefined reference to `__sdivsi3_i4i'

collect2: ld returned 1 exit status

make: *** [root/sl.coff] Error 1
 
Can you successfully build a simple "hello world" application? If that works, go over your linker invocation in your makefile. In particular, the library and object file order matters. GNU ld will only keep symbols from static libraries it thinks are needed, so if the object a.o depends on the library b.a, a.o must appear before b.a on the linker command line.
 
The missing refs sounds like you're missing the libraries. Maybe they changed the path in the latest arc. Double check the paths for libc, libgcc, and libgcc-Os-4-200.
 
Chilly Willy said:
The missing refs sounds like you're missing the libraries. Maybe they changed the path in the latest arc. Double check the paths for libc, libgcc, and libgcc-Os-4-200.

I did, I don't see any difference, i never used -lgcc-Os-4-200 to compile.

for test only, not tested on saturn yet :

*

http://vberthelot.free.fr/test.rar
 
vbt said:
I did, I don't see any difference, i never used -lgcc-Os-4-200 to compile.

AFAIK, the need to link against gcc-Os-4-200 was a bug in early GCC 4.2. It's not needed anymore.
 
antime said:
AFAIK, the need to link against gcc-Os-4-200 was a bug in early GCC 4.2. It's not needed anymore.

Hmm - I'll have to check that out. I can't remember the last time I tried not linking to it. It was required for compiling as SH2 as opposed to SH1.

And... nope! It's still needed. Without that lib, you get this with Wolf32X compiled with 4.6.2:

Code:
src/id_vh.o: In function `VL_FadeOut':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/id_vh.c:83: undefined reference to `___sdivsi3_i4i'

src/id_vh.o: In function `VL_FadeIn':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/id_vh.c:122: undefined reference to `___sdivsi3_i4i'

src/wl_act2.o: In function `T_Chase':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_act2.c:2042: undefined reference to `___sdivsi3_i4i'

src/wl_draw.o: In function `DrawSpans':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:506: undefined reference to `___sdivsi3_i4i'

src/wl_draw.o: In function `DrawPlanes':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:594: undefined reference to `___sdivsi3_i4i'

src/wl_draw.o:/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:280: more undefined references to `___sdivsi3_i4i' follow

src/wl_draw.o: In function `DrawScaleds':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:280: undefined reference to `___udivsi3_i4i'

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:358: undefined reference to `___udivsi3_i4i'

src/wl_draw.o: In function `CalcHeight':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:806: undefined reference to `___sdivsi3_i4i'

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:806: undefined reference to `___udivsi3_i4i'

src/wl_draw.o: In function `HitVertDoor':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:862: undefined reference to `___sdivsi3_i4i'

src/wl_draw.o: In function `ScaledDrawTrans':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:757: undefined reference to `___sdivsi3_i4i'

src/wl_draw.o: In function `HitHorizWall':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:927: undefined reference to `___sdivsi3_i4i'

src/wl_draw.o: In function `SimpleScaleShape':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:772: undefined reference to `___sdivsi3_i4i'

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:772: undefined reference to `___udivsi3_i4i'

src/wl_draw.o: In function `ScaledDrawTrans':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:772: undefined reference to `___udivsi3_i4i'

src/wl_draw.o: In function `AsmRefresh':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:1173: undefined reference to `___sdivsi3_i4i'

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:1173: undefined reference to `___udivsi3_i4i'

src/wl_draw.o: In function `HitHorizDoor':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:833: undefined reference to `___udivsi3_i4i'

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:833: undefined reference to `___sdivsi3_i4i'

src/wl_draw.o: In function `HitVertDoor':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:862: undefined reference to `___udivsi3_i4i'

src/wl_draw.o: In function `DeCompileSprite':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:746: undefined reference to `___udivsi3_i4i'

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_draw.c:746: undefined reference to `___udivsi3_i4i'

src/wl_inter.o: In function `LevelCompleted':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_inter.c:640: undefined reference to `___sdivsi3_i4i'

src/wl_inter.o: In function `PreloadUpdate':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_inter.c:869: undefined reference to `___sdivsi3_i4i'

src/wl_main.o: In function `NewViewSize':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_main.c:820: undefined reference to `___sdivsi3_i4i'

src/wl_play.o: In function `PollMouseMove':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_play.c:317: undefined reference to `___sdivsi3_i4i'

src/wl_play.o: In function `PollMouseButtons':

/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_play.c:225: undefined reference to `___sdivsi3_i4i'

src/wl_play.o:/home/jlfenton/Projects/MegaDrive/games/Wolf32X-exp/src/wl_play.c:474: more undefined references to `___sdivsi3_i4i' follow

/opt/toolchains/sega/sh-elf/sh-elf/lib/libc.a(lib_a-strtol.o): In function `_strtol_r':

/home/jlfenton/Projects/toolchains/build-newlib-sh-elf-1.20.0/sh-elf/newlib/libc/stdlib/../../../../../newlib-1.20.0/newlib/libc/stdlib/strtol.c:166: undefined reference to `___udivsi3_i4i'

/opt/toolchains/sega/sh-elf/sh-elf/lib/libc.a(lib_a-dtoa.o): In function `quorem':

/home/jlfenton/Projects/toolchains/build-newlib-sh-elf-1.20.0/sh-elf/newlib/libc/stdlib/../../../../../newlib-1.20.0/newlib/libc/stdlib/dtoa.c:142: undefined reference to `___udivsi3_i4i'

collect2: ld returned 1 exit status

make: *** [Wolfenstein3D.elf] Error 1

So it's just as I learned before - if you compile for SH2 (-m2), you NEED to link against that lib. If you compile to SH1, you don't, but you also can't take advantage of the extra SH2 instructions. I used to compile my 32X stuff as SH1 until I learned to link against gcc-Os-4-200.
 
antime said:
Works for me. Are you compiling with -nodefaultlibs?

I wasn't, but adding it makes no difference - still get those errors. I think it's more from using the gcc libc and libgcc than any flags - you use the libc and libgcc, you HAVE to use libgcc-Os-4-200 for SH2.

I use libc and libm from newlib, and libgcc from gcc. On something like the SH2, I don't see using custom libc/libm as necessary. Even on the 68000, using newlib isn't a big deal.
 
I didn't find yet, I just can say all my projects in C compile well, Wolf3D is my only C++ project. Chilly Willy, you compile .c files and me .cpp maybe that's the difference.
 
I'm using the simplest possible GCC+Newlib toolchain (--target=sh-elf --enable-languages="c,c++" --with-newlib). GCC is set up to implicitly link against libgcc-Os-4-200 (look in the GCC specs files), but -nodefaultlibs would of course prevent that.
 
vbt said:
I didn't find yet, I just can say all my projects in C compile well, Wolf3D is my only C++ project. Chilly Willy, you compile .c files and me .cpp maybe that's the difference.

My C++ example, as simple as it is, requires it too.

Code:
-lstdc++ -lc -lgcc -lgcc-Os-4-200 -lnosys

The SH2 build of libgcc simply REQUIRES libgcc-Os-4-200.

antime said:
I'm using the simplest possible GCC+Newlib toolchain (--target=sh-elf --enable-languages="c,c++" --with-newlib). GCC is set up to implicitly link against libgcc-Os-4-200 (look in the GCC specs files), but -nodefaultlibs would of course prevent that.

I tried -nodefaultlibs and it doesn't change the behavior. The only flag I know of that does is the machine flag... -m1 doesn't require it, and -m2 does. Like I said above, if you use libgcc for the SH2, you have to use the other or you get the link errors I posted previously.
 
There is definitely something weird about your setup. GCC automatically links against libgcc, libgcc-Os-4-200 and libc unless you use -nodefaultlibs or -nostdlib. G++ will also automatically link against libstdc++ unless explicitely prevented. Do you have a small example project I could try?
 
it's fixed
sad.gif


there was in my link script --format=coff-sh it worked on gnush11, i have put --format=elf32-sh instead

also can someone explain me how to use newlib with kpit gnush
 
antime said:
There is definitely something weird about your setup. GCC automatically links against libgcc, libgcc-Os-4-200 and libc unless you use -nodefaultlibs or -nostdlib. G++ will also automatically link against libstdc++ unless explicitely prevented. Do you have a small example project I could try?

http://segaxtreme.net/community/topic/18627-time-to-update-to-gcc-462/

You'll find the archive of examples towards the bottom. You'll want the 32X examples... there is both a C and a C++ example, both of which show the same behavior, with or without -nodefaultlibs. They use -nostdlib to prevent gcc from automatically linking in the "standard" crt0.o, and then the makefile links in libc libgcc libgc-Os-4-200.
 
Chilly Willy said:
They use -nostdlib to prevent gcc from automatically linking in the "standard" crt0.o, and then the makefile links in libc libgcc libgc-Os-4-200.

That would explain it. Quoting the GCC documentation:

One of the standard libraries bypassed by -nostdlib and -nodefaultlibs is libgcc.a, a library of internal subroutines which GCC uses to overcome shortcomings of particular machines, or special needs for some languages.

If you just want to use a custom crt0, use the -nostartfiles option instead.
 
antime said:
That would explain it. Quoting the GCC documentation:

If you just want to use a custom crt0, use the -nostartfiles option instead.

Ah - okay. So if you don't need those other libs (or are using minimal replacements), use -nostartfiles. Thanks for pointing that out. It's hard to keep track of all those crazy options, ESPECIALLY the ones for optimization.
biggrin.gif
 
Back
Top