[LLVMbugs] [Bug 8985] New: Shared library builds but doesn't work on Mac OS X 10.6

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jan 16 11:37:45 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=8985

           Summary: Shared library builds but doesn't work on Mac OS X
                    10.6
           Product: Build scripts
           Version: 2.8
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Makefiles
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ronaldoferraz at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=6007)
 --> (http://llvm.org/bugs/attachment.cgi?id=6007)
Makefile.rules patch for Mac OS X 10.6

Using ./configure  --enable-shared compiles cleanly but as soon as one tries to
load the library--for example, in Ruby using FFI--the following error is
generated.

dyld: loaded: /Users/<user>/llvm/2.8/lib/libLLVM-2.8.dylib
dyld: lazy symbol binding failed: Symbol not
found:__ZN4llvm2cl6Option11addArgumentEv
  Referenced from: /Users/<user>/llvm/2.8/lib/libLLVM-2.8.dylib
  Expected in: flat namespace

dyld: Symbol not found: __ZN4llvm2cl6Option11addArgumentEv
  Referenced from: /Users/<user>/llvm/2.8/lib/libLLVM-2.8.dylib
  Expected in: flat namespace

Trace/BPT trap

Applying the attached patch fixes the problem.

The modified options use the default two-level namespace on OS X and change
name resolution to run time lookup. The library compiles cleanly and loads
properly with those options.

Using those options doesn't seem to have any ill effect but maybe there's a
reason why the former options were used, although many dynamic libraries for
Mac OS X are compiled with the latter--the former actually seems to be a legacy
from pre-10.3 days.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list