CVS build error with new sort
Thomas Treichl
Thomas.Treichl at gmx.net
Mon Feb 4 13:47:01 CST 2008
John Swensen schrieb:
> The symbol demangles to
> octave_sort<int>::set_compare(bool (*)(int, int))
>
> John Swensen
>
> On Feb 4, 2008, at 2:55 AM, John W. Eaton wrote:
>
>> On 3-Feb-2008, John Swensen wrote:
>>
>> | I am trying to build the most recent CVS (as of 2008/02/03 about 8PM)
>> | and am having a linker error involving the new sort stuff for sparse
>> | matrices. When trying to link liboctave.dylib, I get the following
>> | error:
>> | ld: duplicate symbol __ZN11octave_sortIiE11set_compareEPFbiiE in pic/
>> | Array-i.o and pic/sparse-sort.o
>>
>> I don't know why this is happening. I don't see this problem, but I'm
>> not using OS X.
>>
>> Demangling the above symbol name doesn't work for me. What is the
>> result of
>>
>> echo __ZN11octave_sortIiE11set_compareEPFbiiE | c++filt
>>
>> on your system?
>>
>> jwe
I got through the compilation process with the latest CVS sources by adding
"-Xlinker -m" to my LDFLAGS -- without these flags it still fails, so it seems
to me that the compiler is out of 'sort'-names?!
I may borrow the necessary description from the 'ld' manpage:
<somewhere in the manpage>
When creating an output file with the static link editor when
-twolevel_namespace is in effect (now the default) all undefined refer-
ences must be satisfied at static link time.
<somewhere else in the manpage>
-m (32-bit only)
Don't treat multiply defined symbols from the linked objects as
a hard error; instead, simply print a warning. The first linked
object defining such a symbol is used for linking; its value is
used for the symbol in the symbol table. The code and data for
all such symbols are copied into the output. The duplicate sym-
bols other than the first symbol may still end up being used in
the resulting output file through local references. This can
still produce a resulting output file that is in error. This
flag's use is strongly discouraged!
After that 'make check' tells me
PASS 3989
FAIL 0
so I hope tests are already included for the new 'sort'-modifications?
I don't know if this is the right way for fixing this problem and if there are
other flags available instead. I found other projects at the Internet that tell
us about similar 'multiply defined whatever' problems on Mac and I need to have
a look how they solved that problem and then will be back to this thread in a
few days hopefully with a better solution.
Thomas
PS. John if you are faster than me finding better flags on your Mac then please
let me know.
More information about the Octave-maintainers
mailing list