GNU bug report logs - #20622
libtool 2.4.6: incorrect linking with tcc under GNU/Linux

Previous Next

Package: libtool;

Reported by: Vincent Lefevre <vincent <at> vinc17.net>

Date: Thu, 21 May 2015 16:42:02 UTC

Severity: normal

To reply to this bug, email your comments to 20622 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-libtool <at> gnu.org:
bug#20622; Package libtool. (Thu, 21 May 2015 16:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vincent Lefevre <vincent <at> vinc17.net>:
New bug report received and forwarded. Copy sent to bug-libtool <at> gnu.org. (Thu, 21 May 2015 16:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vincent Lefevre <vincent <at> vinc17.net>
To: bug-libtool <at> gnu.org
Subject: libtool 2.4.6: incorrect linking with tcc under GNU/Linux
Date: Thu, 21 May 2015 18:41:07 +0200
I've installed libtool 2.4.6 on my Debian unstable machine in some
non-system directory. When I build GNU MPFR with CC=tcc LD=tcc, I
get things like:

  libtool: link: tcc -O2 -o tzeta_ui tzeta_ui.o  -L../src/.libs ./.libs/libfrtests.a -lm ../src/.libs/libmpfr.so -lgmp

The problem is that the MPFR library used at run time is not
../src/.libs/libmpfr.so but the one installed on the system.

When I use libtool 2.4.2 with the following patch:

--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -4375,6 +4375,14 @@
        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
        ;;
+      tcc*)
+       # Fabrice Bellard et al's Tiny C Compiler
+       # When it learns to make shared objects, it will
+       # presumably use -fPIC.
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+       ;;
       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
        # which looks to be a dead project)

I get:

  libtool: link: tcc -O2 -o tzeta_ui tzeta_ui.o  -L../src/.libs ./.libs/libfrtests.a -lm ../src/.libs/libmpfr.a -lgmp

(libmpfr.a instead of libmpfr.so) and the problem doesn't occur.

So, either libtool should select libmpfr.a as before or it should
make sure that the correct full path to libmpfr.so be used (something
like run path setting?).

-- 
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




Information forwarded to bug-libtool <at> gnu.org:
bug#20622; Package libtool. (Thu, 21 May 2015 16:55:03 GMT) Full text and rfc822 format available.

Message #8 received at 20622 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Lefevre <vincent <at> vinc17.net>
To: 20622 <at> debbugs.gnu.org
Subject: Re: libtool 2.4.6: incorrect linking with tcc under GNU/Linux
Date: Thu, 21 May 2015 18:53:57 +0200
In libtool.m4,

      tcc*)
        # Fabrice Bellard et al's Tiny C Compiler
        _LT_TAGVAR(ld_shlibs, $1)=yes

if I replace "yes" by "no", libmpfr.a is used and the problem
disappears.

-- 
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




Information forwarded to bug-libtool <at> gnu.org:
bug#20622; Package libtool. (Fri, 22 May 2015 09:31:02 GMT) Full text and rfc822 format available.

Message #11 received at 20622 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Lefevre <vincent <at> vinc17.net>
To: 20622 <at> debbugs.gnu.org
Subject: Re: libtool 2.4.6: incorrect linking with tcc under GNU/Linux
Date: Fri, 22 May 2015 11:30:21 +0200
On 2015-05-21 18:53:57 +0200, Vincent Lefevre wrote:
> In libtool.m4,
> 
>       tcc*)
>         # Fabrice Bellard et al's Tiny C Compiler
>         _LT_TAGVAR(ld_shlibs, $1)=yes
> 
> if I replace "yes" by "no", libmpfr.a is used and the problem
> disappears.

Or better, using a run path like with gcc fixes the problem. I've
just sent a patch to libtool-patches. I'm not quite sure whether
both instances of

  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'

are necessary (but this seems to be done for other compilers).

-- 
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




Information forwarded to bug-libtool <at> gnu.org:
bug#20622; Package libtool. (Mon, 08 Feb 2016 13:11:01 GMT) Full text and rfc822 format available.

Message #14 received at 20622 <at> debbugs.gnu.org (full text, mbox):

From: Vincent Lefevre <vincent <at> vinc17.net>
To: 20622 <at> debbugs.gnu.org
Subject: Re: libtool 2.4.6: incorrect linking with tcc under GNU/Linux
Date: Mon, 8 Feb 2016 14:10:10 +0100
On 2015-05-22 11:30:21 +0200, Vincent Lefevre wrote:
> Or better, using a run path like with gcc fixes the problem. I've
> just sent a patch to libtool-patches. I'm not quite sure whether
> both instances of
> 
>   _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
> 
> are necessary (but this seems to be done for other compilers).

Here's the URL of my patch:

https://lists.gnu.org/archive/html/libtool-patches/2015-05/msg00000.html

-- 
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




This bug report was last modified 8 years and 92 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.