Back in the day, mspgcc treated main as special in an attempt to save a little memory. You can see the background on the original approach, and what I did to try to clean it up while retaining this specialness in http://www.mail-archive.com/mspgcc-users@lists.sourceforge.net/msg09732.html
Like most special cases, it continues to cause problems: it's why the debugger still can't find local variables in main (SF 3420924), and is probably the cause of what you're seeing. Please post a bug report on https://sourceforge.net/tracker/?group_id=42303&atid=432701 and I'll see if I can figure something out. My patience with this feature is about at its end, though, so the solution may be to stop treating main as special unless the user adds the magic fairy dust around the declaration that makes it work this way. Peter On Mon, Feb 20, 2012 at 10:31 PM, Robert Wessels <robertin...@yahoo.com> wrote: > Hi All, > > I just ran into an issue and am wondering if I am missing something. > > main.c implements int main(void) > foo.c implements void blink(void) > > main() calls blink() > > main.c and foo.c are compiled like so: > msp430-gcc -c -mmcu=msp430g2452 -g -Os -Wall -Wunused -IInclude -o main.o > main.c > msp430-gcc -c -mmcu=msp430g2452 -g -Os -Wall -Wunused -IInclude -o foo.o foo.c > > Test 1: > If I link main.o and foo.o with msp430-gcc main.o foo.o -mmcu=msp430g2452 > -Wl,-Map=hello.map -o hello.elf all is blinky blinky. > > Test 2: > when I create an archive core.a that holds foo.o with: > > msp430-ar rcsv core.a foo.o > > and then link the final elf file with: > > msp430-gcc core.a foo.o -mmcu=msp430g2452 -Wl,-Map=hello.map -o hello.elf > > All again is blinky blinky. > > Test 3: > The problem surfaces when I create an archive core.a that holds main.o with: > > msp430-ar rcsv core.a main.o > > and then link the final elf file with: > > msp430-gcc core.a main.o -mmcu=msp430g2452 -Wl,-Map=hello.map -o hello.elf > > All is dark. > > I ran the same test with a simple "hello world" compiled for x86 using gcc > and ar under cygwin and all is fine in all 3 cases. > > Any idea why this does not work for msp430? I looked at the linker scripts > but that only resulted in more darkness. > > Regards, > > Robert Wessels > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Mspgcc-users mailing list > Mspgcc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mspgcc-users ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users