Oleg,

I had wondered about that too but it does not help...

#include <msp430x16x.h>

volatile static int x = 10;

int main() {
        int c = 99;
        x *= c;
        return x;
}


msp430-gcc -mmcu=msp430x167   main.c
/usr/local/msp430/lib/gcc-lib/msp430/3.2.3/msp2/ libgcc.a(_copy_data.o): In function `__do_copy_data':
(.init4+0x2): undefined reference to `__data_size'
/usr/local/msp430/lib/gcc-lib/msp430/3.2.3/msp2/ libgcc.a(_copy_data.o): In function `__do_copy_data':
(.init4+0xc): undefined reference to `__data_load_start'
/usr/local/msp430/lib/gcc-lib/msp430/3.2.3/msp2/ libgcc.a(_clear_bss.o): In function `__do_clear_bss':
(.init4+0x2): undefined reference to `__bss_size'

I believe the problem is related to the linker scripts. I guess the recent changes in CVS have assumed a patch to the linker scripts to include setting of these symbols. Their very names imply symbols that needs setting by the linker and I've seen similar things in other linker scripts. If I'm right this would be a problem on other platforms too, not just mac OS X.

The suggestion by Chris was to roll back a month. I've perused the CVS on line and it looks like just over a week is probably enough (and I don't mind living a little dangerously), so I rolled back just gcc to 2008-05-25 and recompiled...

$ cd gcc
$ cvs update -D 2008-05-25
$ cd ..
$ cp -r gcc/gcc-3.3/* gcc-3.2.3
$ cd gcc-3.2.3/
$ make clean
$ make
$ sudo make install

After that I can compile the above test code without error.

Regards,
Steven



On 3 Jun 2008, at 08:36, Oleg V. Kobrin wrote:

define some variables, it should help.

2008/6/3 Jens Rabe <[email protected]>:
Hello again,

I finally managed to get mspgcc to compile in OSX. I had to specify
--enable-languages=c,c++ in the configure.

Now I have the next problem:

When I try to compile a simple program which looks this way:

#include <msp430x16x.h>

int main() {
 return 0;
}

compiling gets me:

/usr/msp430/lib/gcc-lib/msp430/3.2.3/msp2/libgcc.a(_copy_data.o): In
function `__do_copy_data':
config/msp430/libgcc.S:(.init4+0x2): undefined reference to `__data_size'
config/msp430/libgcc.S:(.init4+0xc): undefined reference to
`__data_load_start'
/usr/msp430/lib/gcc-lib/msp430/3.2.3/msp2/libgcc.a(_clear_bss.o): In
function `__do_clear_bss':
config/msp430/libgcc.S:(.init4+0x2): undefined reference to `__bss_size'

gcc -v gives me:

Reading specs from /usr/msp430/lib/gcc-lib/msp430/3.2.3/specs
Configured with: ./configure --prefix=/usr/msp430 --target=msp430
--enable-languages=c,c++
Thread model: single
gcc version 3.2.3
 /usr/msp430/lib/gcc-lib/msp430/3.2.3/cc1 -lang-c -v -iprefix
/usr/bin/../lib/gcc-lib/msp430/3.2.3/ -D__GNUC__=3 -D__GNUC_MINOR__=2
-D__GNUC_PATCHLEVEL__=3 -D__GXX_ABI_VERSION=102 -DMSP430 -D__MSP430__
-D__MSP430 -D__NO_INLINE__ -D__STDC_HOSTED__=1 -DMSP430_HAS_HW_MUL
-D__MSP430_1611__ -DMSP430_HAS_HWMUL -D__SIZE_TYPE__=unsigned int
-D__PTRDIFF_TYPE__=int -D__INT_MAX__=32767 main.c -quiet -dumpbase
main.c -mmcu=msp430x1611 -version -o /var/tmp//cceXGb1F.s
GNU CPP version 3.2.3 (cpplib) (GNU assembler syntax)
GNU C version 3.2.3 (msp430)
       compiled by GNU C version 3.3 20030304 (Apple Computer, Inc.
build 1819).
ignoring nonexistent directory "/usr/lib/gcc-lib/msp430/3.2.3/include"
ignoring nonexistent directory
"/usr/lib/gcc-lib/msp430/3.2.3/../../../../msp430/sys-include"
ignoring nonexistent directory
"/usr/lib/gcc-lib/msp430/3.2.3/../../../../msp430/include"
ignoring nonexistent directory "/usr/msp430/msp430/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/msp430/include
 /usr/msp430/lib/gcc-lib/msp430/3.2.3/include
 /usr/msp430/msp430/include
End of search list.
 /usr/msp430/lib/gcc-lib/msp430/3.2.3/../../../../msp430/bin/as -o
/var/tmp//cck4klTs.o /var/tmp//cceXGb1F.s
 msp430-ld -m msp430x1611
/usr/msp430/lib/gcc-lib/msp430/3.2.3/../../../../msp430/lib/ crt430x1611.o
-L/usr/msp430/lib/gcc-lib/msp430/3.2.3/msp2
-L/usr/msp430/lib/gcc-lib/msp430/3.2.3
-L/usr/msp430/lib/gcc-lib/msp430/3.2.3/../../../../msp430/lib/msp2
-L/usr/msp430/lib/gcc-lib/msp430/3.2.3/../../../../msp430/lib
/var/tmp//cck4klTs.o -lgcc -lc -lgcc
/usr/msp430/lib/gcc-lib/msp430/3.2.3/msp2/libgcc.a(_copy_data.o): In
function `__do_copy_data':
config/msp430/libgcc.S:(.init4+0x2): undefined reference to `__data_size'
config/msp430/libgcc.S:(.init4+0xc): undefined reference to
`__data_load_start'
/usr/msp430/lib/gcc-lib/msp430/3.2.3/msp2/libgcc.a(_clear_bss.o): In
function `__do_clear_bss':
config/msp430/libgcc.S:(.init4+0x2): undefined reference to `__bss_size'


Any ideas?

- Regards,
Jens

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users




--
_____________
Oleg V. Kobrin -------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to