RE: Code stripping blues...
RE: Code stripping blues...
- Subject: RE: Code stripping blues...
- From: "Cianflone, Chris" <email@hidden>
- Date: Fri, 27 Jan 2006 22:50:37 -0600
- Thread-topic: Code stripping blues...
Title: RE: Code stripping blues...
Well, I gave this another shot with our plugins which are a lot smaller than our app which made it a quick test. Still no luck. I still get link errors where I did not in CodeWarrior.
Thanks for the suggestions.
Chris
Chris Cianflone
Software Engineer
MakeMusic, Inc.
www.makemusic.com
-----Original Message-----
From: Ivan Cavero Belaunde [mailto:email@hidden]
Sent: Wed 1/25/2006 4:46 PM
To: Cianflone, Chris; Andy O'Meara; XCode Users
Cc:
Subject: RE: Code stripping blues...
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