Re: Code stripping blues...
Re: Code stripping blues...
- Subject: Re: Code stripping blues...
- From: "Andy O'Meara" <email@hidden>
- Date: Wed, 25 Jan 2006 18:48:53 -0500
- Thread-topic: Code stripping blues...
Title: Re: Code stripping blues...
Interesting...and strange. I can’t help wonder why the authors would do that. Call me negative, but when I hear about on this list the full symbol files sizes of projects getting outrageously huge and unwieldy, I’m hesitant to permanently enable full symbols for both build styles (and have to do all that subsequent stripping).
For me, this whole issue is disheartening. Codewarrior “just worked” (smart dead code stripping is a win/win feature with no risk and a negligible link performance hit), and it’s pretty unimpressive to have to return the stone age in terms of dealing with this stuff. It’s just frustrating to have to take a step back in development only b/c Xcode is the only Intel show in town.
In any case, thanks for the info, Ivan...
Andy
On 1/25/06 5:46 PM, "Ivan Cavero Belaunde" <email@hidden> wrote:
My experience is that dead-code-stripping does work properly. However, it requires that your project and the static libs being fed into ld are built with full debugging symbols ( -gfull, and note this is not the default). This is the case even for release builds, from which you can strip out the symbols either at link time or as a separate strip.
If you don’t do that, then dead-code-stripping doesn’t work as you’d expect and you get link failures.
This was documented somewhere in the release notes, but it really needs to be more prominent.
Iván
Iván Cavero Belaunde (email@hidden)
From: xcode-users-bounces+icavero=email@hidden [mailto:xcode-users-bounces+icavero=email@hidden] On Behalf Of Cianflone, Chris
Sent: Wednesday, January 25, 2006 1:22 PM
To: Andy O'Meara; XCode Users
Subject: RE: Code stripping blues...
Thanks for the nice description of this. This has been causing us a lot of headaches too.
<<Rather than have to include oodles of additional .c files (and have to carry
them around in the project and always have to compile them) when they'll all
get stripped out later is silly.>>
I agree it is silly and it has basically been our current workaround.
Waiting to hear for a better approach...
Chris
Chris Cianflone
Software Engineer
MakeMusic, Inc.
www.makemusic.com
-----Original Message-----
From: xcode-users-bounces+ccianflone=email@hidden on behalf of Andy O'Meara
Sent: Wed 1/25/2006 12:36 PM
To: XCode Users
Cc:
Subject: Code stripping blues...
Quick question for the xcode/gcc/ld veterans here... Also, sorry in advance
if this question is overly reoccurring...
Our codebase has the usual .c, .cpp, and .h files, but there's a few utility
projects that we've brought from CW to Xcode. These projects only used a
handful of functionality from a couple .c files so we have those .c files in
the project, leaving lots of code able also to be dead-stripped. In other
words:
void foo3();
void main() {
foo1();
}
void foo1() {
...
}
void foo2() {
...
foo3();
}
Problem is, in Xcode/ld the symbol dependency check seems to be done
*before* dead code stripping, so gcc/ld complains that stuff is undefined.
Rather than have to include oodles of additional .c files (and have to carry
them around in the project and always have to compile them) when they'll all
get stripped out later is silly. In other words, in the above code, I'd get
a link error that foo3() is undefined.
In CodeWarrior, the linker didn't propagate/enforce dependency until after
dead code stripping, so the above code would link like you'd expect. In
fact, not only is this the default linker behavior for the release build, I
believe it was the default setting for the debug target as well.
Anyway, after checking all the ld man pages, it's just weird how this
feature doesn't seem to be evident (if it even can even be done at all).
Am I missing something silly?
Thanks,
Andy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden