Bug#696519: llvm-gcc-4.6: undefined reference to signbit when using boost's sign function
Ben Goodrich
bg2382 at columbia.edu
Thu Dec 27 19:32:43 UTC 2012
Quoting Sylvestre Ledru <sylvestre at debian.org>:
> Hello,
>
> On 22/12/2012 09:04, Ben Goodrich wrote:
>> Package: llvm-gcc-4.6
>> Version: 3.2-1~exp1
>> Severity: normal
>>
>> When attempting to compile a file that utilizes boost's sign function,
>> such as
>>
> Did you try with gcc 4.7 ?
Yes, the behavior is essentially the same with llvm-g++-4.7:
goodrich at CYBERPOWERPC:/tmp$ cat sign.cpp
#include <boost/math/special_functions/sign.hpp>
#include <iostream>
int main() {
std::cout << "expect 1, get " << boost::math::sign(10.0) << std::endl;
std::cout << "expect 0, get " << boost::math::sign(0.0) << std::endl;
std::cout << "expect -1, get " << boost::math::sign(-5.0) << std::endl;
std::cout << "do not know what to expect " << boost::math::sign(0.0
/ 0.0) << std::endl;
return 0;
}
goodrich at CYBERPOWERPC:/tmp$ llvm-g++-4.7 -v sign.cpp
Using built-in specs.
COLLECT_GCC=g++-4.7
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian
4.7.2-15' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-gnu-unique-object --enable-plugin --enable-objc-gc
--enable-multiarch --with-arch-32=i586 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-15)
COLLECT_GCC_OPTIONS='-fplugin=/usr/lib/gcc/x86_64-linux-gnu/4.7/plugin/dragonegg.so' '-v' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.7/cc1plus -quiet -v -imultilib .
-imultiarch x86_64-linux-gnu
-iplugindir=/usr/lib/gcc/x86_64-linux-gnu/4.7/plugin -D_GNU_SOURCE
sign.cpp -iplugindir=/usr/lib/gcc/x86_64-linux-gnu/4.7/plugin -quiet
-dumpbase sign.cpp -mtune=generic -march=x86-64 -auxbase sign -version
-fplugin=/usr/lib/gcc/x86_64-linux-gnu/4.7/plugin/dragonegg.so -o
/tmp/ccN9Fa5I.s
GNU C++ (Debian 4.7.2-15) version 4.7.2 (x86_64-linux-gnu)
compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR
version 3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Versions of loaded plugins:
dragonegg: 3.2
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/4.7"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/4.7
/usr/include/x86_64-linux-gnu/c++/4.7/.
/usr/include/c++/4.7/backward
/usr/lib/gcc/x86_64-linux-gnu/4.7/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
GNU C++ (Debian 4.7.2-15) version 4.7.2 (x86_64-linux-gnu)
compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR
version 3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Versions of loaded plugins:
dragonegg: 3.2
Compiler executable checksum: 851519e7af57e4424f649c87aa6fe655
COLLECT_GCC_OPTIONS='-fplugin=/usr/lib/gcc/x86_64-linux-gnu/4.7/plugin/dragonegg.so' '-v' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
as -v --64 -o /tmp/ccg12jab.o /tmp/ccN9Fa5I.s
GNU assembler version 2.22 (x86_64-linux-gnu) using BFD version (GNU
Binutils for Debian) 2.22
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.7/:/usr/lib/gcc/x86_64-linux-gnu/4.7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.7/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.7/:/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-fplugin=/usr/lib/gcc/x86_64-linux-gnu/4.7/plugin/dragonegg.so' '-v' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.7/collect2 --sysroot=/ --build-id
--eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker
/lib64/ld-linux-x86-64.so.2
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.7/crtbegin.o
-L/usr/lib/gcc/x86_64-linux-gnu/4.7
-L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib
-L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../..
/tmp/ccg12jab.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/lib/gcc/x86_64-linux-gnu/4.7/crtend.o
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crtn.o
/tmp/ccg12jab.o: In function
`__gnu_cxx::__enable_if<std::__is_arithmetic<double>::__value,
int>::__type std::signbit<double>(double)':
sign.cpp:(.text._ZSt7signbitIdEN9__gnu_cxx11__enable_ifIXsrSt15__is_arithmeticIT_E7__valueEiE6__typeES3_[_ZSt7signbitIdEN9__gnu_cxx11__enable_ifIXsrSt15__is_arithmeticIT_E7__valueEiE6__typeES3_]+0x1d): undefined reference to
`signbit'
collect2: error: ld returned 1 exit status
Thank you.
More information about the Pkg-llvm-team
mailing list