That should work out fine, although it will be a lot better if you use a few pre-processor symbols, so that your "internal globals" are globals when compiling module for module, and "static" when using a single C file.
As for moving to 4.1, I know there has been some work on 4.0 (it's in the cvs), but I don't know how far it has come, or how difficult it is, or whether anyone has thought about moving to 4.1 or 4.2. mvh., David > Hi David, > > I was actually looking in doing your first option yesterday. The way I'm > trying to do it is to include the files such as: > > #include "foo.c" > > Notice I'm including a .c file. I know it's probably not clean code but it's > the only simple way I can think of. > > I'm sure it would be very fun and challenging to migrate to mspgcc 4.1! > > Best regards, > > Yvan > > > >From: "David Brown" <da...@westcontrol.com> > >Reply-To: "GCC for MSP430 - http://mspgcc.sf.net" > ><mspgcc-users@lists.sourceforge.net> > >To: "GCC for MSP430 - http://mspgcc.sf.net" > ><mspgcc-users@lists.sourceforge.net> > >Subject: Re: [Mspgcc-users] Making and adding a library without msp430-ar > >Date: Wed, 14 Jun 2006 09:36:11 +0200 > > > >Symbols that span seperate files must be visible to the linker, and must > >therefore be in your object files (either as individual object files, or > >combined in a library). Everything that is local to a single file can be > >declared "static", and thus hidden. > > > >If you want only a limited subset of your global symbols to be visible > >(i.e., application-usable symbols but not internal library symbols), then I > >can only think of two ways to do it. One is to combine your code into a > >single large C file so that there are no internal library global symbols > >(they can be declared static). You'd want to automate this in some way, so > >that you can write, test and debug the code as separate modules, and only > >combine them for release. The other way is to help get the gcc 4.1 version > >of mpcgcc finished, as gcc4.1 is able to do this sort of thing itself. > > > >mvh., > > > >David > > > > > > > >----- Original Message ----- > >From: "Yvan Castilloux" <kay...@hotmail.com> > >To: <mspgcc-users@lists.sourceforge.net> > >Sent: Tuesday, June 13, 2006 9:55 PM > >Subject: Re: [Mspgcc-users] Making and adding a library without msp430-ar > > > > > > > Hi David, > > > > > > I can't make all my variables static as I have global variables spanning > > > multiple files. The same applies to some functions. > > > > > > How can I make the variables and functions link without being visible to > >the > > > application as they are not used? I don't want them to appear in any way > >in > > > the .lst file. > > > > > > I have spent most of the day using the strip all option (-s), even with > >the > > > keep (-K) option and it seems that I have to keep all the global > >variables > > > and functions for it to link properly. > > > > > > Thanx, > > > > > > Yvan > > > > > > > > > >From: "David Brown" <da...@westcontrol.com> > > > >Reply-To: "GCC for MSP430 - http://mspgcc.sf.net" > > > ><mspgcc-users@lists.sourceforge.net> > > > >To: "GCC for MSP430 - http://mspgcc.sf.net" > > > ><mspgcc-users@lists.sourceforge.net> > > > >Subject: Re: [Mspgcc-users] Making and adding a library without > >msp430-ar > > > >Date: Tue, 13 Jun 2006 09:01:29 +0200 > > > > > > > > > > > >----- Original Message ----- > > > >From: "Yvan Castilloux" <kay...@hotmail.com> > > > >To: <mspgcc-users@lists.sourceforge.net> > > > >Sent: Tuesday, June 13, 2006 12:29 AM > > > >Subject: Re: [Mspgcc-users] Making and adding a library without > >msp430-ar > > > > > > > > > > > > > Hi Grant, > > > > > > > > > > Thanx for your reply. > > > > > > > > > > My main goal is to create a library with which a user cannot > >recreate > > > >the > > > >C > > > > > code. I thought there was function other than ar to achieve this. > > > > > > > > > > > > >To all intents and purposes, you cannot re-create C code from object > >code. > > > >If you have full, detailed debugging information with the object code > >then > > > >a > > > >skilled programmer code get some information out. So the easy answer > >is > >to > > > >compile your modules without any debugging flags (-g) enabled. If you > > > >additionally make sure that all symbols (functions and data) that are > >not > > > >exported are declared static (good practice anyway), then these symbols > > > >will > > > >be hidden too. > > > > > > > >mvh., > > > > > > > >David > > > > > > > > > > > > > Thanx for suggesting the function strip. If I have any problem, I > >will > > > >send > > > > > an email. > > > > > > > > > > Yvan > > > > > > > > > > > > > > > >From: Grant Edwards <gra...@visi.com> > > > > > >Reply-To: "GCC for MSP430 - http://mspgcc.sf.net" > > > > > ><mspgcc-users@lists.sourceforge.net> > > > > > >To: mspgcc-users@lists.sourceforge.net > > > > > >Subject: Re: [Mspgcc-users] Making and adding a library without > > > >msp430-ar > > > > > >Date: Mon, 12 Jun 2006 21:51:33 +0000 (UTC) > > > > > > > > > > > >On 2006-06-12, Yvan Castilloux <kay...@hotmail.com> wrote: > > > > > > > > > > > > > I would like to know how to create a library of type .dll in > > > > > > > windows and then link it into a project with msp430-gcc. > > > > > > > > > > > >I don't think you can do that. > > > > > > > > > > > > > I don't want to use msp430-ar since anybody can see the C code > > > > > > > variables and recreate the C code. > > > > > > > > > > > >Not if strip the object modules. > > > > > > > > > > > > > When calling msp430-gcc, I believe I have to set linker > > > > > > > options with -Wl. > > > > > > > > > > > >Yes, -Wl is how you set linker options. > > > > > > > > > > > > > I would like to create a static library. > > > > > > > > > > > >You use msp430-ar for that. > > > > > > > > > > > > > Does anybody have a solution? > > > > > > > > > > > >I don't think I understand the problem. > > > > > > > > > > > >-- > > > > > >Grant Edwards grante Yow! I'm > > > >continually > > > > > > at AMAZED at > > > > > >th'breathtaking > > > > > > visi.com effects of WIND > > > > > >EROSION!! > > > > > > > > > > > > > > > > > > > > > > > >_______________________________________________ > > > > > >Mspgcc-users mailing list > > > > > >Mspgcc-users@lists.sourceforge.net > > > > > >https://lists.sourceforge.net/lists/listinfo/mspgcc-users > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > Mspgcc-users mailing list > > > > > Mspgcc-users@lists.sourceforge.net > > > > > https://lists.sourceforge.net/lists/listinfo/mspgcc-users > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >_______________________________________________ > > > >Mspgcc-users mailing list > > > >Mspgcc-users@lists.sourceforge.net > > > >https://lists.sourceforge.net/lists/listinfo/mspgcc-users > > > > > > > > > > > > > > > _______________________________________________ > > > Mspgcc-users mailing list > > > Mspgcc-users@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/mspgcc-users > > > > > > > > > > > > > > > > > > >_______________________________________________ > >Mspgcc-users mailing list > >Mspgcc-users@lists.sourceforge.net > >https://lists.sourceforge.net/lists/listinfo/mspgcc-users > > > > > _______________________________________________ > Mspgcc-users mailing list > Mspgcc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mspgcc-users > > >