Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Feb 2011 19:17:10 -0800
From:      Charlie Kester <corky1951@comcast.net>
To:        freebsd-python@freebsd.org
Subject:   Re: py-numpy build failure, multiple definition of `__i686.get_pc_thunk.bx'
Message-ID:  <20110205031710.GG80820@comcast.net>
In-Reply-To: <20110204212219.GE80820@comcast.net>
References:  <20110204051500.GA80820@comcast.net> <20110204100544.GL78089@deviant.kiev.zoral.com.ua> <20110204185512.GB80820@comcast.net> <20110204195400.GP78089@deviant.kiev.zoral.com.ua> <20110204212219.GE80820@comcast.net>

index | next in thread | previous in thread | raw e-mail

On Fri 04 Feb 2011 at 13:22:19 PST Charlie Kester wrote:
>On Fri 04 Feb 2011 at 11:54:00 PST Kostik Belousov wrote:
>>On Fri, Feb 04, 2011 at 10:55:12AM -0800, Charlie Kester wrote:
>>>On Fri 04 Feb 2011 at 02:05:44 PST Kostik Belousov wrote:
>>>
>>> >Can you show the actual invocation of the compiler driver for linking ?
>>>
>>>Isn't that the line right before the first report of the error?
>>>
>>>cc -shared -pthread -mtune=generic -msse -msse2 -msse3 -mfpmath=sse -O2 
>>>-fno-strict-aliasing -pipe -Wl,-rpath=/usr/local/lib/gcc45 
>>>build/temp.freebsd-8.2-PRERELEASE-i386-2.7/build/src.freebsd-8.2-PRERELEASE-i386-2.7/numpy/core/src/_sortmodule.o -Lbuild/temp.freebsd-8.2-PRERELEASE-i386-2.7 -lm -o build/lib.freebsd-8.2-PRERELEASE-i386-2.7/numpy/core/_sort.so
>>>
>>I wanted the confirmation of exact command that failed. If your
>>citation above is right, then port _does not_ use gcc45 to do linkage
>>of the module. Generally, crtbegin/crtend.o come from the compiler
>>installation, so I am suspicious at least to report of use of
>>/usr/lib/crtbegin.So.
>>
>>Can you enter the port build directory and execute the same command
>>manually, substituting "cc" with full path to gcc45 ?
>
>Done.  Replacing "cc" with "gcc45" built the library without any error.
>(I didn't need to specify the full path to gcc45.)
>
>So the question is, why is cc being invoked in the first place?  As far
>as I know, I'm not doing anything to force using it.  Something seems
>to have gone wrong during py-numpy's configtests...

After some sleuthing I tried:

# make LDSHARED="gcc45 -shared" install

This seems to have worked.  The build and install now succeeds without
complaint. Hooray!

So where did the "cc" come from?

/usr/local/lib/python2.7/distutils/unixccompiler.py has the following line:

'linker_so'    : ["cc", "-shared"]

The base class defined in ccompiler.py sets linker_so to ${LDSHARED} if
that environment variable is defined, and that assignment seems to be
inherited all the way down into the numpy scripts.  Otherwise, we get
the value defined in unixccompiler.py.


home | help

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