Skip to content

flandr/wtf-osx-dlopen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DYLD_LIBRARY_PATH considered silly

Did you know that OS X's dlopen will search for dynamic libraries relative to the DYLD_LIBRARY_PATH first even if the input path is absolute? Does that seem crazy to you?. It seems crazy to me.

Build:

$ make
+ cc foo.o
+ ld libfoo.dylib
+ cc fakefoo.o
+ ld libfakefoo.dylib
+ cc main

A sane system (Ubuntu 14.04):

Doing dlopen on the real libfoo. Any sane system will report so:
=== Invoking the real foo

OS X 10.10.4, aka Crazy Town:

$ ./wtf.sh
Doing dlopen on the real libfoo. Any sane system will report so:
=== Invoking the fake foo

OK, hope this helps.

About

Demonstrate the full silliness of this battlestation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published