rdynamic on Mac

Hi all,

My example compiler is working fine on Linux, including the extern'd
functions (via -rdynamic flag on linker), but a friend on a MacOS
(Darwin) cannot find the extern'd function.

LLVM ERROR: Program used external function 'printVar' which could not
be resolved!

I've read some posts on the web indicating problems with the -rdynamic
option on Mac's GCC, but I'm not sure. What's the Mac-style for that?

cheers,
--renato

Reclaim your digital rights, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm

Renato Golin wrote:

I've read some posts on the web indicating problems with the -rdynamic
option on Mac's GCC, but I'm not sure. What's the Mac-style for that?

-rdynamic doesn't exist on OSX, nor should it be needed. Just make sure
that you do *not* strip the executable (i.e., avoid strip, install -s,
etc.), IIRC that's needed to make dlopening the executable work on OSX
(some versions at least).

HTH,
Albert

Hi-

You /cannot/ build static binaries on Darwin apart from a few strange edge cases like the dynamic linker itself and kernel extensions - it's all implied to be dynamic. Where are the symbols you're trying to access coming from?

Alastair

Ahn! That's it! In my "production" version of the Makefile make strip
the final step on the binary.

thanks!

--renato

Reclaim your digital rights, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm