FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

-od path should be passed to linker, as well?

 
Post new topic   Reply to topic     Forum Index -> Build
View previous topic :: View next topic  
Author Message
MrTact



Joined: 09 Nov 2005
Posts: 12

PostPosted: Sat Dec 30, 2006 10:08 am    Post subject: -od path should be passed to linker, as well? Reply with quote

It seems to me I have been able to link .obj files created in the directory I specify with the -od switch without also adding that dir to LIBPATH. Now suddenly, that is not the case, and I wonder whether I broke that with my tinkering, or if perhaps I just hallucinated it.

If that isn't the expected behavior, then can I suggest perhaps it should be? It only makes sense that wherever you tell the compiler to create object files is also a place you want the linker to look for them.

TimK
Back to top
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Sat Dec 30, 2006 3:56 pm    Post subject: Re: -od path should be passed to linker, as well? Reply with quote

MrTact wrote:
It seems to me I have been able to link .obj files created in the directory I specify with the -od switch without also adding that dir to LIBPATH. Now suddenly, that is not the case, and I wonder whether I broke that with my tinkering, or if perhaps I just hallucinated it.

If that isn't the expected behavior, then can I suggest perhaps it should be? It only makes sense that wherever you tell the compiler to create object files is also a place you want the linker to look for them.

LIBPATH is where the linker looks for libraries and not your object files. The path to each object file is specified in the command line given to OptLink. What does your <project>.ksp file look like?
_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
MrTact



Joined: 09 Nov 2005
Posts: 12

PostPosted: Thu Jan 11, 2007 1:12 am    Post subject: Reply with quote

OK, having had a little time to come back to this, I probably broke this with my long filenames patch. (So don't apply it until I have a chance to fix it! Smile

It looks like I'm not getting an object file for any source file that has a long filename. (The filename only -- paths with long directory names don't seem to be a problem.) Which, naturally, would explain why I'm getting link errors -- can't link to an object that doesn't exist!

With luck, by the time you read this I'll have fixed it . . .

TimK
Back to top
View user's profile Send private message
MrTact



Joined: 09 Nov 2005
Posts: 12

PostPosted: Wed Jan 17, 2007 9:18 pm    Post subject: Reply with quote

I found a solution for this. The problem was, in fact, that any source file name longer than 8 characters was subject to the shortening effect, so foobarbaz.d would become FOOBAR~1.D. For obvious reasons, this prevented Build from generating correct object files.

The fix was to strip off the filename before passing the path to GetShortPathname and then re-append it afterward. I have an updated patch that does this, but with the ticket assigned to you, I don't seem to be able to modify it anymore. Can you put it into a state where I can add a comment & attach the updated patch? If that proves too troublesome I can simply write another ticket.

TimK
Back to top
View user's profile Send private message
MrTact



Joined: 09 Nov 2005
Posts: 12

PostPosted: Thu Feb 01, 2007 1:14 pm    Post subject: Reply with quote

OK, I'm a nitwit. I couldn't update the ticket because I wasn't logged in! I just attached the updated patch to ticket #45.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Build All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group