HEAD broken on OS X

Judah Jacobson judah.jacobson at gmail.com
Mon Sep 3 16:53:36 EDT 2007


On 9/2/07, Roman Leshchinskiy <rl at cse.unsw.edu.au> wrote:
> Hi all,
>
> when building the current HEAD on OS X 10.4, I get the following error:
>
> Linker.c:1065:0:
>       warning: 'NSIsSymbolNameDefined' is deprecated (declared at
> /usr/include/mach-o/dyld.h:150)
>
> Linker.c:1066:0:
>       warning: 'NSLookupAndBindSymbol' is deprecated (declared at
> /usr/include/mach-o/dyld.h:158)
>
> IIUC, the NS* stuff is deprecated in OS X 10.4 and dlsym should be used
> instead. This is a change from 10.3 and below, where NS* is better.

I'm not that familiar with those functions, but from the following
page it looks like dlsym will work on 10.3 and later:
http://developer.apple.com/documentation/DeveloperTools/Reference/MachOReference/Reference/reference.html

>
> In lookupSymbol in Linker.c we have
>
> #       if defined(OBJFORMAT_ELF)
> <use dlsym>
> #       elif defined(OBJFORMAT_MACHO)
> <use NS*>
> #       elif defined(OBJFORMAT_PEi386)
> <use DLL stuff>
> #       else
> <fail>
> #       endif
>
> In light of the above, testing for OBJFORMAT_MACHO doesn't seem right
> here but I'm not sure what the correct test should be.
>

I think that the standard on OS X for this sort of thing is:
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
see: http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development/Using/chapter_3_section_5.html

Best,
-Judah



More information about the Cvs-ghc mailing list