From fabio.giovagnini at aurion-tech.com Sat Jun 20 11:11:35 2009 From: fabio.giovagnini at aurion-tech.com (Fabio Giovagnini) Date: Sat, 20 Jun 2009 13:11:35 +0200 Subject: problem with gcc-4.3.3 on sh2a target Message-ID: <200906201311.35931.fabio.giovagnini@aurion-tech.com> Hi all, This is what I have discovered working around the gcc-4.3.3 form Code Surgery. This is the linker I'm using: OUTPUT_FORMAT("elf32-sh") OUTPUT_ARCH(sh2a) SEARCH_DIR("/usr/local/gcc-4.3-codesur/sh-elf/lib/m2a"); ENTRY("_start") This is the linker path I'm using: /usr/local/gcc-4.3-codesur/bin/sh-elf-ld -Map test-megameter.map -Trom.sh2a.7286.ld -o test-megameter.elf /home/fgiovagnini/acts/megameter3/test-megameter/.obj/crt0.o.... -L/usr/local/gcc-4.3-codesur/sh-elf/lib/m2a?????------------>???????????????????m2a -L/usr/local/gcc-4.3-codesur/lib/gcc/sh-elf/4.3.3/m2 -lgcc -lc---->?????m2?????????????????????????????????????? /usr/local/gcc-4.3-codesur/bin/sh-elf-objcopy -I elf32-sh -O srec --remove-section=.comment test-megameter.elf test-megameter.a37 Under the abouve conditions unsigned char TSTdbsize; float TSTfloat; ????????TSTdbsize = sizeof(float); ????????TSTfloat = TSTdbsize; ????????TSTfloat *=?????3.14; works properly When I use /usr/local/gcc-4.3-codesur/bin/sh-elf-ld -Map test-megameter.map -Trom.sh2a.7286.ld -o test-megameter.elf /home/fgiovagnini/acts/megameter3/test-megameter/.obj/crt0.o.... -L/usr/local/gcc-4.3-codesur/sh-elf/lib/m2a?????------------>???????????????????m2a -L/usr/local/gcc-4.3-codesur/lib/gcc/sh-elf/4.3.3/m2a -lgcc -lc---->????m2a????????????????????????????????????? /usr/local/gcc-4.3-codesur/bin/sh-elf-objcopy -I elf32-sh -O srec --remove-section=.comment test-megameter.elf test-megameter.a37 The same set of instructions doesn't work. I have discovered that calling __floatunsisf crashes the program; while using m2 libgcc works fine. I think that m2a libgcc is complied only for fpu support so also __floatunsisf is compiled with fpu instructions. It is stranga but it seems so. Where can I go deeper into this aspects? Anyone hs more infos about? -- Fabio Giovagnini Aurion s.r.l. Tel. +39.335.8350919 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini From ams at codesourcery.com Mon Jun 22 08:32:45 2009 From: ams at codesourcery.com (Andrew Stubbs) Date: Mon, 22 Jun 2009 09:32:45 +0100 Subject: [superh-gnu-discuss] problem with gcc-4.3.3 on sh2a target In-Reply-To: <200906201311.35931.fabio.giovagnini@aurion-tech.com> References: <200906201311.35931.fabio.giovagnini@aurion-tech.com> Message-ID: <4A3F41AD.3010700@codesourcery.com> Hi Fabio, On 20/06/09 12:11, Fabio Giovagnini wrote: > Hi all, > This is what I have discovered working around the gcc-4.3.3 form Code Surgery. We're a little confused about which CodeSourcery toolchain you have. We have never released an sh-elf toolchain, and have never made an SH2A lite release. Did you build it yourself? How does your compiler identify itself? Please run "sh-elf-gcc -v" and post the result. > This is the linker path I'm using: > /usr/local/gcc-4.3-codesur/bin/sh-elf-ld -Map test-megameter.map > -Trom.sh2a.7286.ld -o > test-megameter.elf /home/fgiovagnini/acts/megameter3/test-megameter/.obj/crt0.o.... > -L/usr/local/gcc-4.3-codesur/sh-elf/lib/m2a ------------> m2a > -L/usr/local/gcc-4.3-codesur/lib/gcc/sh-elf/4.3.3/m2 -lgcc -lc----> m2 > /usr/local/gcc-4.3-codesur/bin/sh-elf-objcopy -I elf32-sh -O srec > --remove-section=.comment test-megameter.elf test-megameter.a37 I do not know what the specific problem is, in this case. However, it is always important that all modules in a link use the same calling conventions, so mixing multilibs is never a good idea. For this reason it is always recommended that you link with gcc, and allow that to call ld with the proper -L options. You can pass your linker-specific parameters through gcc using -Wl. E.g.: sh-elf-gcc -Wl,-Map,test-megameter.map .... ... -Wl,--remove-section=.comment ........ Hope that helps Andrew CodeSourcery From fabio.giovagnini at aurion-tech.com Tue Jun 23 07:01:32 2009 From: fabio.giovagnini at aurion-tech.com (Fabio Giovagnini) Date: Tue, 23 Jun 2009 09:01:32 +0200 Subject: [superh-gnu-discuss] problem with gcc-4.3.3 on sh2a target In-Reply-To: <4A3F41AD.3010700@codesourcery.com> References: <200906201311.35931.fabio.giovagnini@aurion-tech.com> <4A3F41AD.3010700@codesourcery.com> Message-ID: <200906230901.32954.fabio.giovagnini@aurion-tech.com> Alle 10:32, luned? 22 giugno 2009, Andrew Stubbs ha scritto: > Hi Fabio, > > On 20/06/09 12:11, Fabio Giovagnini wrote: > > Hi all, > > This is what I have discovered working around the gcc-4.3.3 form Code > > Surgery. > > We're a little confused about which CodeSourcery toolchain you have. We > have never released an sh-elf toolchain, and have never made an SH2A > lite release. Did you build it yourself? RE: Yes I did > > How does your compiler identify itself? Please run "sh-elf-gcc -v" and > post the result. > RE: This is the result: ./sh-elf-gcc -v Using built-in specs. Target: sh-elf Configured with: ../../renesas-4.3-143-sh-linux-gnu/gcc-4.3/configure --prefix=/usr/local/gcc-4.3-codesur/ --target=sh-elf --enable-languages=c,c++ --with-newlib --disable-__cxa_atexit Thread model: single gcc version 4.3.3 (GCC) Thanksa lot for your replay > > This is the linker path I'm using: > > /usr/local/gcc-4.3-codesur/bin/sh-elf-ld -Map test-megameter.map > > -Trom.sh2a.7286.ld -o > > test-megameter.elf > > /home/fgiovagnini/acts/megameter3/test-megameter/.obj/crt0.o.... > > -L/usr/local/gcc-4.3-codesur/sh-elf/lib/m2a ------------> > > m2a -L/usr/local/gcc-4.3-codesur/lib/gcc/sh-elf/4.3.3/m2 -lgcc > > -lc----> m2 /usr/local/gcc-4.3-codesur/bin/sh-elf-objcopy -I > > elf32-sh -O srec --remove-section=.comment test-megameter.elf > > test-megameter.a37 > > I do not know what the specific problem is, in this case. However, it is > always important that all modules in a link use the same calling > conventions, so mixing multilibs is never a good idea. > > For this reason it is always recommended that you link with gcc, and > allow that to call ld with the proper -L options. > > You can pass your linker-specific parameters through gcc using -Wl. > > E.g.: > sh-elf-gcc -Wl,-Map,test-megameter.map .... > ... -Wl,--remove-section=.comment ........ > > Hope that helps > > Andrew > CodeSourcery -- Fabio Giovagnini Aurion s.r.l. Tel. +39.335.8350919 www.aurion-tech.com account telefono VoIP skype (www.skype.com): aurion.giovagnini