| Link autofdo with libLLVM |
| |
| Since we are building LLVM dynamically and linking it statically, |
| autofdo was not able to recognize libLLVM.so correctly. This patch |
| changed behaviour of autofdo configuration so that it can be linked |
| with libLLVM. |
| |
| diff --git a/m4/ax_llvm.m4 b/m4/ax_llvm.m4 |
| index f93c873..fa0fcec 100644 |
| --- a/m4/ax_llvm.m4 |
| +++ b/m4/ax_llvm.m4 |
| @@ -60,17 +60,10 @@ AC_DEFUN([AX_LLVM], |
| if test -f "$ac_llvm_config_path"; then |
| LLVM_CXXFLAGS=$($ac_llvm_config_path --cppflags) |
| shared_mode=$($ac_llvm_config_path --shared-mode) |
| - rpath="" |
| - if test "x$shared_mode" = "xstatic"; then |
| - LLVM_LDFLAGS="$($ac_llvm_config_path --ldflags)" |
| - LLVM_LIBS="$($ac_llvm_config_path --libs $1) \ |
| - -ldl -lpthread -ltinfo" |
| - elif test "x$shared_mode" = "xshared"; then |
| - rpath="$($ac_llvm_config_path --libdir)" |
| - LLVM_LDFLAGS="-Wl,-rpath $rpath \ |
| - $($ac_llvm_config_path --ldflags)" |
| - LLVM_LIBS="$($ac_llvm_config_path --libs $1)" |
| - fi |
| + rpath="$($ac_llvm_config_path --libdir)" |
| + LLVM_LDFLAGS="-Wl,-rpath $rpath \ |
| + $($ac_llvm_config_path --ldflags)" |
| + LLVM_LIBS="-lLLVM" |
| |
| AC_REQUIRE([AC_PROG_CXX]) |
| CXXFLAGS_SAVED="$CXXFLAGS" |