Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Feb 2011 22:42:36 -0600
From:      Stephen Montgomery-Smith <stephen@missouri.edu>
To:        "bf1783@gmail.com" <bf1783@gmail.com>
Cc:        "freebsd-ports@FreeBSD.org" <freebsd-ports@freebsd.org>, "gerald@FreeBSD.org" <gerald@freebsd.org>, "b. f." <bf1783@googlemail.com>, Ade Lovett <ade@freebsd.org>
Subject:   Re: multiple definition of `__i686.get_pc_thunk.bx'
Message-ID:  <4D6C793C.7070803@missouri.edu>
In-Reply-To: <4D6BB565.3050006@missouri.edu>
References:  <AANLkTi=x1m%2BgJ5cRJDbCSHXRFEbr-EHC8VwrfMrNsAZj@mail.gmail.com> <4D6BB565.3050006@missouri.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------080206010302070907050404
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Stephen Montgomery-Smith wrote:
> b. f. wrote:
>>>> On Sun 27 Feb 2011 at 12:24:06 PST Stephen Montgomery-Smith wrote:
>>>>> I am the maintainer of the port vis5d+.  I just got this email (copied below) saying that vis5d+ isn't building right now.
>>>>>
>>>>> The issue seems to be that some reference to __i686.get_pc_thunk.bx is included twice at some point.  This variable seems to be part of an object file crtbeginS.o that is created by gcc or gcc45, in what seem to me to be very mysterious conditions.  I am rather sure that the issue has nothing to do with vis5d+, but rather is something to do with either gcc45, or libtools, neither of which I understand.
>>>>>
>>>>> Does anyone out there have any idea of what the problem is, or how it can be solved?
>>>>>
>>>
>>>    From a relatively cursory examination, this appears to be a flaw in the USE_FORTRAN=yes stanza.  This will bring in gcc45 as a dependency but doesn't appear to be setting CXX to g++45 though it does do CC=gcc45.  Possibly the same for LD, though I haven't checked that.
>>
>> As is clear from bsd.gcc.mk, in almost every case now in use,
>> USE_FORTRAN sets _USE_GCC, which sets CC, CPP, and CXX to the proper
>> values.  Also, it sets USE_BINUTILS where appropriate, which sets LD,
>> etc.  The problem is rather with libtool, particularly in the link
>> mode, where it may not respect the choice of compiler and toolchain.
>> This problem has been remarked, for two years or more, in the mailing
>> lists and forums, when people discuss the use of compilers other than
>> the base system compiler.  With the recent updates, it is more
>> obtrusive, and several ports that were building successfully with
>> default settings are now broken.  This needs to be fixed, and it would
>> be better to fix libtool than to add a bunch of ad-hoc fixes to
>> individual ports.
>>
>> b.
>
> I agree.  libtool is the real culprit.  When you run it as
>
> libtool -mode=link g++45 stuff and stuff
>
> libtool uses c++ instead of g++45.

OK, this problem was more subtle than I originally thought.  The error I 
pointed out doesn't occur consistently, but it does occur in the context 
of building vis5d+.

But I have a patch that definitely fixes libtool enough for me.  What do 
you guys think?  This perhaps doesn't fix all the problems, but maybe it 
can act as a model to fix them all.


--------------080206010302070907050404
Content-Type: text/plain;
 name="patch-configure"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="patch-configure"

--- configure.bak	2010-09-22 14:44:17.000000000 +0000
+++ configure	2011-03-01 04:23:35.000000000 +0000
@@ -27526,7 +27526,9 @@
 old_archive_cmds=$lt_old_archive_cmds
 
 # A language specific compiler.
-CC=$lt_compiler
+if test -z "\$CC"; then \\
+  CC=$lt_compiler
+fi
 
 # Is the compiler the GNU compiler?
 with_gcc=$GCC
@@ -27872,7 +27874,11 @@
 old_archive_cmds=$lt_old_archive_cmds_CXX
 
 # A language specific compiler.
-CC=$lt_compiler_CXX
+if test -z "\$CXX"; then \\
+  CC=$lt_compiler_CXX
+else
+  CC=\$CXX
+fi
 
 # Is the compiler the GNU compiler?
 with_gcc=$GCC_CXX

--------------080206010302070907050404--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D6C793C.7070803>