hi, I got the same issues with mig creating a broken serialpacket.h on Debian with the Stanford repo packages and recent gcc's.
cd $TOSROOT/support/sdk/c/sf make distclean Note that make clean and make distclean do not remove serialpacket.h, thus it will not be recreated by make. Has this gone unnoticed for such a long time, because all the people had a working serialpacket.h? My default gcc is 4.5.3. Changing migdecode.pm according to http://nescc.cvs.sourceforge.net/viewvc/nescc/nesc/tools/migdecode.pm?r1=1.8&r2=1.9 solved the issue for me. The recent changes in nescc possibly should be packaged. A colleague with gcc 4.6 default was already hit by Possibly this is related to http://sourceforge.net/tracker/?func=detail&aid=3153727&group_id=56288&atid=480036 BR, Markus P.S.: For completeness, the problems and version strings: rm serialpacket.h ./bootstrap ./configure make mig -o serialpacket.h -c-prefix=spacket c /home/mab/src/external/git/tinyos-main-blip-rpl-devel/tos/lib/serial/Serial.h serial_packet -D_POSIX_C_SOURCE warning: Cannot determine AM type for serial_packet (Looking for definition of AM_SERIAL_PACKET) make all-am make[1]: Entering directory `/home/mab/src/external/git/tinyos-main-blip-rpl-devel/support/sdk/c/sf' gcc -DHAVE_CONFIG_H -I. -g -O2 -MT message.o -MD -MP -MF .deps/message.Tpo -c -o message.o message.c mv -f .deps/message.Tpo .deps/message.Po gcc -DHAVE_CONFIG_H -I. -g -O2 -MT serialpacket.o -MD -MP -MF .deps/serialpacket.Tpo -c -o serialpacket.o serialpacket.c In file included from serialpacket.c:8:0: serialpacket.h:22:21: error: expected ',' or '}' before 'SERIAL_PACKET' serialpacket.h:190:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'serial_packet' [repeated several times] Created serialpacket.h: /** * Return the value of the field 'nx_struct serial_packet 7 -1 ' */ int8_t spacket_nx_struct serial_packet 7 -1 _get(tmsg_t *msg); While I had this earlier: /** * Return the value of the field 'header.dest' */ uint16_t spacket_header_dest_get(tmsg_t *msg); Version infos: dpkg -l | grep tinyos ii avr-binutils-tinyos 2.17-20080806 GNU binutils for the avr platform ii avr-gcc-tinyos 4.1.2-20080806 gcc compiled for the AVR platform with TinyOS patches ii avr-libc-tinyos 1.4.7-20080806 C library for the AVR platform. ii avr-tinyos 2.1-20080806 Dummy package to pull in all avr-related packages for tinyos ii avr-tinyos-base 2.1-20080806 Dummy package required by all avr-tinyos tools. Removing this package will remove all avr-tinyos related packages. ii avrdude-tinyos 5.4-20080806 AVRDUDE is an open source utility to download/upload/manipulate the ROM and EEPROM contents of AVR microcontrollers using the in-system programming technique (ISP) ii deputy-tinyos 1.1-20080807 This is the Deputy compiler used for Safe TinyOS applications. ii msp430-binutils-tinyos 2.17-20080806 MSP430TOOLS -- Binutils ii msp430-gcc-tinyos 3.2.3-20080806 MSP430TOOLS -- GNU CC ii msp430-libc-tinyos 20060801cvs-20080806 MSP430TOOLS -- Libc ii msp430-tinyos 2.1-20080806 Dummy package to pull in all msp430-related packages for tinyos ii msp430-tinyos-base 2.1-20080806 Dummy package required by all msp430-tinyos tools. Removing this package will remove all msp430-tinyos related packages. ii tinyos 2.0.2-20080704 The TinyOS operating system. ii tinyos-base 2.1-20080806 Dummy package required by all tinyos realated packages. Removing this package will uninstall the entire set of packages installed for use with tinyos. ii tinyos-required 2.1-20080806 Dummy package to pull in all optional packages for tinyos ii tinyos-tools 1.4.0-20100323 Tools for use with tinyos. Includes, for example: uisp, motelist, pybsl, mig, ncc and nesdoc. The source for these tools is found in the TinyOS CVS repository under tinyos-2.x/tools. dpkg -l | grep nesc ii nesc 1.3.1-20091005 This is the nesC compiler used to compile TinyOS applications nescc -v nescc: 1.3.1 gcc -_fnesc-gcc=gcc -specs=/usr/lib/ncc/tdspecs -_fnesc-include=nesc_nx -I/usr/lib/ncc -v -DNESC=131 Using built-in specs. Reading specs from /usr/lib/ncc/tdspecs COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.5.3/lto-wrapper Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.5.3-1' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr -- program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable- threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold -- enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.5.3 (Debian 4.5.3-1) ncc -v /usr/bin/nescc -fnesc-include=tos -topdir=/home/mab/src/external/git/tinyos-main-blip-rpl-devel -fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask -DPLATFORM_NULL -v -fnesc-target=pc -fnesc-no-debug -gcc=gcc -I/home/mab/src/external/git/tinyos-main-blip-rpl-devel/tos/platforms/null -I/home/mab/src/external/git/tinyos-main-blip-rpl- devel/tos/lib/timer -I/home/mab/src/external/git/tinyos-main-blip-rpl-devel/tos/lib/serial -I/home/mab/src/external/git/tinyos-main-blip-rpl-devel/tos/interfaces -I/home/mab/src/external/git/tinyos- main-blip-rpl-devel/tos/types -I/home/mab/src/external/git/tinyos-main-blip-rpl-devel/tos/system nescc: 1.3.1 gcc -_fnesc-gcc=gcc -specs=/usr/lib/ncc/tdspecs -_fnesc-include=nesc_nx -I/usr/lib/ncc -_fnesc-include=tos -_fnesc- scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask -DPLATFORM_NULL -v -_fnesc-target=pc -_fnesc-no-debug -I/home/mab/src/external/git/tinyos-main- blip-rpl-devel/tos/platforms/null -I/home/mab/src/external/git/tinyos-main-blip-rpl-devel/tos/lib/timer -I/home/mab/src/external/git/tinyos-main-blip-rpl-devel/tos/lib/serial - I/home/mab/src/external/git/tinyos-main-blip-rpl-devel/tos/interfaces -I/home/mab/src/external/git/tinyos-main-blip-rpl-devel/tos/types -I/home/mab/src/external/git/tinyos-main-blip-rpl- devel/tos/system -DNESC=131 Using built-in specs. Reading specs from /usr/lib/ncc/tdspecs COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.5.3/lto-wrapper Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.5.3-1' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr -- program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable- threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold -- enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.5.3 (Debian 4.5.3-1) > yep. your mig is doing very strange things. > > What system are you running on? Perhaps windows? > > So I looked into what mig I've got and here is what I see... (my mig > works fine, same output as your friend) > > zot (159): which mig > /usr/bin/mig > zot (160): dpkg -S /usr/bin/mig > tinyos-tools: /usr/bin/mig > zot (161): dpkg -l tinyos-tools > ii tinyos-tools 1.4.0-20100323 Tools for use > with tinyos. Includes, for example: uisp, motelist, pybs > zot (162): > > I'm running Ubuntu 10.04 with the Stanford tinyos tools installed. > > Here is the list of all the tinyos tools I've got installed. > > ii avr-binutils-tinyos 2.17-20080806 GNU binutils > for the avr platform > ii avr-gcc-tinyos 4.1.2-20080806 gcc compiled > for the AVR platform with TinyOS patches > ii avr-libc-tinyos 1.4.7-20080806 C library for > the AVR platform. > ii avr-optional-tinyos 2.1-20090326 Dummy package > to pull in all optional avr-related packages for tinyos > ii avr-tinyos 2.1-20080806 Dummy package > to pull in all avr-related packages for tinyos > ii avr-tinyos-base 2.1-20080806 Dummy package > required by all avr-tinyos tools. Removing this package > ii avrdude-tinyos 5.4-20080806 AVRDUDE is an > open source utility to download/upload/manipulate the RO > ii deputy-tinyos 1.1-20080807 This is the > Deputy compiler used for Safe TinyOS applications. > ii msp430-binutils-tinyos 2.17-20080806 MSP430TOOLS -- > Binutils > ii msp430-gcc-tinyos 3.2.3-20080806 MSP430TOOLS -- > GNU CC > ii msp430-libc-tinyos 20060801cvs-20080806 MSP430TOOLS -- > Libc > ii msp430-optional-tinyos 2.1-20090326 Dummy package > to pull in all optional msp430-related packages for tiny > ii msp430-tinyos 2.1-20080806 Dummy package > to pull in all msp430-related packages for tinyos > ii msp430-tinyos-base 2.1-20080806 Dummy package > required by all msp430-tinyos tools. Removing this pack > ii tinyos-2.1.1 2.1.1-20100401 An event-based > operating environment designed for use with > ii tinyos-base 2.1-20080806 Dummy package > required by all tinyos realated packages. Removing this > ii tinyos-required-avr 2.1-20090326 Dummy package > to pull in all required packages for tinyos > ii tinyos-tools 1.4.0-20100323 Tools for use > with tinyos. Includes, for example: uisp, motelist, pybs > ii tinyos-z1 2.1.1-16 This package > adds suport to the z1 plattform into an existing tinyos-2 > zot (163): > > > On Fri, Mar 25, 2011 at 2:40 AM, Denilson Figueiredo de Sá < > > [email protected]> wrote: > > Okay, sorry, I guess I didn't paste the complete output here. I did > > exactly the same commands as you described, but when pasting the output, > > I left off a few important lines. > > > > I'm attaching the complete output of "./bootstrap", "./configure" and > > "make". > > > > What I've discovered so far is that the generation of serialpacket.h > > (using mig) is broken. See the attached "serialpacket.h" to understand. > > (just for comparison, I've also attached that file generated at a > > friend's computer) > > > > So, somehow, the "mig" command seems broken for some reason. I just need > > help to understand and fix it! > > > > On Thu, 24 Mar 2011 23:08:56 -0300, Eric Decker <[email protected]> wrote: > > I helps if you read the instructions.... ie. Look at the README > > file > > > >> and follow the > >> instructions. It says. > >> > >> ./bootstrap > >> ./configure --prefix=<somewhere> > >> make > >> > >> But if you look carefully at what you typed below, you typed "make > >> all-am". > >> > >> Not sure > >> > >> why you did that. This short circuits building constructed sources one > >> of > >> which is > >> serialpacket.c > >> > >> I don't understand from your output where your serialpacket.c is coming > >> from. When I > >> try to duplicate what you are doing, I do see a mig run. > >> > >> So, please go read the README. And try again. > >> > >> > >> > >> On Thu, Mar 24, 2011 at 1:15 PM, Denilson Figueiredo de Sá < > >> > >> [email protected]> wrote: > >> Hello! > >> > >>> I got TinyOS 2.1.0 tarball, but the same issue also happens when I try > >>> a checkout from tinyos-main SVN at Google Code. > >>> > >>> > >>> I go to "support/sdk/c/sf" directory, and then type "./bootstrap", > >>> followed by "./configure". It all goes fine. However, the following > >>> error shows up when I type "make": > >>> > >>> make all-am > >>> make[1]: Entering directory > >>> `/tmp/software/tinyos/tinyos-main-svn/support/sdk/c/sf' > >>> gcc -DHAVE_CONFIG_H -I. -g -O2 -MT message.o -MD -MP -MF > >>> .deps/message.Tpo -c -o message.o message.c > >>> mv -f .deps/message.Tpo .deps/message.Po > >>> gcc -DHAVE_CONFIG_H -I. -g -O2 -MT serialpacket.o -MD -MP -MF > >>> .deps/serialpacket.Tpo -c -o serialpacket.o serialpacket.c > >>> In file included from serialpacket.c:8: > >>> serialpacket.h:22: error: expected ‘,’ or ‘}’ before ‘SERIAL_PACKET’ > >>> serialpacket.h:190: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:197: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:204: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:211: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:218: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:225: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:232: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:239: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:246: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:253: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:260: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:267: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:274: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:281: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:288: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.h:295: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.c:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:52: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:59: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:66: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:73: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:80: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:87: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:94: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ > >>> before ‘serial_packet’ > >>> serialpacket.c:101: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.c:108: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> serialpacket.c:115: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > >>> ‘__attribute__’ before ‘serial_packet’ > >>> make[1]: *** [serialpacket.o] Error 1 > >>> make[1]: Leaving directory > >>> `/tmp/software/tinyos/tinyos-main-svn/support/sdk/c/sf' > >>> make: *** [all] Error 2 > >>> > >>> > >>> > >>> I have nescc version 1.3.2, tinyos-tools 1.3.0 and gcc version 4.4.5. > >>> Running on Gentoo Linux 64-bit. > >>> > >>> I already have the following environment variables: > >>> TOSROOT=/usr/src/tinyos-2.x > >>> TOSDIR=/usr/src/tinyos-2.x/tos > >>> > >>> > >>> > >>> Any suggestions? > >>> > >>> > >>> -- > >>> Denilson Figueiredo de Sá > >>> Vialink > >>> Rio de Janeiro - Brasil > >>> > >>> /"\ > >>> \ / ASCII Ribbon Campaign > >>> > >>> X against HTML e-mail > >>> > >>> / \ > >>> _______________________________________________ > >>> Tinyos-help mailing list > >>> [email protected] > >>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-hel > >>> p > > > > -- > > Denilson Figueiredo de Sá > > Vialink > > Rio de Janeiro - Brasil > > > > /"\ > > \ / ASCII Ribbon Campaign > > > > X against HTML e-mail > > > > / \ ------------------------------------------------ | Dipl.-Ing. Markus Becker | Communication Networks | TZI - Center for Computing Technologies | University Bremen | Germany ------------------------------------------------ | web: http://www.comnets.uni-bremen.de/~mab/ | mailto: [email protected] | telephone: +49 421 218 62379 | building: NW1 room: N2260 ------------------------------------------------ _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
