RE: Code stripping blues...
RE: Code stripping blues...
- Subject: RE: Code stripping blues...
- From: "Cianflone, Chris" <email@hidden>
- Date: Wed, 25 Jan 2006 15:21:30 -0600
- Thread-topic: Code stripping blues...
Title: 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