On 2010-06-15, Alex Polbach <[email protected]> wrote:

> Thanks a lot for so fast answers!!
>
> I have added both flags to CFLAGS and LDFLAGS and they work just fine.
> Very neat solution.

I'm not sure how much those features get used with mspgcc, but I found
them to be invaluable if you want to share code between projects or if
you want to be able to do different builds of a project that have
different features enabled: when you disable (e.g. with #if/#endif) a
function, then all of the code/data that were used only by that
function is automatically left out.  IIRC it worked even when you
disable code with if(0) {}.

When I first implemented those features for mspgcc there were obscure
cases where a function would get discarded when it shouldn't have been
due to omissions in the linker script.  AFAIK, that shouldn't be a
problem, but it's something to keep it in mind if you get linker
errors due to inexplicably missing symbols: the solution is to mark
the symbol with the KEEP() command in the linker script.

-- 
Grant Edwards               grant.b.edwards        Yow! Will it improve my
                                  at               CASH FLOW?
                              gmail.com            


Reply via email to