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" <[email protected]>
Reply-To: "GCC for MSP430 - http://mspgcc.sf.net"; <[email protected]> To: "GCC for MSP430 - http://mspgcc.sf.net"; <[email protected]>
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" <[email protected]>
To: <[email protected]>
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" <[email protected]>
> >Reply-To: "GCC for MSP430 - http://mspgcc.sf.net";
> ><[email protected]>
> >To: "GCC for MSP430 - http://mspgcc.sf.net";
> ><[email protected]>
> >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" <[email protected]>
> >To: <[email protected]>
> >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 <[email protected]>
> > > >Reply-To: "GCC for MSP430 - http://mspgcc.sf.net";
> > > ><[email protected]>
> > > >To: [email protected]
> > > >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 <[email protected]> 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
> > > >[email protected]
> > > >https://lists.sourceforge.net/lists/listinfo/mspgcc-users
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > Mspgcc-users mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/mspgcc-users
> > >
> > >
> > >
> >
> >
> >
> >
> >_______________________________________________
> >Mspgcc-users mailing list
> >[email protected]
> >https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>
>
>
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>
>




_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users



Reply via email to