Jump to content
Sign in to follow this  
MishFTW

Packaged Mac App

Recommended Posts

I just got a bunch of system info when I ran lsof but nothing about pyrogenesis. I also ran

lsof -a -d cwd -c pyrogenesis

but didn't produce any results.

The game has to be running when you use that command. For me it shows:


COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
pyrogenes 207 Ben cwd DIR 14,2 3672 324263 /Users/Ben/0ad/binaries/system

so dlopen should be finding libAtlasUI and libCollada, and indeed it works without any @executable_path hack. Maybe for you and wraitii it's something different?

Share this post


Link to post
Share on other sites

I believe it's because it's DLLLoader.cpp that loads it. It explicitly calls a path, which OSX may consider as an absolute path.

Share this post


Link to post
Share on other sites

I believe it's because it's DLLLoader.cpp that loads it. It explicitly calls a path, which OSX may consider as an absolute path.

Hmm but that still doesn't explain why it works for me and not you. I've made some local changes for OS X building, but I'm pretty sure the path for loading libraries is untouched for non-bundles: DllLoader.cpp (I'm testing by running a loose binary, not a bundle). I'd really like to get to the bottom of this annoying problem :(

Share this post


Link to post
Share on other sites

Okay this is what I got:


Last login: Fri Nov 2 22:05:48 on ttys001
iMac:~ Geek$ lsof -a -d cwd -c pyrogenesis
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
pyrogenes 2323 Geek cwd DIR 14,2 2210 381296 /Users/Geek

Share this post


Link to post
Share on other sites

Ah thanks! So the cwd isn't always binaries/system! I did some testing and noticed that if I open the game from Finder, the cwd is /Users/Ben, so indeed Atlas and Collada loading are broken (this problem doesn't occur on the official bundles because it uses an absolute path with the bundle's framework directory). 99.99% of the time I use terminal to run the game, and in that case the cwd is binaries/system, so it just happens to work by relying on dlopen's cwd path searching :)

Wraitii's solution looks like it may be the least evil (another option would be setting the current directory), so I'll test it some more and commit to SVN, then merge it into my github osx-build branch.

Share this post


Link to post
Share on other sites

It worked perfectly, so I committed a variation of your patch (r12834) Please test and see how it goes (y)

It works. Now I don't have to make the change myself each time before I compile :P

BTW my experiments with SVN are going nicely so I'll start building packages soon. Once the entire GitHub migration thing is sorted out...

Share this post


Link to post
Share on other sites

Your fix seems clean and it looks like it's working for me (I build strictly non-bundled, though), so I'd say this one has been sorted out.

Share this post


Link to post
Share on other sites

Do I always have to run export CC=llvm-gcc-4.2 CXX=llvm-g++-4.2 before updating? Is there a way I can make this setting permanent?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×