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

            Bug ID: 22014
           Summary: OCaml bindings don't link to libLLVM-3.x.so with
                    -Wl,--as-needed
           Product: Build scripts
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Makefiles
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 13587
  --> http://llvm.org/bugs/attachment.cgi?id=13587&action=edit
Fix OCaml bindings linking with -Wl,--as-needed

When building LLVM with "-Wl,--as-needed" in LDFLAGS (as it's been the default
in Arch Linux for several years now), the OCaml bindings' .so libs won't get
linked to libLLVM-3.x.so and thus result in undefined symbols when they are
used:

> /usr/lib/ocaml/dllllvm.so: undefined symbol: LLVMGetFirstUse

I believe this is caused by the object files appearing after the libraries
during the linking stage. [1]

I've attached a patch for Makefile.ocaml which fixes the issue for me.

(I only tested with LLVM 3.5 but this issue should affect /trunk as well.)

[1]
https://wiki.mageia.org/en/Overlinking_issues_in_packaging#Wrong_linking_order

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to