Re: [Simulavr-devel] simulavr-1.0.0 Build Fails.

2017-07-12 Thread Georg-Johann Lay

Hi, please CC me in your answers, I am not subscribed to this list
and just found your mail per accident while skimming the mail archive.

Thomas K a écrit:

(Not CC'ing you as I don't see you email address.)


Hi Johann,

as Klaus wrote, version 1.0 is just a little bit outdated :-) So, with
the current versions of gcc you'll get errors just because of newer
version of gcc!


If you get errors from g++, then maybe because g++ switched the default
language, cf. the "GCC 6 Release Series, Caveats".

http://gcc.gnu.org/gcc-6/changes.html

If you need some specific C++ dialect in the project, you can add
-std=... to the default XCCFLAGS, see

http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html

Moreover, some warnings indicate that varargs arguments don't fit the
expected %-code.  This might lead to simulavr crashing or going bananas.


But if I understand your "No avail." right, you're pinned on version
1.0? Why, 


I am not restricted to a specific version, it was just the case that
using master didn't fix "hwtiner.h not found".  And the run time error
"option -M not recognized" also persists with master.


what's your scope to use simulavr? (just curious)


Mainly because it supplies a gdb server.  I added a new feature to
GCC / GAS

https://gcc.gnu.org/PR81268

and was curious how a debugger would represent respective code.  As
I am not using debuggers for AVR, I am not really familiar with the
nits and bits thereof.  What I don't need is (internal) I/O simulation,
I'd be just fine with a working AVR core simulator + gdb server.

For GCC testing I am using avrtest simulator because of its speed,
and in cases when a run test fails, avrtest provides some nice features
for logging (and also profiling).


On the other hand, that hwtimer.h isn't found is not because of newer
gcc version. How do you get the package? Cloned from git repo? Or dist


$ git clone --branch master *.git


package (tar.gz)? Could you check, if the file hwtimer.h is contained in
your package and where?


As already noted, the problem is that simulavr has some implicit
"builddir == srcdir" assertions and is using bad include paths with -I.
It will need -I$(srcdir)/ui instead of -Iui and similar for some more
paths in CXXFLAGS.  In one case, the canonical choice would be 
$(top_srcdir).


I am preferring builddir != srcdir if possible, and autotools support
it well.  Just see configure --help.  I supplied a patch to fix that
issue.  I'd expect that simulavr patches would automatically pop up
here in the simulavr-devel mailing list, but obviously they don't...

So here is a pointer to the fix:

https://savannah.nongnu.org/patch/?9406

Cheers, Johann



cu, Thomas


...and excuse me for not using TOFU style.


___
Simulavr-devel mailing list
Simulavr-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/simulavr-devel


Re: [Simulavr-devel] simulavr-1.0.0 Build Fails.

2017-07-11 Thread Georg-Johann Lay

On 11.07.2017 09:16, Klaus Rudolph wrote:

I can't reproduce your problems. And what is meant by "No avail." ?

git clone ...
cd simulavr
./bootstrap
./configure
make

works fine on my box.


Doesn't help here though...



Don't clone over an existing tar or something else. Do a fresh checkout.


I did a fresh checkout to a different source path.

And as always I did completely remove $(builddir) before running
configure.

Moreover, I used --prefix as I don't want to be admin for anything
involving simulavr.



Regards
  Klaus


The problem is that in several places, implicit usage of $(builddir)
where $(srcdir) must be used.  You won't see such problems when you
are using builddir=srcdir, of course.

The patch below fixes these problems, but maybe there are more
such places that suffer from similar problems.

With that patch applied, the build passes.  However, after installing
1.2dev, -M is still nor recognized as a valid option:

$ ~/gnu/install/simulavr/bin/simulavr -d atmega8 -f a.out -M
simulavr: invalid option -- 'M'
AVR-Simulator Version 1.2dev
...
-Mdisable messages for bad I/O and memory references
...


Finally, I got bunch of build warnings that don't increase
confidence into simulavr...  Allow me to propose to use C99 types
that are also known to C++ like uint32_t and print modifiers like
PRIu32 and friends from inttypes.h.  At least for ELF this is
reasonable.  If you don't want to use these types, you'll have
configure to find out for you what sizes int, long and long long
have (for the HOST platform, not for the BUILD platform).

My current BUILD (and also HOST) is x86_64, I didn't even try to
cross-build simulavr, e.g. for mingw32 host...


In file included from ../../../source/simulavr/src/rwmem.h:34:0,
 from ../../../source/simulavr/src/decoder.h:31,
 from ../../../source/simulavr/src/flash.h:32,
 from ../../../source/simulavr/src/avrdevice_impl.h:5,
 from ../../../source/simulavr/src/avrreadelf.cpp:37:
../../../source/simulavr/src/avrreadelf.cpp: In function ‘void 
ELFLoad(const AvrDevice*)’:
../../../source/simulavr/src/avrerror.h:131:84: warning: format ‘%llx’ 
expects argument of type ‘long long unsigned int’, but argument 6 has 
type ‘ELFIO::Elf64_Addr {aka long unsigned int}’ [-Wformat=]
 #define avr_warning(...) sysConHandler.vfwarning(__FILE__, __LINE__, 
## __VA_ARGS__)


^
../../../source/simulavr/src/avrreadelf.cpp:208:21: note: in expansion 
of macro ‘avr_warning’
 avr_warning("Unknown symbol address range found! 
(symbol='%s', address=0x%llx)",

 ^
../../../source/simulavr/src/avrerror.h:133:82: warning: format ‘%llu’ 
expects argument of type ‘long long unsigned int’, but argument 5 has 
type ‘ELFIO::Elf_Xword {aka long unsigned int}’ [-Wformat=]
 #define avr_error(...)   sysConHandler.vffatal(__FILE__, __LINE__, ## 
__VA_ARGS__)


  ^
../../../source/simulavr/src/avrreadelf.cpp:251:21: note: in expansion 
of macro ‘avr_error’
 avr_error("wrong device signature size in elf 
file, expected=3, given=%llu",

 ^
../../../source/simulavr/src/avrreadelf.cpp: In function ‘unsigned int 
ELFGetSignature(const char*)’:
../../../source/simulavr/src/avrerror.h:133:82: warning: format ‘%llu’ 
expects argument of type ‘long long unsigned int’, but argument 5 has 
type ‘ELFIO::Elf_Xword {aka long unsigned int}’ [-Wformat=]
 #define avr_error(...)   sysConHandler.vffatal(__FILE__, __LINE__, ## 
__VA_ARGS__)


  ^
../../../source/simulavr/src/avrreadelf.cpp:293:21: note: in expansion 
of macro ‘avr_error’
 avr_error("wrong device signature size in elf 
file, expected=3, given=%llu",

 ^



In file included from ../../../source/simulavr/src/cmd/gdbserver.cpp:41:0:
../../../source/simulavr/src/cmd/gdbserver.cpp: In member function 
‘virtual void GdbServerSocketUnix::Write(const void*, size_t)’:
../../../source/simulavr/src/avrerror.h:133:82: warning: format ‘%d’ 
expects argument of type ‘int’, but argument 6 has type ‘size_t {aka 
long unsigned int}’ [-Wformat=]
 #define avr_error(...)   sysConHandler.vffatal(__FILE__, __LINE__, ## 
__VA_ARGS__)


  ^
../../../source/simulavr/src/cmd/gdbserver.cpp:239:9: note: in expansion 
of macro ‘avr_error’

 avr_error("write only wrote %d of %d bytes", res, count);
 ^

Johann



Gesendet: Montag, 10. Juli 2017 um 10:06 Uhr
Von: "Georg-Johann Lay" <g...@gcc.gnu.org>
An: Klaus <zf...@web.de>
Cc: simulavr-devel@nongnu.org
Betreff: Re: [Simulavr-devel] simulavr-1.0.0 Build Fails.

On 10.07.2017 10:02, Georg-Johann Lay wrote:

On 07.07.2017 22:29, Klaus wrote:

Please use git master. Version 1.0.0 is broken in so many things...

This message is posted also on the main page of the project ;)

Regards
   Klaus


No avail.

After figu

Re: [Simulavr-devel] simulavr-1.0.0 Build Fails.

2017-07-10 Thread Thomas K

Hi Johann,

as Klaus wrote, version 1.0 is just a little bit outdated :-) So, with 
the current versions of gcc you'll get errors just because of newer 
version of gcc!


But if I understand your "No avail." right, you're pinned on version 
1.0? Why, what's your scope to use simulavr? (just curious)


On the other hand, that hwtimer.h isn't found is not because of newer 
gcc version. How do you get the package? Cloned from git repo? Or dist 
package (tar.gz)? Could you check, if the file hwtimer.h is contained in 
your package and where?


cu, Thomas


Am 10.07.2017 um 10:06 schrieb Georg-Johann Lay:

On 10.07.2017 10:02, Georg-Johann Lay wrote:

On 07.07.2017 22:29, Klaus wrote:

Please use git master. Version 1.0.0 is broken in so many things...

This message is posted also on the main page of the project ;)

Regards
  Klaus



No avail.

After figuring out that I hat to run "bootstrap" in the sources...

$ ../../source/simulavr/configure --prefix /local/gnu/install/simulavr
$ make -j 8

libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
-I../../../source/simulavr/src -Ielfio -g -O2 -fPIC -Icmd -Iui 
-Ihwtimer -g -O2 -MT externalirq.lo -MD -MP -MF .deps/externalirq.Tpo 
-c ../../../source/simulavr/src/externalirq.cpp  -fPIC -DPIC -o 
.libs/externalirq.o

In file included from ../../../source/simulavr/src/attiny2313.h:38:0,
  from ../../../source/simulavr/src/attiny2313.cpp:26:
../../../source/simulavr/src/hwusi.h:36:21: fatal error: hwtimer.h: 
No such file or directory

compilation terminated.
libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
-I../../../source/simulavr/src -Ielfio -g -O2 -fPIC -Icmd -Iui 
-Ihwtimer -g -O2 -MT atmega1284abase.lo -MD -MP -MF 
.deps/atmega1284abase.Tpo -c 
../../../source/simulavr/src/atmega1284abase.cpp  -fPIC -DPIC -o 
.libs/atmega1284abase.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
-I../../../source/simulavr/src -Ielfio -g -O2 -fPIC -Icmd -Iui 
-Ihwtimer -g -O2 -MT application.lo -MD -MP -MF .deps/application.Tpo 
-c ../../../source/simulavr/src/application.cpp  -fPIC -DPIC -o 
.libs/application.o

Makefile:926: recipe for target 'attiny2313.lo' failed
make[3]: *** [attiny2313.lo] Error 1
make[3]: *** Waiting for unfinished jobs
In file included from 
../../../source/simulavr/src/attiny25_45_85.h:39:0,
  from 
../../../source/simulavr/src/attiny25_45_85.cpp:26:
../../../source/simulavr/src/hwusi.h:36:21: fatal error: hwtimer.h: 
No such file or directory

compilation terminated.


In addition, I also tried non-parallel make after clean:

$ make

Same error:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
-I../../../source/simulavr/src -Ielfio -g -O2 -fPIC -Icmd -Iui 
-Ihwtimer -g -O2 -MT attiny25_45_85.lo -MD -MP -MF 
.deps/attiny25_45_85.Tpo -c 
../../../source/simulavr/src/attiny25_45_85.cpp  -fPIC -DPIC -o 
.libs/attiny25_45_85.o

In file included from ../../../source/simulavr/src/attiny25_45_85.h:39:0,
 from ../../../source/simulavr/src/attiny25_45_85.cpp:26:
../../../source/simulavr/src/hwusi.h:36:21: fatal error: hwtimer.h: No 
such file or directory

compilation terminated.




Johann




___
Simulavr-devel mailing list
Simulavr-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/simulavr-devel




___
Simulavr-devel mailing list
Simulavr-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/simulavr-devel


Re: [Simulavr-devel] simulavr-1.0.0 Build Fails.

2017-07-10 Thread Georg-Johann Lay

On 10.07.2017 10:02, Georg-Johann Lay wrote:

On 07.07.2017 22:29, Klaus wrote:

Please use git master. Version 1.0.0 is broken in so many things...

This message is posted also on the main page of the project ;)

Regards
  Klaus



No avail.

After figuring out that I hat to run "bootstrap" in the sources...

$ ../../source/simulavr/configure --prefix /local/gnu/install/simulavr
$ make -j 8

libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
-I../../../source/simulavr/src -Ielfio -g -O2 -fPIC -Icmd -Iui -Ihwtimer 
-g -O2 -MT externalirq.lo -MD -MP -MF .deps/externalirq.Tpo -c 
../../../source/simulavr/src/externalirq.cpp  -fPIC -DPIC -o 
.libs/externalirq.o

In file included from ../../../source/simulavr/src/attiny2313.h:38:0,
  from ../../../source/simulavr/src/attiny2313.cpp:26:
../../../source/simulavr/src/hwusi.h:36:21: fatal error: hwtimer.h: No 
such file or directory

compilation terminated.
libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
-I../../../source/simulavr/src -Ielfio -g -O2 -fPIC -Icmd -Iui -Ihwtimer 
-g -O2 -MT atmega1284abase.lo -MD -MP -MF .deps/atmega1284abase.Tpo -c 
../../../source/simulavr/src/atmega1284abase.cpp  -fPIC -DPIC -o 
.libs/atmega1284abase.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
-I../../../source/simulavr/src -Ielfio -g -O2 -fPIC -Icmd -Iui -Ihwtimer 
-g -O2 -MT application.lo -MD -MP -MF .deps/application.Tpo -c 
../../../source/simulavr/src/application.cpp  -fPIC -DPIC -o 
.libs/application.o

Makefile:926: recipe for target 'attiny2313.lo' failed
make[3]: *** [attiny2313.lo] Error 1
make[3]: *** Waiting for unfinished jobs
In file included from ../../../source/simulavr/src/attiny25_45_85.h:39:0,
  from ../../../source/simulavr/src/attiny25_45_85.cpp:26:
../../../source/simulavr/src/hwusi.h:36:21: fatal error: hwtimer.h: No 
such file or directory

compilation terminated.


In addition, I also tried non-parallel make after clean:

$ make

Same error:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
-I../../../source/simulavr/src -Ielfio -g -O2 -fPIC -Icmd -Iui -Ihwtimer 
-g -O2 -MT attiny25_45_85.lo -MD -MP -MF .deps/attiny25_45_85.Tpo -c 
../../../source/simulavr/src/attiny25_45_85.cpp  -fPIC -DPIC -o 
.libs/attiny25_45_85.o

In file included from ../../../source/simulavr/src/attiny25_45_85.h:39:0,
 from ../../../source/simulavr/src/attiny25_45_85.cpp:26:
../../../source/simulavr/src/hwusi.h:36:21: fatal error: hwtimer.h: No 
such file or directory

compilation terminated.




Johann




___
Simulavr-devel mailing list
Simulavr-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/simulavr-devel


Re: [Simulavr-devel] simulavr-1.0.0 Build Fails.

2017-07-10 Thread Georg-Johann Lay

On 07.07.2017 22:29, Klaus wrote:

Please use git master. Version 1.0.0 is broken in so many things...

This message is posted also on the main page of the project ;)

Regards
  Klaus



No avail.

After figuring out that I hat to run "bootstrap" in the sources...

$ ../../source/simulavr/configure --prefix /local/gnu/install/simulavr
$ make -j 8

libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
-I../../../source/simulavr/src -Ielfio -g -O2 -fPIC -Icmd -Iui -Ihwtimer 
-g -O2 -MT externalirq.lo -MD -MP -MF .deps/externalirq.Tpo -c 
../../../source/simulavr/src/externalirq.cpp  -fPIC -DPIC -o 
.libs/externalirq.o

In file included from ../../../source/simulavr/src/attiny2313.h:38:0,
 from ../../../source/simulavr/src/attiny2313.cpp:26:
../../../source/simulavr/src/hwusi.h:36:21: fatal error: hwtimer.h: No 
such file or directory

compilation terminated.
libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
-I../../../source/simulavr/src -Ielfio -g -O2 -fPIC -Icmd -Iui -Ihwtimer 
-g -O2 -MT atmega1284abase.lo -MD -MP -MF .deps/atmega1284abase.Tpo -c 
../../../source/simulavr/src/atmega1284abase.cpp  -fPIC -DPIC -o 
.libs/atmega1284abase.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
-I../../../source/simulavr/src -Ielfio -g -O2 -fPIC -Icmd -Iui -Ihwtimer 
-g -O2 -MT application.lo -MD -MP -MF .deps/application.Tpo -c 
../../../source/simulavr/src/application.cpp  -fPIC -DPIC -o 
.libs/application.o

Makefile:926: recipe for target 'attiny2313.lo' failed
make[3]: *** [attiny2313.lo] Error 1
make[3]: *** Waiting for unfinished jobs
In file included from ../../../source/simulavr/src/attiny25_45_85.h:39:0,
 from ../../../source/simulavr/src/attiny25_45_85.cpp:26:
../../../source/simulavr/src/hwusi.h:36:21: fatal error: hwtimer.h: No 
such file or directory

compilation terminated.


Johann




Am 07.07.2017 um 15:00 schrieb Georg-Johann Lay:

Running make aborts with:


/bin/bash ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H 
-I. -I../../../source/simulavr-1.0.0/src 
-I/local/gnu/build/binutils-master-avr/bfd// -g -O2 -Icmd -Iui 
-Ihwtimer -MT systemclock.lo -MD -MP -MF .deps/systemclock.Tpo -c -o 
systemclock.lo ../../../source/simulavr-1.0.0/src/systemclock.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. 
-I../../../source/simulavr-1.0.0/src 
-I/local/gnu/build/binutils-master-avr/bfd// -g -O2 -Icmd -Iui 
-Ihwtimer -MT systemclock.lo -MD -MP -MF .deps/systemclock.Tpo -c 
../../../source/simulavr-1.0.0/src/systemclock.cpp  -fPIC -DPIC -o 
.libs/systemclock.o
../../../source/simulavr-1.0.0/src/systemclock.cpp: In instantiation 
of ‘void MinHeap::Insert(Key, Value) [with Key = long long 
int; Value = SimulationMember*]’:
../../../source/simulavr-1.0.0/src/systemclock.cpp:135:40:   required 
from here
../../../source/simulavr-1.0.0/src/systemclock.cpp:70:8: error: 
‘resize’ was not declared in this scope, and no declarations were 
found by argument-dependent lookup at the point of instantiation 
[-fpermissive]

   resize(this->size()+1);
 ^
../../../source/simulavr-1.0.0/src/systemclock.cpp:70:8: note: 
declarations in dependent base ‘std::vector, std::allocator > >’ are not found by unqualified lookup
../../../source/simulavr-1.0.0/src/systemclock.cpp:70:8: note: use 
‘this->resize’ instead

Makefile:706: recipe for target 'systemclock.lo' failed
make[3]: *** [systemclock.lo] Error 1
make[3]: Leaving directory '/srv/local/gnu/build/simulavr/src'
Makefile:933: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/srv/local/gnu/build/simulavr/src'
Makefile:467: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/srv/local/gnu/build/simulavr/src'
Makefile:409: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1


System information:

$ ../../source/simulavr-1.0.0/configure --prefix 
/local/gnu/install/simulavr 
--with-bfd=/local/gnu/build/binutils-master-avr/bfd/ 
-with-libiberty=/local/gnu/build/binutils-master-avr/libiberty/


$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

Moreover, it took me a while to work out how to twiddle with bfd
and libiberty.  What did not work:

* install binutils-dev
* configure / build simularv from within binutils source tree so
   that it has the complete SRCROOT stuff available.

Would be nice if your "Prerequisites"
http://www.nongnu.org/simulavr/build_simple.html#prerequisites
would shed some light on this and how to get across according
configure hick-ups.

Johann





___
Simulavr-devel mailing list
Simulavr-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/simulavr-devel





___
Simulavr-devel mailing list
Simulavr-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/simulavr-devel