DimonSE / open9x

Automatically exported from code.google.com/p/open9x
0 stars 0 forks source link

open9x won't compile under same environment as gruvin9x (CrossPack, on a Mac) #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. svn checkout (r621)
2. src/Makefile: AUDIO=YES, HAPTIC=YES
2. make clean
3. make

Many compiler errors under the CrossPack build environment on the Mac -- IE. 
the exact same one used for Gruvin9X without errors.

...

$ make

-------- begin --------
avr-gcc (GCC) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Generate Version-stamp:
//Automatically generated file (Makefile) - do not edit
#define DATE_STR "2012-04-23"
#define TIME_STR "17:49:33"
#define VERS_STR "2.00-"
#define SVN_STR  "open9x-r621M"
for f in board_gruvin9x.cpp open9x.cpp pulses_avr.cpp   stamp.cpp menus.cpp 
model_menus.cpp general_menus.cpp main_views.cpp statistics_views.cpp 
eeprom_avr.cpp lcd.cpp drivers.cpp o9xstrings.cpp audio.cpp gruvin9x/gtime.cpp 
gruvin9x/rtc.cpp gruvin9x/ff.cpp gruvin9x/diskio.cpp templates.cpp  ; do echo 
"# 1 \"$f\"" >> allsrc.cpp; cat "$f" >> allsrc.cpp; done

Compiling C++: open9x.elf
avr-gcc -mmcu=atmega2560 -I. -x c++ -gdwarf-2  -DREV1 -DF_CPU=16000000UL 
-DTRANSLATIONS_EN -DSPLASH -DFLIGHT_PHASES -DPCBV4 -DAUDIO -DHAPTIC 
-DROTARY_ENCODERS -DDECIMALS_DISPLAYED -DTEMPLATES -O2 -Wall -fno-exceptions 
-Wno-strict-aliasing -I. -Itranslations -Igruvin9x -fno-inline-small-functions 
-I../gtest-1.6.0/include  -fwhole-program allsrc.cpp --output open9x.elf 
-Wl,-Map=open9x.map,--cref  -lm
allsrc.cpp:1: error: expected unqualified-id before '-' token
In file included from 
/usr/local/CrossPack-AVR-20100115/lib/gcc/avr/4.3.3/../../../../avr/include/intt
ypes.h:37,
                 from open9x.h:40,
                 from board_gruvin9x.cpp:34:
/usr/local/CrossPack-AVR-20100115/lib/gcc/avr/4.3.3/../../../../avr/include/stdi
nt.h:159: error: 'int8_t' does not name a type
/usr/local/CrossPack-AVR-20100115/lib/gcc/avr/4.3.3/../../../../avr/include/stdi
nt.h:213: error: 'int8_t' does not name a type
In file included from open9x.h:46,
                 from board_gruvin9x.cpp:34:
gruvin9x/gtime.h:47: error: 'int8_t' does not name a type
gruvin9x/gtime.h:48: error: 'int8_t' does not name a type
gruvin9x/gtime.h:49: error: 'int8_t' does not name a type
gruvin9x/gtime.h:50: error: 'int8_t' does not name a type
gruvin9x/gtime.h:51: error: 'int8_t' does not name a type
gruvin9x/gtime.h:52: error: 'int8_t' does not name a type
gruvin9x/gtime.h:53: error: 'int8_t' does not name a type
In file included from open9x.h:74,
                 from board_gruvin9x.cpp:34:
/usr/local/CrossPack-AVR-20100115/lib/gcc/avr/4.3.3/../../../../avr/include/avr/
pgmspace.h:215: error: 'int8_t' does not name a type
In file included from open9x.h:75,
                 from board_gruvin9x.cpp:34:
pgmtypes.h:66: error: 'int8_t' does not name a type
In file included from open9x.h:86,
                 from board_gruvin9x.cpp:34:
myeeprom.h:61: error: 'int8_t' does not name a type
myeeprom.h:72: error: 'int8_t' does not name a type
myeeprom.h:72: error: 'int8_t' does not name a type
myeeprom.h:102: error: 'int8_t' does not name a type
myeeprom.h:102: error: 'int8_t' does not name a type
myeeprom.h:102: error: 'int8_t' does not name a type
myeeprom.h:102: error: 'int8_t' does not name a type
myeeprom.h:102: error: 'int8_t' does not name a type
myeeprom.h:102: error: 'int8_t' does not name a type
myeeprom.h:102: error: 'int8_t' does not name a type
myeeprom.h:102: error: 'int8_t' does not name a type
myeeprom.h:102: error: 'int8_t' does not name a type
myeeprom.h:150: error: 'int8_t' does not name a type
myeeprom.h:150: error: 'int8_t' does not name a type
myeeprom.h:161: error: 'int8_t' does not name a type
myeeprom.h:161: error: 'int8_t' does not name a type
myeeprom.h:221: error: 'int8_t' does not name a type
myeeprom.h:221: error: 'int8_t' does not name a type
myeeprom.h:221: error: 'int8_t' does not name a type
myeeprom.h:221: error: 'int8_t' does not name a type
myeeprom.h:221: error: 'int8_t' does not name a type
myeeprom.h:239: error: 'int8_t' does not name a type
myeeprom.h:239: error: 'int8_t' does not name a type
myeeprom.h:271: error: 'int8_t' does not name a type
myeeprom.h:292: error: 'int8_t' does not name a type
myeeprom.h:411: error: 'int8_t' does not name a type
myeeprom.h:411: error: 'int8_t' does not name a type
myeeprom.h:411: error: 'int8_t' does not name a type
myeeprom.h:446: error: 'int8_t' does not name a type
myeeprom.h:478: error: 'int8_t' does not name a type
myeeprom.h:478: error: 'int8_t' does not name a type
myeeprom.h:478: error: 'int8_t' does not name a type
myeeprom.h:478: error: 'int8_t' does not name a type
myeeprom.h:478: error: 'int8_t' does not name a type
myeeprom.h:478: error: 'int8_t' does not name a type
In file included from open9x.h:94,
                 from board_gruvin9x.cpp:34:
eeprom_avr.h:96: error: 'int8_t' does not name a type
eeprom_avr.h:100: error: 'int8_t' does not name a type
In file included from open9x.h:98,
                 from board_gruvin9x.cpp:34:
lcd.h:98: error: 'int8_t' has not been declared
lcd.h:103: error: 'int8_t' has not been declared
lcd.h:105: error: 'int8_t' has not been declared
lcd.h:106: error: 'int8_t' has not been declared
lcd.h:107: error: 'int8_t' has not been declared
lcd.h:126: warning: 'lcd_hlineStip' initialized and declared 'extern'
lcd.h:126: error: variable or field 'lcd_hlineStip' declared void
lcd.h:126: error: 'int8_t' was not declared in this scope
lcd.h:126: error: expected primary-expression before 'y'
lcd.h:126: error: expected primary-expression before 'w'
lcd.h:126: error: expected primary-expression before 'pat'
lcd.h:126: error: expected primary-expression before 'att'
lcd.h:127: error: 'int8_t' has not been declared
lcd.h:127: error: 'int8_t' has not been declared
lcd.h:128: error: 'int8_t' has not been declared
lcd.h:128: error: 'int8_t' has not been declared
lcd.h:131: error: 'int8_t' has not been declared
In file included from open9x.h:99,
                 from board_gruvin9x.cpp:34:
menus.h:83: error: 'int8_t' does not name a type
menus.h:97: error: 'int8_t' does not name a type
menus.h:98: error: 'int8_t' does not name a type
menus.h:105: error: 'int8_t' does not name a type
menus.h:106: error: 'int8_t' does not name a type
menus.h:115: error: expected initializer before '*' token
menus.h:117: error: 'int8_t' does not name a type
menus.h:118: error: 'int8_t' does not name a type
menus.h:119: error: 'int8_t' does not name a type
menus.h:123: error: 'int8_t' has not been declared
menus.h:123: error: 'int8_t' has not been declared
menus.h:123: error: 'int8_t' has not been declared
menus.h:123: error: 'int8_t' has not been declared
menus.h:140: error: 'int8_t' does not name a type
menus.h: In function 'void minit()':
menus.h:145: error: 'm_posVert' was not declared in this scope
In file included from board_gruvin9x.cpp:34:
open9x.h: At global scope:
open9x.h:463: warning: 'idx2char' initialized and declared 'extern'
open9x.h:463: error: 'int8_t' was not declared in this scope
open9x.h:502: error: 'int8_t' was not declared in this scope
open9x.h:502: error: expected primary-expression before 'bool'
open9x.h:502: error: initializer expression list treated as compound expression
open9x.h:521: error: 'int8_t' has not been declared
open9x.h:534: error: 'int8_t' does not name a type
open9x.h:555: error: 'int8_t' does not name a type
open9x.h:557: error: expected initializer before '*' token
open9x.h:667: error: 'int8_t' does not name a type
open9x.h:688: warning: 'calc100toRESX' initialized and declared 'extern'
open9x.h:688: error: 'calc100toRESX' declared as an 'inline' variable
open9x.h:688: error: 'int8_t' was not declared in this scope
open9x.h:689: error: expected ',' or ';' before '{' token
In file included from board_gruvin9x.cpp:34:
open9x.h:746: error: 'int8_t' has not been declared
In file included from open9x.h:823,
                 from board_gruvin9x.cpp:34:
audio.h:105: error: 'int8_t' has not been declared
audio.h:107: error: 'int8_t' has not been declared
audio.h:169: error: 'int8_t' does not name a type
audio.h:175: error: 'int8_t' does not name a type
board_gruvin9x.cpp: In function 'void board_init()':
board_gruvin9x.cpp:78: error: 'struct gtm' has no member named 'tm_year'
board_gruvin9x.cpp:79: error: 'struct gtm' has no member named 'tm_mon'
board_gruvin9x.cpp:80: error: 'struct gtm' has no member named 'tm_mday'
board_gruvin9x.cpp:81: error: 'struct gtm' has no member named 'tm_hour'
board_gruvin9x.cpp:82: error: 'struct gtm' has no member named 'tm_min'
board_gruvin9x.cpp:83: error: 'struct gtm' has no member named 'tm_sec'
board_gruvin9x.cpp:84: error: 'struct gtm' has no member named 'tm_wday'
open9x.cpp: At global scope:
open9x.cpp:70: error: 'int8_t' does not name a type
open9x.cpp:99: error: redefinition of 'char idx2char'
open9x.h:463: error: 'char idx2char' previously defined here
open9x.cpp:99: error: 'int8_t' was not declared in this scope
make: *** [open9x.elf] Error 1

Original issue reported on code.google.com by gru...@gmail.com on 23 Apr 2012 at 5:53

GoogleCodeExporter commented 9 years ago
gcc 4.7.0 is needed!
Here: avr-gcc (Fedora 4.7.0-0.fc16.1.20120302) 4.7.0 20120302 (prerelease)

Original comment by bson...@gmail.com on 23 Apr 2012 at 7:35

GoogleCodeExporter commented 9 years ago
Damn. Oh well, that's me out for the count then, probably. It isn't available 
(or considered stable) for the Mac, far as I know. (Wasn't last I looked, about 
two months back.) I'll have another look tomorrow. I might be able to manually 
compile it. Not holding out much hope though.

Original comment by gru...@gmail.com on 23 Apr 2012 at 9:12

GoogleCodeExporter commented 9 years ago
Latest version of AVR-GCC I can find for the Mac just now is gcc: 4.5.1. (I'm 
currently using v4.3.3.)

It's not good to rely on bleeding edge compilers that have not been ported to 
all systems yet.

Original comment by gru...@gmail.com on 23 Apr 2012 at 9:15

GoogleCodeExporter commented 9 years ago
We simply can't support all compilers. We have worked hard to test and solve 
the bugs that gcc 4.7.0 brought (i.e. the memcpy one on non aligned structs). 

Original comment by bson...@gmail.com on 23 Apr 2012 at 9:21

GoogleCodeExporter commented 9 years ago
Having looked some more, I don't believe this is in fact  a compiler
problem.

There's something funny going on with the (apparently auto-created) file
allsrc.cpp. The first two lines end up as ...

-n
# 1 "board_gruvin9x.cpp"

... which is obviously not going to be accepted by any compiler.

If I delete those errant lines, then open9x compiles perfectly clean -- not
a single warning.

The next time I run make (even without a make clean, it seems) then those
lines get put back into allsrc.cpp again and of course, it breaks the
compile, again.

So I guess there's just some script somewhere that isn't doing quite the
right thing -- perhaps only on my system.

Where should I start looking?

Bryan.

Original comment by gru...@gmail.com on 24 Apr 2012 at 12:20

GoogleCodeExporter commented 9 years ago
FOund it. Makefile line 632.

"echo -n" is not a Unix command, so we literally get a -n stuck in the new
allsrc.cpp file, from the command @echo -N > allsrc.cpp.

'touch' is a Unix command and should also have been supplied with the
compiler, as part of the standard set of utilities most Windows avr-gcc
installations come with. (Is is definitely there in my Windows installation
of WinAVR.) If this is true for you r version as well. then you could fix
this problem by changing the @echo -n allsec.cpp line to ...

touch allsrc.cpp

... which creates an empty file, named allsrc.cpp -- or sets the date/time
of an existing file to "now".

- - -

I was also really surprised to see cortex-m3 as a valid CPU target. This
suggests that the one, single installation of (is it WinAVR?) can compile
for both AVR and ARM. Is that true? If so. Wow -- I can see why you wanted
this version!

How far along is the ARM board? I haven't heard anything at all about it
since it was first announced and some mock drawings were posted.

Bryan.

Original comment by gru...@gmail.com on 24 Apr 2012 at 2:23

GoogleCodeExporter commented 9 years ago
No the ARM board came after open9x!!! And yes, I took a different approach than 
ersky9x: the same firmware with the same Makefile for the 3 boards. 
arm-none-eabi-gcc used. Of course not all functions available everywhere. It 
works. Features list a little bit behind v4.1 though, but far faster and a lot 
of limits removed ...
http://9xforums.com/forum/viewforum.php?f=7

I will fix the problem you found, you are right.

Bertrand.

Original comment by bson...@gmail.com on 24 Apr 2012 at 5:44

GoogleCodeExporter commented 9 years ago
But ... have a look:
http://unixhelp.ed.ac.uk/CGI/man-cgi?echo

Original comment by bson...@gmail.com on 24 Apr 2012 at 6:56

GoogleCodeExporter commented 9 years ago
Cool stuff re the ARM compiler etc.

Yes -- you are right about -n being acceptable in Unix for echo (BASH shell, at 
least.)

But the Makefile echo -n for some reason puts the -n into allsrc.cpp. I guess 
that echo is gmake internal command. So I suppose we need something like ...

@shell 'echo -n > allsrc.cpp'

???

Original comment by gru...@gmail.com on 25 Apr 2012 at 10:02

GoogleCodeExporter commented 9 years ago
I tried $(shell sh -c 'echo -n > allsrc.cpp'). That command also puts the -n in 
allsrc.cpp!!! I Don't understand. WTF? :/ And if that is not confusing enough, 
see what I just tested on my Windows 7 machine...

C:\Users\Bryan>echo -n >> t

C:\Users\Bryan>cat t
-n

!!!!! Am I going mad? :/ No ... the -n option is not available for Windows. It 
is not available internally for my version of gmake on the Mac either. Yet it 
works for your gmake, under Windows. CRAZY.

In then end though, simply replacing the echo line with ...

@rm -f allsrc.cpp

... is a working solution for 'all'(?) systems, since >> (append) will create 
the file if it does not already exist.  (This is not even strictly needed, if 
the last make was successful, because allsrc.cpp is then deleted.)

Original comment by gru...@gmail.com on 25 Apr 2012 at 10:18

GoogleCodeExporter commented 9 years ago
Yes I do like the rm solution.
Commited in the arm branch.
Will port it to the trunk today or tomorrow

Original comment by bson...@gmail.com on 26 Apr 2012 at 5:42