Re: Dylib Dependencies (again)
Re: Dylib Dependencies (again)
- Subject: Re: Dylib Dependencies (again)
- From: Dave <email@hidden>
- Date: Fri, 8 Jun 2007 14:27:06 +0100
Hi,
On 7 Jun 2007, at 18:54, Greg Guerin wrote:
Dave wrote:
lipo -create libfpacore2_ppc.dylib libfpacore2_x86.dylib -output
libpfacore_uni.dylib
My first thought was that lipo is changing the name when it creates
the
universal lib, but I don't see that when I run it here. The name
of each
arch-specific element remains the same in the output lib.
Assuming that also happens for you, then you can use install_name_tool
twice, on the _ppc and _x86 files, before using lipo to combine
them. That
should work. It should also be unnecessary, but if it works for
you, that
may be a suitable work-around.
I am NOT using "install_name_tool" on these files. The the two files
(PPC and x86)) are a 3rd Party Dynamic Library that I combine into
one universal file. This library does not have any dependencies so I
don't have to set a path.
I have another project built with XCode that is a wrapper for the 3rd
party library this produces a .bundle file, I set the path of
the .bundle file to point to 3rd party dynamic library.
Here are the results you asked for. I do not run Install Name Tool on
this file. I run it on the bundle file that *uses* file.
TheStateOfTheArt:~ Dave$ cd /Documents/Programming/RunRevBase/
Projects/ExternalsEnvironmentV2/FPALibrary/FPACoreLibrary/
TheStateOfTheArt:/Documents/Programming/RunRevBase/Projects/
ExternalsEnvironmentV2/FPALibrary/FPACoreLibrary Dave$ ls -l
total 6456
-rwxr-xr-x 1 Dave admin 1767084 Jun 8 10:25 libfpacore2_ppc.dylib
-rwxr-xr-x 1 Dave admin 1510260 Jun 8 10:42 libfpacore2_x86.dylib
TheStateOfTheArt:/Documents/Programming/RunRevBase/Projects/
ExternalsEnvironmentV2/FPALibrary/FPACoreLibrary Dave$ lipo -create
libfpacore2_ppc.dylib libfpacore2_x86.dylib -output
libfpacore2_uni.dylib
TheStateOfTheArt:/Documents/Programming/RunRevBase/Projects/
ExternalsEnvironmentV2/FPALibrary/FPACoreLibrary Dave$ otool -D -arch
all libfpacore2_uni.dylib
libfpacore2_uni.dylib (architecture ppc):
/Users/shaun/Documents/EngineAPI2/FPACore2/libfpacore2_ppc.dylib
libfpacore2_uni.dylib (architecture i386):
/Users/admin/Documents/EngineAPI2/FPACore2/libfpacore2_x86.dylib
TheStateOfTheArt:/Documents/Programming/RunRevBase/Projects/
ExternalsEnvironmentV2/FPALibrary/FPACoreLibrary Dave$
--------------------
I ran install_name_tool as so (this a New Step for me, I didn't
realize you had to change the name of the Target file:
TheStateOfTheArt:/Documents/Programming/RunRevBase/Projects/
ExternalsEnvironmentV2/FPALibrary/FPACoreLibrary Dave$
install_name_tool -id libfpacore2_uni.dylib libfpacore2_uni.dylib
TheStateOfTheArt:/Documents/Programming/RunRevBase/Projects/
ExternalsEnvironmentV2/FPALibrary/FPACoreLibrary Dave$ otool -D -arch
all libfpacore2_uni.dylib
libfpacore2_uni.dylib (architecture ppc):
libfpacore2_uni.dylib
libfpacore2_uni.dylib (architecture i386):
libfpacore2_uni.dylib
---------------------
TheStateOfTheArt:/Documents/Programming/RunRevBase/Projects/
ExternalsEnvironmentV2/FPALibrary/FPACoreLibrary Dave$ file `which
lipo install_name_tool`
/usr/bin/lipo: Mach-O executable ppc
/usr/bin/install_name_tool: Mach-O fat file with 2 architectures
/usr/bin/install_name_tool (for architecture i386): Mach-O
executable i386
/usr/bin/install_name_tool (for architecture ppc): Mach-O
executable ppc
-------------------
This is the terminal output of the install_name_tool which I use on
the bundle file. The folder below is inside the bundle structure.
TheStateOfTheArt:/Documents/Programming/RunRevBase/Projects/HFPA-VW/
RunTime/Externals/FPALibrary.bundle/Contents/MacOS Dave$ ls -l
total 296
-rwxr-xr-x 1 Dave admin 148932 Jun 7 10:31 FPALibrary
TheStateOfTheArt:/Documents/Programming/RunRevBase/Projects/HFPA-VW/
RunTime/Externals/FPALibrary.bundle/Contents/MacOS Dave$ otool -D -
arch all FPALibrary
FPALibrary (architecture ppc):
FPALibrary (architecture i386):
TheStateOfTheArt:/Documents/Programming/RunRevBase/Projects/HFPA-VW/
RunTime/Externals/FPALibrary.bundle/Contents/MacOS Dave$ otool -L
FPALibrary
FPALibrary:
/System/Library/Frameworks/QuartzCore.framework/Versions/A/
QuartzCore (compatibility version 1.2.0, current version 1.4.9)
/System/Library/Frameworks/QuickTime.framework/Versions/A/
QuickTime (compatibility version 1.0.0, current version 9.0.0)
@loader_path/../../../../DynamicLibraries/
libfpacore2_uni.dylib (compatibility version 0.0.0, current version
0.0.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/
Carbon (compatibility version 2.0.0, current version 128.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0,
current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 88.3.3)
Which shows the correct dependency file path for the Bundle File
(@loader_path/../../../../DynamicLibraries/libfpacore2_uni.dylib). If
I run this on a PowerPC the Bundle and the 3rd party library work ok.
I copied it onto an intel machine and it failed to load. When I
looked at the path with otool, the file path had not been set
correctly or rather had been left unchanged.
----------------------------
Hope this information is useful. I would love to get to the bottom of
this!
All the Best
Dave
_______________________________________________
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