use RPATH but not RUNPATH?

When you ship a binary, it’s good to provide means for the users to accommodate the binary to the specifics of their own system, among other things, adjusting library search paths. A user can generally tweak LD_LIBRARY_PATH and /etc/ld.so.conf, both of which are with lower precedence than DT_RPATH, i.e. you can’t override what is hardcoded … Read more

How to use a DLL in a Haskell project?

You’ll need to use extra-lib-dirs and extra-libraries in the executable section of your .cabal file like so: name: MyApp version: 0.1.0.0 synopsis: homepage: author: simon.bourne category: build-type: Simple cabal-version: >=1.10 library exposed-modules: HelloWorld build-depends: base >= 4.7 && < 5 hs-source-dirs: src default-language: Haskell2010 executable MyApp main-is: Main.hs extra-lib-dirs: lib extra-libraries: helloWorld build-depends: base >= … Read more

Why does ld need -rpath-link when linking an executable against a so that needs another so?

Why is it, that ld MUST be able to locate liba.so when linking test? Because to me it doesn’t seem like ld is doing much else than confirming liba.so‘s existence. For instance, running readelf –dynamic ./test only lists libb.so as needed, so I guess the dynamic linker must discover the libb.so -> liba.so dependency on … Read more

How to set the runtime path (-rpath) of an executable with gcc under Mac OSX?

Found by experimentation, and inspecting the command lines generated by Xcode for a reference rpath demo project by Dave Driblin: otool -L shows you the install name of the linked libraries. To get @rpath to work, you need to change the install name of the library: $ gcc -dynamiclib blah.o -install_name @rpath/t/libblah.dylib -o libblah.dylib $ … Read more

What does exactly the warning mean about hidden symbol being referenced by DSO?

What is a DSO? A DSO is a Dynamic Shared Object, or less formally a shared library. What is a hidden symbol? A hidden symbol is a symbol (i.e. name of function or data object) that has been compiled with hidden linkage, e.g. as per the (GCC specific) declaration: int x __attribute__ ((visibility (“hidden”))); If … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)