OpenCores
no use no use 1/1 no use no use
Error by vompiling Or1ksim and toolchain
by ag09 on Aug 15, 2011
ag09
Posts: 38
Joined: Aug 22, 2010
Last seen: Jan 13, 2012
Hi all,


I am trying unsuccessfully to compile the latest version of both or1ksim and toolchain, which I checked out from the svn, on both Fedora 15 and Ubuntu 11.4.


Did someone face the the same? Is there any update in sight to force this problem?

Many thanks
RE: Error by vompiling Or1ksim and toolchain
by jeremybennett on Aug 15, 2011
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Hi ag09,

Looks like this is a problem with GCC 4.6. It's even more picky about standards compliance, and even more efficient at spotting bad programming (like unused variables). Since both or1ksim and the tool chain are compiled with -Werror, this blows up. In fact it even blew up some of the configure tests for Or1ksim.

I've fixed the configure tests, but that then exposes some deeper issues with Or1ksim, which for now I'll fix by turning off -Werror. The GNU tool chain issues can be fixed by turning off -Werror.

It'll take me a short while to get his committed. I'll post when I'm done.

Jeremy

--
Tel: +44 (1590) 610184
Cell: +44 (7970) 676050
SkypeID: jeremybennett
Email: jeremy.bennett@embecosm.com
Web: www.embecosm.com

RE: Error by vompiling Or1ksim and toolchain
by jeremybennett on Aug 15, 2011
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Changes committed to SVN. Revision 625 (Or1ksim fixes) and 626 (GNU tools script).

HTH

Jeremy

RE: Error by vompiling Or1ksim and toolchain
by ag09 on Aug 15, 2011
ag09
Posts: 38
Joined: Aug 22, 2010
Last seen: Jan 13, 2012
Thanks a lot Jeremy.

The or1ksim had been compiled fine yet, but I got the following error while configuring the toolchain:

../../unisrc/bfd/verilog.c:231:7: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [verilog.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f .deps/compress.Tpo .deps/compress.Plo
mv -f .deps/dwarf2.Tpo .deps/dwarf2.Plo

make: *** [all-bfd] Error 2
make (all-build all-binutils all-gas all-ld) failed.

Any suggestion!
RE: Error by vompiling Or1ksim and toolchain
by jeremybennett on Aug 16, 2011
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Thanks a lot Jeremy.

The or1ksim had been compiled fine yet, but I got the following error while configuring the toolchain:

 ../../unisrc/bfd/verilog.c:231:7: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [verilog.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f .deps/compress.Tpo .deps/compress.Plo
mv -f .deps/dwarf2.Tpo .deps/dwarf2.Plo

make: *** [all-bfd] Error 2
make (all-build all-binutils all-gas all-ld) failed.

Any suggestion!

Hi ag09,

Don't know what causes this. Could you post the full error (i.e. the entire compile command), so I can diagnose.

I did commit some changes to Or1ksim and bld-all.sh to make them work better with GCC 4.6. You may want to do and SVN update and try again.

Best wishes,

Jeremy

RE: Error by vompiling Or1ksim and toolchain
by ag09 on Aug 16, 2011
ag09
Posts: 38
Joined: Aug 22, 2010
Last seen: Jan 13, 2012
Hallo Jeremy,

I checked out the last changed version 626 of the toolchain.But I get the same errors I got as before.



mv -f .deps/tekhex.Tpo .deps/tekhex.Plo
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include -DBINDIR='"/local/home/openrisc/bin"' -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT stab-syms.lo -MD -MP -MF .deps/stab-syms.Tpo -c -o stab-syms.lo ../../unisrc/bfd/stab-syms.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include -DBINDIR=\"/local/home/openrisc/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT stab-syms.lo -MD -MP -MF .deps/stab-syms.Tpo -c ../../unisrc/bfd/stab-syms.c -o stab-syms.o
mv -f .deps/stab-syms.Tpo .deps/stab-syms.Plo
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include -DBINDIR='"/local/home/openrisc/bin"' -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT merge.lo -MD -MP -MF .deps/merge.Tpo -c -o merge.lo ../../unisrc/bfd/merge.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include -DBINDIR=\"/local/home/openrisc/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT merge.lo -MD -MP -MF .deps/merge.Tpo -c ../../unisrc/bfd/merge.c -o merge.o
mv -f .deps/stabs.Tpo .deps/stabs.Plo
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include -DBINDIR='"/local/home/openrisc/bin"' -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT dwarf2.lo -MD -MP -MF .deps/dwarf2.Tpo -c -o dwarf2.lo -DDEBUGDIR=\"/local/home/openrisc/lib/debug\" ../../unisrc/bfd/dwarf2.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include -DBINDIR=\"/local/home/openrisc/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT dwarf2.lo -MD -MP -MF .deps/dwarf2.Tpo -c -DDEBUGDIR=\"/local/home/openrisc/lib/debug\" ../../unisrc/bfd/dwarf2.c -o dwarf2.o
mv -f .deps/ihex.Tpo .deps/ihex.Plo
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include -DBINDIR='"/local/home/openrisc/bin"' -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT simple.lo -MD -MP -MF .deps/simple.Tpo -c -o simple.lo ../../unisrc/bfd/simple.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include -DBINDIR=\"/local/home/openrisc/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT simple.lo -MD -MP -MF .deps/simple.Tpo -c ../../unisrc/bfd/simple.c -o simple.o
mv -f .deps/merge.Tpo .deps/merge.Plo
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include -DBINDIR='"/local/home/openrisc/bin"' -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT compress.lo -MD -MP -MF .deps/compress.Tpo -c -o compress.lo ../../unisrc/bfd/compress.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include -DBINDIR=\"/local/home/openrisc/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT compress.lo -MD -MP -MF .deps/compress.Tpo -c ../../unisrc/bfd/compress.c -o compress.o
mv -f .deps/simple.Tpo .deps/simple.Plo
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include -DBINDIR='"/local/home/openrisc/bin"' -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT verilog.lo -MD -MP -MF .deps/verilog.Tpo -c -o verilog.lo ../../unisrc/bfd/verilog.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include -DBINDIR=\"/local/home/openrisc/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT verilog.lo -MD -MP -MF .deps/verilog.Tpo -c ../../unisrc/bfd/verilog.c -o verilog.o
../../unisrc/bfd/verilog.c: In function 'verilog_write_section':
../../unisrc/bfd/verilog.c:231:7: error: 'address' undeclared (first use in this function)
../../unisrc/bfd/verilog.c:231:7: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [verilog.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
RE: Error by vompiling Or1ksim and toolchain
by jeremybennett on Aug 16, 2011
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Hi ag09

I'm baffled. What version of GCC do you have on your machine?

Here is the listing of the offending function.

    214 static bfd_boolean
    215 verilog_write_section (bfd *abfd,
    216 		           tdata_type *tdata ATTRIBUTE_UNUSED,
    217		           verilog_data_list_type *list)
    218 {
    219   unsigned int octets_written = 0;
    220   bfd_byte *location = list->data;
    221
    222   verilog_write_address (abfd, list->where);
    223   while (octets_written size)
    224     {
    225       bfd_vma address;
    226       unsigned int octets_this_chunk = list->size - octets_written;
    227
    228       if (octets_this_chunk > 16)
    229	    octets_this_chunk = 16;
    230
    231       address = list->where + octets_written / bfd_octets_per_byte (abfd);
    232
    233      if (! verilog_write_record (abfd,
    234				     location,
    235				     location + octets_this_chunk))
    236 	    return FALSE;
    237
    238       octets_written += octets_this_chunk;
    239       location += octets_this_chunk;
    240     }
    241
    242   return TRUE;
    243 }
    

As you can see "address" is declared on line 225, prior to its use on line 231.

You could try manually running the compilation line:

    gcc -DHAVE_CONFIG_H -I. -I../../unisrc/bfd -I. -I../../unisrc/bfd -I../../unisrc/bfd/../include \
    -DBINDIR=\"/local/home/openrisc/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -MT \
    verilog.lo -MD -MP -MF .deps/verilog.Tpo -c ../../unisrc/bfd/verilog.c -o verilog.o
    

You would have to run this from the build directory bfd sub-directory. Assuming this gets the same error, you could then try replacing -c with -E and making the output verilog.preproc.c. Look at the code for this function in the preprocessed output, to see if there is anything odd about the declaration of "address".

HTH

Jeremy

RE: Error by compiling Or1ksim and toolchain
by ag09 on Aug 16, 2011
ag09
Posts: 38
Joined: Aug 22, 2010
Last seen: Jan 13, 2012
Hi Jeremy,

by verifying the compilation errors I excluded the variable address. Now it compiled fine and the generated toolchain works fine too. But by executing the last step of the bld-all.sh, namely by removing the build directories, it seems that there are problems...


bld-all.sh: Configuring uClibc
CLEAN ldso/ldso
CLEAN ldso/libdl
CLEAN libcrypt
CLEAN libintl
CLEAN libm
CLEAN libnsl
CLEAN libresolv
CLEAN libutil
CLEAN librt
CLEAN extra/locale
CLEAN libc/sysdeps/linux/
CLEAN libc/sysdeps/linux/common
CLEAN libc/misc/assert
CLEAN libc/misc/ctype
CLEAN libc/misc/dirent
CLEAN libc/misc/error
CLEAN libc/misc/elf
CLEAN libc/misc/file
CLEAN libc/misc/fnmatch
CLEAN libc/misc/ftw
CLEAN libc/misc/glob
CLEAN libc/misc/gnu
CLEAN libc/misc/internals
CLEAN libc/misc/locale
CLEAN libc/misc/mntent
CLEAN libc/misc/regex
CLEAN libc/misc/search
CLEAN libc/misc/statfs
CLEAN libc/misc/syslog
CLEAN libc/misc/sysvipc
CLEAN libc/misc/time
CLEAN libc/misc/ttyent
CLEAN libc/misc/utmp
CLEAN libc/misc/wchar
CLEAN libc/misc/wctype
CLEAN libc/misc/wordexp
CLEAN libc/pwd_grp
CLEAN libc/stdio
CLEAN libc/string
CLEAN libc/termios
CLEAN libc/inet/rpc
CLEAN libc/inet
CLEAN libc/signal
CLEAN libc/stdlib/malloc
CLEAN libc/stdlib/malloc-simple
CLEAN libc/stdlib/malloc-standard
CLEAN libc/stdlib
CLEAN libc/unistd
CLEAN libc
CLEAN utils
make -s -C test clean
make[2]: *** ../../.config: Is a directory. Stop.
make[1]: *** [_dirclean_termios] Error 2
make: *** [clean] Error 2
uClibc clean failed
======================================

Thanks a lot for your support.
RE: Error by vompiling Or1ksim and toolchain
by jeremybennett on Aug 16, 2011
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Hi ag09

Has your uClibc got corrupted. If you got the main uClibc directory and run:

    make ARCH=or32 clean
    

does that work?

Can you try a complete build from scratch using bld-all.sh (i.e. using ./bld-all.sh --force ...)

HTH

Jeremy

RE: Error by vompiling Or1ksim and toolchain
by ag09 on Aug 17, 2011
ag09
Posts: 38
Joined: Aug 22, 2010
Last seen: Jan 13, 2012

Has your uClibc got corrupted. If you got the main uClibc directory and run:

    make ARCH=or32 clean
    

does that work?



If I call the aforementioned command in the uClibc directory I get the same error!

Can you try a complete build from scratch using bld-all.sh (i.e. using ./bld-all.sh --force ...)




Actually I build the toolchain twice from scratch using this command (following the installation guideline from openrisc) and nothing has been changed...

./bld-all.sh --force --prefix /opt/openrisc --or1ksim-dir /opt/or1ksim --uclibc-dir uClibc --linux-dir linux
no use no use 1/1 no use no use
© copyright 1999-2026 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.