[llvmlinux] [libdrm][clang] libtool: Relinking BROKEN on 'sudo make install'

Sedat Dilek sedat.dilek at gmail.com
Fri Jan 18 14:01:16 UTC 2013


On Fri, Jan 18, 2013 at 2:30 PM, Sedat Dilek <sedat.dilek at gmail.com> wrote:
> [ CC friends from LLVMLinux ]
>
> Hi,
>
> I am still playing with llvm/clang v3.2 and mesa.
>
> My clang version is:
>
> $ clang -v
> clang version 3.2 (tags/RELEASE_32/final)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
>
> As Brian suggested me to switch to mesa-9.x, I wanted to do so.
> So, I needed to bump my libdrm (here: v2.4.41), but the installation
> fails reproducibly!
>
> I am no Makefile/autotools/libtool expert, but as far as my research
> showed me it seems to be a problem of relinking/relink_command caused
> by libtool.
>
> In [1] I have seen the advice to use "--enable-fast-install"
> configure-option as a workaround, but this does NOT help here.
>
> In [2] I read about version mismatch between included libtool.m4 and
> acinclude.m4 files, but libtool.m4 from my libdrm-builddir is
> identical with the system-wide libtool.m4.
>
> 287004 Jan 18 14:04 ~/src/libdrm/libdrm-git/m4/libtool.m4
> 287004 Nov 12  2011 /usr/share/aclocal/libtool.m4
>
> $ diff -uprN ~/src/libdrm/libdrm-git/m4/libtool.m4 /usr/share/aclocal/libtool.m4
> [ NO OUTPUT <--- files are identical ]
>
> Unfortunately, I still see on 'sudo make install':
> ...
> make[2]: Entering directory `/home/wearefam/src/libdrm/libdrm-git/libkms'
> make[2]: Nothing to be done for `install-exec-am'.
> test -z "/opt/xorg/lib" || /bin/mkdir -p "/opt/xorg/lib"
>  /bin/bash ../libtool   --mode=install /usr/bin/install -c   libkms.la
> '/opt/xorg/lib'
> libtool: install: warning: relinking `libkms.la'
> libtool: install: (cd /home/wearefam/src/libdrm/libdrm-git/libkms;
> /bin/bash /home/wearefam/src/libdrm/libdrm-git/libtool  --silent --tag
> CC --mode=relink clang -Wall -Wextra -Wsign-compare
> -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings
> -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
> -Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute
> -Wstrict-aliasing=2 -Winit-self -Wdeclaration-after-statement
> -Wold-style-definition -Wno-missing-field-initializers
> -Wno-unused-parameter -Wno-attributes -Wno-long-long -Winline
> -I../include/drm -I.. -Qunused-arguments -version-number 1:0:0
> -no-undefined -o libkms.la -rpath /opt/xorg/lib linux.lo intel.lo
> dumb.lo api.lo vmwgfx.lo nouveau.lo radeon.lo ../libdrm.la )
> /home/wearefam/src/libdrm/libdrm-git/libtool: line 8968: clang:
> command not found
> libtool: install: error: relink `libkms.la' with the above command
> before installing it
> make[2]: *** [install-libkms_laLTLIBRARIES] Error 1
> make[2]: Leaving directory `/home/wearefam/src/libdrm/libdrm-git/libkms'
> make[1]: *** [install-am] Error 2
> make[1]: Leaving directory `/home/wearefam/src/libdrm/libdrm-git/libkms'
> make: *** [install-recursive] Error 1
>
> Executing the libtool-line shows no ERRORS but continuing with 'sudo
> make install' fails again at same place.
>
> [ ~/src/libdrm/libdrm-git/libtool: line 8968: clang: command not found ]
> ...
>         save_ifs="$IFS"; IFS='~'
>         for cmd in $cmds; do
>           IFS="$save_ifs"
>           eval cmd=\"$cmd\"
>           $opt_silent || {
>             func_quote_for_expand "$cmd"
>             eval "func_echo $func_quote_for_expand_result"
>           }
>           $opt_dry_run || eval "$cmd" || { <--- LINE #8968
>             lt_exit=$?
>
>             # Restore the uninstalled library and exit
>             if test "$opt_mode" = relink; then
>               ( cd "$output_objdir" && \
>                 $RM "${realname}T" && \
>                 $MV "${realname}U" "$realname" )
>             fi
>
>             exit $lt_exit
>           }
>         done
>         IFS="$save_ifs"
> ...
>
> NOTE: My clang binary is in my $PATH and /opt/llvm is ldconfig-ed!
>
> $ which clang
> /opt/llvm/bin/clang
>
> $ echo $PATH
> /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/llvm/bin
>
> $ sudo ldconfig -v | grep -A3 llvm
> /opt/llvm/lib:
>         libLTO.so -> libLTO.so
>         libclang.so -> libclang.so
>         libprofile_rt.so -> libprofile_rt.so
>
> Relevant scripts and logs are attached!
>
> Any help appreciated!
> Have more fun than me!
>
> Regards,
> - Sedat -
>
> [1] http://lists.gnu.org/archive/html/libtool/2010-05/msg00051.html
> [2] http://lists.gnu.org/archive/html/bug-libtool/2012-03/msg00017.html

I looked again into my install-log:

libtool: finish:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin"
ldconfig -n /opt/xorg/lib

So, my first approach was to add...

export PATH="$PATH:/opt/llvm/bin"

...to my build_libdrm.sh script.
This did NOT help!

So, I enhanced the above PATH-line and added /opt/llvm/bin directory
where my clang binary is located.

$ sudo PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/opt/llvm/bin"
make install

...which is successful!

Is there something like $LIBTOOLPATH or $LIBTOOL_PATH?

And why the hell do I have to do such manual workarounds?

Any help still appreciated!

- Sedat -


More information about the LLVMLinux mailing list