<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>153191</bug_id>
          
          <creation_ts>2016-01-16 21:36:19 -0800</creation_ts>
          <short_desc>[CMake] FindLLVM.cmake does not find shared library on OSX, Windows, or with llvm 3.8+</short_desc>
          <delta_ts>2016-02-17 21:40:10 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=151559</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>126492</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jeremy Huddleston Sequoia">jeremyhu</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cgarcia</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1156260</commentid>
    <comment_count>0</comment_count>
    <who name="Jeremy Huddleston Sequoia">jeremyhu</who>
    <bug_when>2016-01-16 21:36:19 -0800</bug_when>
    <thetext>The change in bug #151559 doesn&apos;t work for current versions of llvm on all platforms, and it won&apos;t work on platforms that don&apos;t use the .so file extension (eg: OS X and Windows)

The macro is doing:

	set(LLVM_SONAME &quot;LLVM-${LLVM_VERSION}&quot;) 
 	if (EXISTS &quot;${LLVM_LIBS_DIRECTORY}/lib${LLVM_SONAME}.so&quot;) 
 	    set(LLVM_LIBRARIES &quot;${LLVM_LDFLAGS} -l${LLVM_SONAME}&quot;) 
 	else () 
 	    set(LLVM_LIBRARIES &quot;${LLVM_LDFLAGS} ${LLVM_LIBS}&quot;) 
 	endif ()

Recent versions of llvm don&apos;t include &quot;-${LLVM_VERSION}&quot; in the name of the library.
On OS X, the library is named libLLVM-${LLVM_VERSION}.dylib for llvm 3.7 and earlier and libLLVM.dylib for llvm 3.8 (release_38 branch) and 3.9 (trunk).

I suspect the library is named libLLVM.so on Linux and BSD for llvm 3.8 and later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1156271</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-01-17 00:01:07 -0800</bug_when>
    <thetext>I guess it depends on the distro in the case of Linux, in debian it&apos;s /usr/lib/x86_64-linux-gnu/libLLVM-3.8.0.so.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1156273</commentid>
    <comment_count>2</comment_count>
    <who name="Jeremy Huddleston Sequoia">jeremyhu</who>
    <bug_when>2016-01-17 00:22:01 -0800</bug_when>
    <thetext>Or maybe it has to do with the build system.  llvm deprecated autoconf in favor of cmake in llvm-3.8, so maybe it&apos;s that their cmake build system is not appending the version number but the deprecated autoconf-based build system still is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1156285</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-01-17 09:16:22 -0800</bug_when>
    <thetext>In the openSUSE changelog for WebKit I see:

&quot; + Inject a llvm-config wrapper script into ~/bin, which replaces
    the original&apos;s output of static libs with dynamic shared
    objects. This is supposedly going to be corrected with
    LLVM 3.8.&quot;

https://build.opensuse.org/package/view_file/GNOME:Next/webkit2gtk3/webkit2gtk3.changes

Jeremy, do you know if there is some less-hacky way to get shared libraries out of llvm-config in LLVM 3.8, as implied by that changelog? If so, we should switch to using that... otherwise we will just have to add whatever hacks necessary to FindLLVM.cmake to make it work.

You could also build with -DENABLE_FTL_JIT=OFF to avoid the dependency on LLVM, but this doesn&apos;t look too hard to solve....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1156286</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-01-17 09:19:23 -0800</bug_when>
    <thetext>(And does anyone know why LLVM thinks it&apos;s remotely acceptable to not ship a pkg-config file?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1165823</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-02-17 17:29:58 -0800</bug_when>
    <thetext>I&apos;m going to remove FindLLVM.cmake due to r196729.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>