Bug#962533: mlpack FTBFS on mips64el: relocation truncated to fit

2020-06-28 Thread Barak A. Pearlmutter
How about switching to clang; would there be any objections to that?
If a mips porter could rip all the space save and --parallel=1 stuff
out of debian/rules and build with

fakeroot debian/rules CXX=clang++-9 CC=clang-9 build

and if it works I think just switching would make sense.



Bug#962533: mlpack FTBFS on mips64el: relocation truncated to fit

2020-06-12 Thread Adrian Bunk
On Fri, Jun 12, 2020 at 05:56:39AM +0800, YunQiang Su wrote:
> Adrian Bunk  于 2020年6月9日周二 下午11:18写道:
>...
> just add -mxgot to cxxflags.
> there are 2 type of GOT in mips: one use fewer insn while has a length
> limitaion; another uses more insns while has a big address space support.
>...

That's what I tried:

> > I tried "export DEB_CXXFLAGS_MAINT_APPEND += -mxgot" which gave me:
> >
> > ...
> > /usr/bin/c++  -g -O2 -fdebug-prefix-map=/home/bunk/build/mlpack-3.3.1=.
> > -fstack-protector-strong -Wformat -Werror=format-security -mxgot
> > -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wextra -ftemplate-depth=1000
> > -Wno-unused-function -O3 -fopenmp  -Wl,-z,relro -Wl,-z,now -rdynamic
> > CMakeFiles/mlpack_cf.dir/cf_main.cpp.o  -o ../../../../bin/mlpack_cf
> > -Wl,-rpath,/home/bunk/build/mlpack-3.3.1/obj-mips64el-linux-gnuabi64/lib:
> > ../../../../lib/libmlpack.so.3.3 /usr/lib/libarmadillo.so
> > /usr/lib/mips64el-linux-gnuabi64/libboost_program_options.so
> > /usr/lib/mips64el-linux-gnuabi64/libboost_unit_test_framework.so
> > /usr/lib/mips64el-linux-gnuabi64/libboost_serialization.so -lpthread
> > CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function
> > `std::mersenne_twister_engine > 13043109905998158313ul, 29ul, 6148914691236517205ul, 17ul,
> > 8202884508482404352ul, 37ul, 1873444759240704ul, 43ul,
> > 6364136223846793005ul>::seed(unsigned long)':
> > /usr/include/c++/9/bits/random.tcc:329:(.text._ZN6mlpack4math10RandomSeedEm[_ZN6mlpack4math10RandomSeedEm]+0xb8):
> > relocation truncated to fit: R_MIPS_TLS_GOTTPREL against
> > `arma::arma_rng_cxx11_instance'
> > CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function
> > `std::mersenne_twister_engine > 13043109905998158313ul, 29ul, 6148914691236517205ul, 17ul,
> > 8202884508482404352ul, 37ul, 1873444759240704ul, 43ul,
> > 6364136223846793005ul>::operator()()':
> > /usr/include/c++/9/bits/random.tcc:458:(.text._ZN4arma8arma_rng5randuIdE4fillEPdy[_ZN4arma8arma_rng5randuIdE4fillEPdy]+0x70):
> > relocation truncated to fit: R_MIPS_TLS_GOTTPREL against
> > `arma::arma_rng_cxx11_instance'
> > /usr/include/c++/9/bits/random.tcc:457:(.text._ZN4arma8arma_rng5randuIdE4fillEPdy[_ZN4arma8arma_rng5randuIdE4fillEPdy]+0x354):
> > relocation truncated to fit: R_MIPS_TLS_GOTTPREL against
> > `arma::arma_rng_cxx11_instance'
> > collect2: error: ld returned 1 exit status
> >
> >
> > debian-mips is Cc'ed, can a mips porter please have a look?

What are these R_MIPS_TLS_GOTTPREL relocations?

cu
Adrian



Bug#962533: mlpack FTBFS on mips64el: relocation truncated to fit

2020-06-11 Thread YunQiang Su
Adrian Bunk  于 2020年6月9日周二 下午11:18写道:

> Source: mlpack
> Version: 3.3.1-1
> Severity: serious
> Tags: ftbfs
>
> It seems Boost 1.67 -> 1.71 increased something:
>
>
> https://buildd.debian.org/status/fetch.php?pkg=mlpack=mips64el=3.3.1-1%2Bb1=1591444281=0
>
> ...
> /usr/bin/c++  -g -O2 -fdebug-prefix-map=/<>=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -Wall -Wextra -ftemplate-depth=1000
> -Wno-unused-function -O3 -fopenmp  -Wl,-z,relro -Wl,-z,now -rdynamic
> CMakeFiles/mlpack_cf.dir/cf_main.cpp.o  -o ../../../../bin/mlpack_cf
> -Wl,-rpath,/<>/obj-mips64el-linux-gnuabi64/lib:
> ../../../../lib/libmlpack.so.3.3 /usr/lib/libarmadillo.so
> /usr/lib/mips64el-linux-gnuabi64/libboost_program_options.so
> /usr/lib/mips64el-linux-gnuabi64/libboost_unit_test_framework.so
> /usr/lib/mips64el-linux-gnuabi64/libboost_serialization.so -lpthread
> CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function
> `std::basic_ostream >& std::operator<<  std::char_traits, std::allocator >(std::basic_ostream std::char_traits >&, std::__cxx11::basic_string std::char_traits, std::allocator > const&)':
> /usr/include/c++/9/bits/basic_string.h:6421:(.text+0x300): relocation
> truncated to fit: R_MIPS_CALL16 against `std::basic_ostream std::char_traits >& std::__ostream_insert std::char_traits >(std::basic_ostream
> >&, char const*, long)@@GLIBCXX_3.4.9'
> CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function `void
> std::__cxx11::basic_string,
> std::allocator >::_M_construct(char*, char*,
> std::forward_iterator_tag)':
> /usr/include/c++/9/bits/basic_string.tcc:219:(.text+0x760): relocation
> truncated to fit: R_MIPS_CALL16 against `std::__cxx11::basic_string std::char_traits, std::allocator >::_M_create(unsigned long&,
> unsigned long)@@GLIBCXX_3.4.21'
> /usr/include/c++/9/bits/basic_string.tcc:233:(.text+0x7c0): relocation
> truncated to fit: R_MIPS_CALL16 against `__stack_chk_fail@@GLIBC_2.4'
> /usr/include/c++/9/bits/basic_string.tcc:212:(.text+0x7d0): relocation
> truncated to fit: R_MIPS_CALL16 against `std::__throw_logic_error(char
> const*)@@GLIBCXX_3.4'
> CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function
> `__gnu_cxx::new_allocator std::char_traits, std::allocator > >::allocate(unsigned long,
> void const*)':
> /usr/include/c++/9/ext/new_allocator.h:114:(.text+0xb34): relocation
> truncated to fit: R_MIPS_CALL16 against `operator new(unsigned
> long)@@GLIBCXX_3.4'
> CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function
> `std::vector,
> std::allocator >, std::allocator std::char_traits, std::allocator > >
> >::_S_check_init_len(unsigned long,
> std::allocator,
> std::allocator > > const&)':
> /usr/include/c++/9/bits/stl_vector.h:1767:(.text+0xbc4): relocation
> truncated to fit: R_MIPS_CALL16 against `std::__throw_length_error(char
> const*)@@GLIBCXX_3.4'
> CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function
> `std::__cxx11::basic_string,
> std::allocator >*
> std::__uninitialized_copy::__uninit_copy std::char_traits, std::allocator > const*,
> std::__cxx11::basic_string,
> std::allocator >*>(std::__cxx11::basic_string std::char_traits, std::allocator > const*,
> std::__cxx11::basic_string,
> std::allocator > const*, std::__cxx11::basic_string std::char_traits, std::allocator >*)':
> /usr/include/c++/9/bits/stl_uninitialized.h:86:(.text+0xbd0): relocation
> truncated to fit: R_MIPS_CALL16 against `__cxa_begin_catch@@CXXABI_1.3'
> CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function `void
> std::_Destroy_aux::__destroy std::char_traits, std::allocator
> >*>(std::__cxx11::basic_string,
> std::allocator >*, std::__cxx11::basic_string std::char_traits, std::allocator >*)':
> /usr/include/c++/9/bits/stl_construct.h:107:(.text+0xbe0): relocation
> truncated to fit: R_MIPS_CALL16 against `__cxa_rethrow@@CXXABI_1.3'
> CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function
> `std::_Vector_base,
> std::allocator >, std::allocator std::char_traits, std::allocator > >
> >::_M_deallocate(std::__cxx11::basic_string,
> std::allocator >*, unsigned long)':
> /usr/include/c++/9/bits/stl_vector.h:350:(.text+0xbf8): relocation
> truncated to fit: R_MIPS_CALL16 against `operator
> delete(void*)@@GLIBCXX_3.4'
> CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function
> `__gnu_cxx::new_allocator std::char_traits, std::allocator > >::~new_allocator()':
> /usr/include/c++/9/ext/new_allocator.h:89:(.text+0xc04): relocation
> truncated to fit: R_MIPS_CALL16 against `_Unwind_Resume@@GCC_3.0'
> CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function
> `std::__cxx11::basic_string,
> std::allocator >::_M_dispose()':
> /usr/include/c++/9/bits/basic_string.h:231:(.text+0xc1c): additional
> relocation overflows omitted from the output
>

just add -mxgot to cxxflags.
there are 2 type of GOT in mips: one use fewer insn while has a length
limitaion; another uses more insns while has a big address space support.

collect2: error: ld returned 1 exit status
> make[4]: ***
> 

Bug#962533: mlpack FTBFS on mips64el: relocation truncated to fit

2020-06-09 Thread Adrian Bunk
Source: mlpack
Version: 3.3.1-1
Severity: serious
Tags: ftbfs

It seems Boost 1.67 -> 1.71 increased something:

https://buildd.debian.org/status/fetch.php?pkg=mlpack=mips64el=3.3.1-1%2Bb1=1591444281=0

...
/usr/bin/c++  -g -O2 -fdebug-prefix-map=/<>=. 
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
-D_FORTIFY_SOURCE=2 -Wall -Wextra -ftemplate-depth=1000 -Wno-unused-function 
-O3 -fopenmp  -Wl,-z,relro -Wl,-z,now -rdynamic 
CMakeFiles/mlpack_cf.dir/cf_main.cpp.o  -o ../../../../bin/mlpack_cf  
-Wl,-rpath,/<>/obj-mips64el-linux-gnuabi64/lib: 
../../../../lib/libmlpack.so.3.3 /usr/lib/libarmadillo.so 
/usr/lib/mips64el-linux-gnuabi64/libboost_program_options.so 
/usr/lib/mips64el-linux-gnuabi64/libboost_unit_test_framework.so 
/usr/lib/mips64el-linux-gnuabi64/libboost_serialization.so -lpthread
CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function `std::basic_ostream >& std::operator<< , 
std::allocator >(std::basic_ostream >&, 
std::__cxx11::basic_string, std::allocator > 
const&)':
/usr/include/c++/9/bits/basic_string.h:6421:(.text+0x300): relocation truncated 
to fit: R_MIPS_CALL16 against `std::basic_ostream 
>& std::__ostream_insert 
>(std::basic_ostream >&, char const*, 
long)@@GLIBCXX_3.4.9'
CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function `void 
std::__cxx11::basic_string, std::allocator 
>::_M_construct(char*, char*, std::forward_iterator_tag)':
/usr/include/c++/9/bits/basic_string.tcc:219:(.text+0x760): relocation 
truncated to fit: R_MIPS_CALL16 against `std::__cxx11::basic_string, std::allocator >::_M_create(unsigned long&, 
unsigned long)@@GLIBCXX_3.4.21'
/usr/include/c++/9/bits/basic_string.tcc:233:(.text+0x7c0): relocation 
truncated to fit: R_MIPS_CALL16 against `__stack_chk_fail@@GLIBC_2.4'
/usr/include/c++/9/bits/basic_string.tcc:212:(.text+0x7d0): relocation 
truncated to fit: R_MIPS_CALL16 against `std::__throw_logic_error(char 
const*)@@GLIBCXX_3.4'
CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function 
`__gnu_cxx::new_allocator, std::allocator > >::allocate(unsigned long, void 
const*)':
/usr/include/c++/9/ext/new_allocator.h:114:(.text+0xb34): relocation truncated 
to fit: R_MIPS_CALL16 against `operator new(unsigned long)@@GLIBCXX_3.4'
CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function 
`std::vector, 
std::allocator >, std::allocator, std::allocator > > >::_S_check_init_len(unsigned 
long, std::allocator, 
std::allocator > > const&)':
/usr/include/c++/9/bits/stl_vector.h:1767:(.text+0xbc4): relocation truncated 
to fit: R_MIPS_CALL16 against `std::__throw_length_error(char 
const*)@@GLIBCXX_3.4'
CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function 
`std::__cxx11::basic_string, std::allocator 
>* 
std::__uninitialized_copy::__uninit_copy, std::allocator > const*, 
std::__cxx11::basic_string, std::allocator 
>*>(std::__cxx11::basic_string, 
std::allocator > const*, std::__cxx11::basic_string, std::allocator > const*, 
std::__cxx11::basic_string, std::allocator 
>*)':
/usr/include/c++/9/bits/stl_uninitialized.h:86:(.text+0xbd0): relocation 
truncated to fit: R_MIPS_CALL16 against `__cxa_begin_catch@@CXXABI_1.3'
CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function `void 
std::_Destroy_aux::__destroy, std::allocator 
>*>(std::__cxx11::basic_string, 
std::allocator >*, std::__cxx11::basic_string, std::allocator >*)':
/usr/include/c++/9/bits/stl_construct.h:107:(.text+0xbe0): relocation truncated 
to fit: R_MIPS_CALL16 against `__cxa_rethrow@@CXXABI_1.3'
CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function 
`std::_Vector_base, 
std::allocator >, std::allocator, std::allocator > > 
>::_M_deallocate(std::__cxx11::basic_string, 
std::allocator >*, unsigned long)':
/usr/include/c++/9/bits/stl_vector.h:350:(.text+0xbf8): relocation truncated to 
fit: R_MIPS_CALL16 against `operator delete(void*)@@GLIBCXX_3.4'
CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function 
`__gnu_cxx::new_allocator, std::allocator > >::~new_allocator()':
/usr/include/c++/9/ext/new_allocator.h:89:(.text+0xc04): relocation truncated 
to fit: R_MIPS_CALL16 against `_Unwind_Resume@@GCC_3.0'
CMakeFiles/mlpack_cf.dir/cf_main.cpp.o: in function 
`std::__cxx11::basic_string, std::allocator 
>::_M_dispose()':
/usr/include/c++/9/bits/basic_string.h:231:(.text+0xc1c): additional relocation 
overflows omitted from the output
collect2: error: ld returned 1 exit status
make[4]: *** [src/mlpack/methods/cf/CMakeFiles/mlpack_cf.dir/build.make:92: 
bin/mlpack_cf] Error 1


I tried "export DEB_CXXFLAGS_MAINT_APPEND += -mxgot" which gave me:

...
/usr/bin/c++  -g -O2 -fdebug-prefix-map=/home/bunk/build/mlpack-3.3.1=. 
-fstack-protector-strong -Wformat -Werror=format-security -mxgot -Wdate-time 
-D_FORTIFY_SOURCE=2 -Wall -Wextra -ftemplate-depth=1000 -Wno-unused-function 
-O3 -fopenmp  -Wl,-z,relro -Wl,-z,now -rdynamic 
CMakeFiles/mlpack_cf.dir/cf_main.cpp.o  -o ../../../../bin/mlpack_cf  
-Wl,-rpath,/home/bunk/build/mlpack-3.3.1/obj-mips64el-linux-gnuabi64/lib: 
../../../../lib/libmlpack.so.3.3 /usr/lib/libarmadillo.so