The nesC compiler that is built under Mac OS X Lion wouldn't run by "Internal error".
The C compiler of the platform is gcc 4.2.1/LLVM.
What steps will reproduce the problem?
1. Under $TOSROOT/apps/Null
$ make null
What is the expected output? What do you see instead?
Null app should be successfully built.
Observed:
$ make null
mkdir -p build/null
compiling NullAppC to a null binary
ncc -o build/null/main.exe -Os -finline-limit=100000 -Wall -Wshadow -fnesc-gcc=gcc -Wnesc-all -target=null -fnesc-cfile=build/null/app.c -DDEFINED_TOS_AM_GROUP=0x22 -DIDENT_APPNAME=\"NullAppC\" -DIDENT_USERNAME=\"t2\" -DIDENT_HOSTNAME=\"tiny.local\" -DIDENT_USERHASH=0xc7656c1fL -DIDENT_TIMESTAMP=0x4f27eed4L -DIDENT_UIDHASH=0x93c40697L -D_FORTIFY_SOURCE=0 NullAppC.nc -lm
nesC: Internal error. Please send a bug report to the nesC bug mailing list
at nescc-bugs@lists.sourceforge.net
make: *** [exe0] Error 1
Please use labels and text to provide additional information.
Further investigation revealed that ** the aggregated struct assignment fails ** in SIGSEGV.
$ ncc -v
/opt/tinyos/bin/nescc -fnesc-include=tos -topdir=/opt/tinyos/root -fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask -DPLATFORM_NULL -v -fnesc-target=pc -fnesc-no-debug -gcc=gcc -I/opt/tinyos/root/tos/platforms/null -I/opt/tinyos/root/tos/lib/timer -I/opt/tinyos/root/tos/lib/serial -I/opt/tinyos/root/tos/interfaces -I/opt/tinyos/root/tos/types -I/opt/tinyos/root/tos/system
nescc: 1.3.3
gcc -_fnesc-gcc=gcc -specs=/opt/tinyos/lib/ncc/tdspecs -_fnesc-include=nesc_nx -I/opt/tinyos/lib/ncc -_fnesc-include=tos -_fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask -DPLATFORM_NULL -v -_fnesc-target=pc -_fnesc-no-debug -I/opt/tinyos/root/tos/platforms/null -I/opt/tinyos/root/tos/lib/timer -I/opt/tinyos/root/tos/lib/serial -I/opt/tinyos/root/tos/interfaces -I/opt/tinyos/root/tos/types -I/opt/tinyos/root/tos/system -DNESC=133
Using built-in specs.
Reading specs from /opt/tinyos/lib/ncc/tdspecs
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Can you elaborate on "Further investigation revealed that ** the aggregated struct assignment fails ** in SIGSEGV." / provide some kind of stack trace ?
(I have no access to a Mac OS X Lion machine)
I cannot get core file from the crash.
Inserting 'printf' to trace the program reveals that the execution stopped at line 217 of types.c
nt->size = nt->alignment = cval_top;
Using preliminary nesc-1.3.4.tar.gz, compiled on Mac OS X Lion.
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.7.4
BuildVersion: 11E53
$ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)