LINUX.ORG.RU

Кросскомпиляция Rasterbar libtorrent под MIPS


0

1

Всем привет!

Нужно разобраться с приставкой STB и добавить в её прошивку торрент-клиент. Производитель приставки дал SDK, скрипты для сборки прошивки и документацию. Всё распаковал как описано, запустил скрипты, задались переменные окружения, прошивка собирается правильно. Чтобы скомпилировать libtorrent нужно сперва скомпилировать boost. Но есть проблема - я никогда не занимался сборкой под линукс, а тем более кросскомпиляцией. Почитал в сети много всего про кросскомпиляцию и Boost я собираю так - в файл user-config.jam добавил строку

using gcc : mips : /opt/eldk-4.0/usr/bin/mips-linux-gcc ;
, выполнил
./bootstrap.sh 
- получил два файла b2 и bjam, следую инструкциям из сети далее и делаю так:
./bjam --toolset=gcc-mips
- и вроде boost собирается. В папке stage/lib появляются библиотеки boost, делаю
root@PC-CODER:~/boost_1_47_0/stage/lib# file libboost_system.so.1.47.0
libboost_system.so.1.47.0: ELF 32-bit LSB shared object, MIPS, MIPS32 version 1 (SYSV), dynamically linked, not stripped
Вроде правильно собрались, под MIPS, делаю
export BOOST_ROOT=/home/user/STB/boost_1_47_0
Теперь можно собирать libtorrent, делаю
./configure --host=mips-linux
- бегут строчки, пока не дойдут до:
...
Checking for boost libraries:
checking for boostlib >= 1.36... configure: We will use a staged boost library from /home/user/STB/boost_1_47_0
yes
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system... no
checking for exit in -lboost_system... (cached) no
checking for exit in -lboost_system... (cached) no
configure: error: Could not link against boost_system !
Вот тут я засел, ничего не могу сделать, не хватает знаний - подскажите, может я что не правильно делаю и направьте на пусть истинный!

Спасибо.



Последнее исправление: Nova (всего исправлений: 5)

Т.е. буст здесь: /home/user/???/Загрузки/STB/Boost/boost_1_47_0

а экспорт из /home/user/STB/boost_1_47_0 ?

Было у меня такое под debian. Вылечилось доустановкой пакетов.

gag ★★★★★
()
Ответ на: комментарий от gag

Нет, это я описался. Все пути правильные, в системе буст не стоит, и если путь был бы не правильный ./configure ругнулся бы на ненайденный буст, а он его находит.

Nova
() автор топика
Ответ на: комментарий от slovazap

Сам config.log весит 45Кб, положил его сюда http://rghost.ru/17552951

configure:16173: We will use a staged boost library from /home/user/STB/boost_1_47_0
configure:16212: mips-linux-g++ -c -g -O2   -I/home/user/STB/boost_1_47_0 conftest.cpp >&5
configure:16212: $? = 0
configure:16214: result: yes
configure:16283: checking whether the Boost::System library is available
configure:16307: mips-linux-g++ -c -g -O2  -I/home/user/STB/boost_1_47_0 conftest.cpp >&5
conftest.cpp: In function 'int main()':
conftest.cpp:30: warning: statement is a reference, not call, to function 'boost::system::system_category'
configure:16307: $? = 0
configure:16322: result: yes
configure:16337: checking for exit in -lboost_system
configure:16362: mips-linux-gcc -o conftest -lpthread -g -O2  -I/home/user/STB/boost_1_47_0  -L/home/user/STB/boost_1_47_0/stage/lib conftest.c -lboost_system  -lpthread   >&5
conftest.c:33: warning: conflicting types for built-in function 'exit'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `operator delete(void*)'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `__gxx_personality_v0'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `__cxa_pure_virtual'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `vtable for __cxxabiv1::__class_type_info'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `__cxa_guard_release'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `__cxa_guard_abort'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)'
/home/user/STB/boost_1_47_0/stage/lib/libboost_system.so: undefined reference to `__cxa_guard_acquire'
collect2: ld returned 1 exit status
configure:16362: $? = 1
Nova
() автор топика
Ответ на: комментарий от Nova

Это какая-то чушь в libtorrent'овском configure - сишный код зачем-то линкуется с плюсовой библиотекой на предмет проверки наличия в ней функции exit, которой там нет (она в стандартной библиотеке). Удалите эту проверку из configure нахрен.

slovazap ★★★★★
()
Ответ на: комментарий от Nova

Ну как, уже заработало? Если нет, то, вспоминая о моём упоминании о доп. пакетах, скажите, а что именно из буста вы собрали? Там же у него есть ядро, а есть и доп. библиотеки. По своему опыту повторюсь, libtorrent'у, наверняка, просто нужны доп. библиотеки буста (на странице клиента в зависимостях они должны быть указаны или установите тот же клиент в своём дистрибутиве и посмотрите, что из буста он потянул).

gag ★★★★★
()
Ответ на: комментарий от gag

Пока еще не заработало.

Если нет, то, вспоминая о моём упоминании о доп. пакетах, скажите, а что именно из буста вы собрали?

Делал всё по инструкции с сайта буста http://www.boost.org/boost-build2/doc/html/bbv2/tasks/crosscompile.html Думаю, что должен собраться весь буст, хотя теперь уже не уверен. А вообще для libtorrent из буста нужен ASIO.

[qoute]установите тот же клиент в своём дистрибутиве и посмотрите, что из буста он потянул[/qoute] Это я могу сделать, только подскажите как именно посмотреть, что он потянул?

Nova
() автор топика
Ответ на: комментарий от Nova

Нет, пожалуй, собирая буст из исходников - там всё в одном.

Здесь стоит, что при использовании BOOST_ROOT при вызове bjam нужно добавить параметр:

bjam ... boost=source

И при указании toolset дефисы не нужны.

gag ★★★★★
()
Ответ на: комментарий от slovazap

Выглядит странно. Интересно зачем?.. Но тем не менее должно работать. Вот как выглядит на debian wheezy. Установлено только boost-dev boost-system-dev, поэтому ругается, что не находит остальные необходимые библиотеки буста.

./configure

...
Checking for boost libraries:
checking for boostlib >= 1.36... yes
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system-mt... yes
checking whether the Boost::Filesystem library is available... yes
configure: error: Could not link against boost_system-mt !

config.log

...
configure:16053: checking for boostlib >= 1.36
configure:16108: g++ -c -g -O2  -I/usr/include conftest.cpp >&5
configure:16108: $? = 0
configure:16110: result: yes
configure:16278: checking whether the Boost::System library is available
configure:16302: g++ -c -g -O2  -I/usr/include conftest.cpp >&5
configure:16302: $? = 0
configure:16317: result: yes
configure:16332: checking for exit in -lboost_system-mt
configure:16357: gcc -o conftest -lpthread -g -O2  -I/usr/include  -L/usr/lib conftest.c -lboost_system-mt  -lpthread   >&5
conftest.c:33:6: warning: conflicting types for built-in function 'exit' [enabled by default]
configure:16357: $? = 0
configure:16367: result: yes
configure:16523: checking whether the Boost::Filesystem library is available
configure:16547: g++ -c -g -O2  -I/usr/include conftest.cpp >&5
configure:16547: $? = 0
configure:16561: result: yes
configure:16715: error: Could not link against boost_system-mt !
...

gag ★★★★★
()

Кстати, вы для буста указываете:

/opt/eldk-4.0/usr/bin/mips-linux-gcc

А для libtorrent:

./configure --host=mips-linux

Откуда либторрент находит мипс? Судя по ошибкам линковки при сборке буста использовались одни стандартные библиотеки, а при сборке либторрента другие.

Либторрент:

mips-linux-gcc -o conftest -lpthread -g -O2  -I/home/user/STB/boost_1_47_0  -L/home/user/STB/boost_1_47_0/stage/lib conftest.c -lboost_system  -lpthread
Просто вызывается mips-linux-gcc. А как выглядит подобный вызов при сборке буста? Может, mips-linux-gcc передаются доп. параметры?

gag ★★★★★
()
Ответ на: комментарий от gag

Откуда либторрент находит мипс?

По инструкции перед сборкой прошивки надо выполнить команду

source ./setup.sh
Я так понимаю, она устанавливает переменные окружения и что-то там еще. Возможно оттуда?

Nova
() автор топика
Ответ на: комментарий от gag

Просто вызывается mips-linux-gcc. А как выглядит подобный вызов при сборке буста? Может, mips-linux-gcc передаются доп. параметры?

Вот такие строчки пробегают при сборке буста:

"/opt/eldk-4.0/usr/bin/mips-linux-gcc"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC  -DBOOST_ALL_NO_LIB=1 -DBOOST_IOSTREAMS_DYN_LINK=1 -DBOOST_IOSTREAMS_USE_DEPRECATED -DNDEBUG  -I"." -c -o "bin.v2/libs/iostreams/build/gcc-mips/release/threading-multi/mapped_file.o" "libs/iostreams/src/mapped_file.cpp"

Но гораздо чаще строчки выглядят примерно так:

gcc.compile.c++ bin.v2/libs/math/build/gcc-mips/release/threading-multi/asinhf.o

Nova
() автор топика
Ответ на: комментарий от Nova

Если этот setup.sh от поставщика, так, может, он и должен осуществлять поддержку? Или этот SDK доступен в инете?

gag ★★★★★
()
Ответ на: комментарий от Nova

Настраиваем так:

export BOOST_BUILD_PATH=/home/user/STB/boost_1_47_0
export BOOST_ROOT=/home/user/STB/boost_1_47_0
./bootstrap.sh --with-libraries=filesystem,system,thread

Правим файл:

/home/user/STB/boost_1_47_0/user-config.jam
и/или
/home/user/STB/boost_1_47_0/tools/build/v2/user-config.jam
заменяем gcc на g++:
using gcc : mips : mips-linux-g++ ;

Собираем:

root@debian:~/mips/boost_1_47_0# time b2 toolset=gcc-mips

Building the Boost C++ Libraries.



Component configuration:

    - chrono                   : not building
    - date_time                : not building
    - exception                : not building
    - filesystem               : building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - math                     : not building
    - mpi                      : not building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : not building
    - serialization            : not building
    - signals                  : not building
    - system                   : building
    - test                     : not building
    - thread                   : building
    - wave                     : not building

...patience...
...found 747 targets...
...updating 57 targets...
.......................<cut>............................
...updated 57 targets...


The Boost C++ Libraries were successfully built!
          
The following directory should be added to compiler include paths:
          
    /root/mips/boost_1_47_0
      
The following directory should be added to linker library paths:
      
    /root/mips/boost_1_47_0/stage/lib


real	0m28.119s
user	0m26.526s
sys	0m1.196s
root@debian:~/mips/boost_1_47_0# 

Ни одной ошибки быть не должно!

Вот, что имеем необходимого для libtorrent:

ls -l /root/mips/boost_1_47_0/stage/lib/
total 844
-rw-r--r-- 1 root root 295510 Aug 13 00:37 libboost_filesystem.a
lrwxrwxrwx 1 root root     29 Aug 13 00:37 libboost_filesystem.so -> libboost_filesystem.so.1.47.0
-rwxr-xr-x 1 root root 165317 Aug 13 00:37 libboost_filesystem.so.1.47.0
-rw-r--r-- 1 root root  17430 Aug 13 00:37 libboost_system.a
lrwxrwxrwx 1 root root     25 Aug 13 00:37 libboost_system.so -> libboost_system.so.1.47.0
-rwxr-xr-x 1 root root  16064 Aug 13 00:37 libboost_system.so.1.47.0
-rw-r--r-- 1 root root 192604 Aug 13 00:37 libboost_thread.a
lrwxrwxrwx 1 root root     25 Aug 13 00:37 libboost_thread.so -> libboost_thread.so.1.47.0
-rwxr-xr-x 1 root root 144901 Aug 13 00:37 libboost_thread.so.1.47.0
root@debian:~/mips/boost_1_47_0# 

gag ★★★★★
()
Ответ на: комментарий от gag

Теперь libtorrent:

Никакого source setup.sh, т.к. у меня его нет. И содержимое его туманно. Но из него нужно извлечь пути у компилятору (у меня он установлен в системе).

И затем:

./configure --host=mips-linux
..........................<cut>...........................
Checking for a C/C++ compiler to use:
checking for mips-linux-gnu-gcc... mips-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether mips-linux-gnu-gcc accepts -g... yes
checking for mips-linux-gnu-gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... mips-linux-gnu-gcc -E
checking whether mips-linux-gnu-gcc and cc understand -c and -o together... yes
checking for mips-linux-gnu-g++... mips-linux-gnu-g++
checking whether we are using the GNU C++ compiler... yes
checking whether mips-linux-gnu-g++ accepts -g... yes
checking how to run the C++ preprocessor... mips-linux-gnu-g++ -E
checking whether mips-linux-gnu-g++ understands -c and -o together... yes
..........................<cut>...........................
Checking for boost libraries:
checking for boostlib >= 1.36... configure: We will use a staged boost library from /root/mips/boost_1_47_0
yes
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system... yes
checking whether the Boost::Filesystem library is available... yes
checking for exit in -lboost_filesystem... yes
checking whether the Boost::Thread library is available... yes
checking for exit in -lboost_thread... yes
..........................<cut>...........................
Вот и всё.

gag ★★★★★
()
Ответ на: комментарий от gag

Огромное спасибо, сделал всё как описано - конфигурация проходит без ошибок! Далее делаю make и тут получаю следующее:

...
Making all in src
make[1]: Вход в каталог `/home/user/STB/libtorrent-rasterbar-0.15.6/src'
  CXX    alert.lo
  CXX    allocator.lo
  CXX    assert.lo
  CXX    broadcast_socket.lo
  CXX    bt_peer_connection.lo
bt_peer_connection.cpp: In member function 'void libtorrent::bt_peer_connection::on_extended_handshake()':
bt_peer_connection.cpp:1544: error: 'boost::array<unsigned char, 4u>::<anonymous enum>' is/uses anonymous type
bt_peer_connection.cpp:1544: error:   trying to instantiate 'template<class T> struct boost::is_integral'
bt_peer_connection.cpp:1550: error: 'boost::array<unsigned char, 16u>::<anonymous enum>' is/uses anonymous type
bt_peer_connection.cpp:1550: error:   trying to instantiate 'template<class T> struct boost::is_integral'
make[1]: *** [bt_peer_connection.lo] Ошибка 1
make[1]: Выход из каталога `/home/user/STB/libtorrent-rasterbar-0.15.6/src'
make: *** [all-recursive] Ошибка 1
Nova
() автор топика
Ответ на: комментарий от Nova

Хорошо, что уже лучше! У меня проходит и дальше. Давайте запускать: make V=1

root@debian:~/mips/libtorrent-rasterbar-0.15.6# make V=1
Making all in include/libtorrent
make[1]: Entering directory `/root/mips/libtorrent-rasterbar-0.15.6/include/libtorrent'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/mips/libtorrent-rasterbar-0.15.6/include/libtorrent'
Making all in zlib
make[1]: Entering directory `/root/mips/libtorrent-rasterbar-0.15.6/zlib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/mips/libtorrent-rasterbar-0.15.6/zlib'
Making all in src
make[1]: Entering directory `/root/mips/libtorrent-rasterbar-0.15.6/src'
/bin/bash ../libtool  --tag=CXX   --mode=compile mips-linux-gnu-g++ -DPACKAGE_NAME=\"libtorrent-rasterbar\" -DPACKAGE_TARNAME=\"libtorrent-rasterbar\" -DPACKAGE_VERSION=\"0.15.6\" -DPACKAGE_STRING=\"libtorrent-rasterbar\ 0.15.6\" -DPACKAGE_BUGREPORT=\"arvid@cs.umu.se\" -DPACKAGE_URL=\"http://www.libtorrent.org\" -DPACKAGE=\"libtorrent-rasterbar\" -DVERSION=\"0.15.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD=1 -DHAVE_BOOST=1 -DHAVE_BOOST_SYSTEM=1 -DHAVE_BOOST_FILESYSTEM=1 -DHAVE_BOOST_THREAD=1 -D_FILE_OFFSET_BITS=64 -DHAVE_GETHOSTBYNAME=1 -DHAVE_GETHOSTBYNAME_R=1 -DGETHOSTBYNAME_R_RETURNS_INT=1 -DHAVE_LIBRT=1 -DNDEBUG=1 -DTORRENT_DISABLE_ENCRYPTION=1 -DHAVE_LINUX_FIEMAP_H=1 -DWITH_SHIPPED_GEOIP_H=1 -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE=1 -DBOOST_FILESYSTEM_VERSION=2 -DTORRENT_BUILDING_SHARED=1 -I.  -ftemplate-depth-100 -I../include -Os  -I../zlib -I/root/mips/boost_1_47_0   -march=mips32 -MT bt_peer_connection.lo -MD -MP -MF .deps/bt_peer_connection.Tpo -c -o bt_peer_connection.lo bt_peer_connection.cpp
libtool: compile:  mips-linux-gnu-g++ -DPACKAGE_NAME=\"libtorrent-rasterbar\" -DPACKAGE_TARNAME=\"libtorrent-rasterbar\" -DPACKAGE_VERSION=\"0.15.6\" "-DPACKAGE_STRING=\"libtorrent-rasterbar 0.15.6\"" -DPACKAGE_BUGREPORT=\"arvid@cs.umu.se\" -DPACKAGE_URL=\"http://www.libtorrent.org\" -DPACKAGE=\"libtorrent-rasterbar\" -DVERSION=\"0.15.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD=1 -DHAVE_BOOST=1 -DHAVE_BOOST_SYSTEM=1 -DHAVE_BOOST_FILESYSTEM=1 -DHAVE_BOOST_THREAD=1 -D_FILE_OFFSET_BITS=64 -DHAVE_GETHOSTBYNAME=1 -DHAVE_GETHOSTBYNAME_R=1 -DGETHOSTBYNAME_R_RETURNS_INT=1 -DHAVE_LIBRT=1 -DNDEBUG=1 -DTORRENT_DISABLE_ENCRYPTION=1 -DHAVE_LINUX_FIEMAP_H=1 -DWITH_SHIPPED_GEOIP_H=1 -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE=1 -DBOOST_FILESYSTEM_VERSION=2 -DTORRENT_BUILDING_SHARED=1 -I. -ftemplate-depth-100 -I../include -Os -I../zlib -I/root/mips/boost_1_47_0 -march=mips32 -MT bt_peer_connection.lo -MD -MP -MF .deps/bt_peer_connection.Tpo -c bt_peer_connection.cpp  -fPIC -DPIC -o .libs/bt_peer_connection.o
libtool: compile:  mips-linux-gnu-g++ -DPACKAGE_NAME=\"libtorrent-rasterbar\" -DPACKAGE_TARNAME=\"libtorrent-rasterbar\" -DPACKAGE_VERSION=\"0.15.6\" "-DPACKAGE_STRING=\"libtorrent-rasterbar 0.15.6\"" -DPACKAGE_BUGREPORT=\"arvid@cs.umu.se\" -DPACKAGE_URL=\"http://www.libtorrent.org\" -DPACKAGE=\"libtorrent-rasterbar\" -DVERSION=\"0.15.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD=1 -DHAVE_BOOST=1 -DHAVE_BOOST_SYSTEM=1 -DHAVE_BOOST_FILESYSTEM=1 -DHAVE_BOOST_THREAD=1 -D_FILE_OFFSET_BITS=64 -DHAVE_GETHOSTBYNAME=1 -DHAVE_GETHOSTBYNAME_R=1 -DGETHOSTBYNAME_R_RETURNS_INT=1 -DHAVE_LIBRT=1 -DNDEBUG=1 -DTORRENT_DISABLE_ENCRYPTION=1 -DHAVE_LINUX_FIEMAP_H=1 -DWITH_SHIPPED_GEOIP_H=1 -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE=1 -DBOOST_FILESYSTEM_VERSION=2 -DTORRENT_BUILDING_SHARED=1 -I. -ftemplate-depth-100 -I../include -Os -I../zlib -I/root/mips/boost_1_47_0 -march=mips32 -MT bt_peer_connection.lo -MD -MP -MF .deps/bt_peer_connection.Tpo -c bt_peer_connection.cpp -o bt_peer_connection.o >/dev/null 2>&1
mv -f .deps/bt_peer_connection.Tpo .deps/bt_peer_connection.Plo
/bin/bash ../libtool  --tag=CXX   --mode=compile mips-linux-gnu-g++ -DPACKAGE_NAME=\"libtorrent-rasterbar\" -DPACKAGE_TARNAME=\"libtorrent-rasterbar\" -DPACKAGE_VERSION=\"0.15.6\" -DPACKAGE_STRING=\"libtorrent-rasterbar\ 0.15.6\" -DPACKAGE_BUGREPORT=\"arvid@cs.umu.se\" -DPACKAGE_URL=\"http://www.libtorrent.org\" -DPACKAGE=\"libtorrent-rasterbar\" -DVERSION=\"0.15.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD=1 -DHAVE_BOOST=1 -DHAVE_BOOST_SYSTEM=1 -DHAVE_BOOST_FILESYSTEM=1 -DHAVE_BOOST_THREAD=1 -D_FILE_OFFSET_BITS=64 -DHAVE_GETHOSTBYNAME=1 -DHAVE_GETHOSTBYNAME_R=1 -DGETHOSTBYNAME_R_RETURNS_INT=1 -DHAVE_LIBRT=1 -DNDEBUG=1 -DTORRENT_DISABLE_ENCRYPTION=1 -DHAVE_LINUX_FIEMAP_H=1 -DWITH_SHIPPED_GEOIP_H=1 -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE=1 -DBOOST_FILESYSTEM_VERSION=2 -DTORRENT_BUILDING_SHARED=1 -I.  -ftemplate-depth-100 -I../include -Os  -I../zlib -I/root/mips/boost_1_47_0   -march=mips32 -MT connection_queue.lo -MD -MP -MF .deps/connection_queue.Tpo -c -o connection_queue.lo connection_queue.cpp
libtool: compile:  mips-linux-gnu-g++ -DPACKAGE_NAME=\"libtorrent-rasterbar\" -DPACKAGE_TARNAME=\"libtorrent-rasterbar\" -DPACKAGE_VERSION=\"0.15.6\" "-DPACKAGE_STRING=\"libtorrent-rasterbar 0.15.6\"" -DPACKAGE_BUGREPORT=\"arvid@cs.umu.se\" -DPACKAGE_URL=\"http://www.libtorrent.org\" -DPACKAGE=\"libtorrent-rasterbar\" -DVERSION=\"0.15.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD=1 -DHAVE_BOOST=1 -DHAVE_BOOST_SYSTEM=1 -DHAVE_BOOST_FILESYSTEM=1 -DHAVE_BOOST_THREAD=1 -D_FILE_OFFSET_BITS=64 -DHAVE_GETHOSTBYNAME=1 -DHAVE_GETHOSTBYNAME_R=1 -DGETHOSTBYNAME_R_RETURNS_INT=1 -DHAVE_LIBRT=1 -DNDEBUG=1 -DTORRENT_DISABLE_ENCRYPTION=1 -DHAVE_LINUX_FIEMAP_H=1 -DWITH_SHIPPED_GEOIP_H=1 -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE=1 -DBOOST_FILESYSTEM_VERSION=2 -DTORRENT_BUILDING_SHARED=1 -I. -ftemplate-depth-100 -I../include -Os -I../zlib -I/root/mips/boost_1_47_0 -march=mips32 -MT connection_queue.lo -MD -MP -MF .deps/connection_queue.Tpo -c connection_queue.cpp  -fPIC -DPIC -o .libs/connection_queue.o
...

gag ★★★★★
()
Ответ на: комментарий от gag

Вот часть результатов make V=1, файл с полным содержимым лежит тут http://rghost.ru/18122281

root@PC-CODER:~/STB/TorrentsLIBS/libtorrent-rasterbar-0.15.6# make V=1
Making all in include/libtorrent
make[1]: Вход в каталог `/home/user/STB/TorrentsLIBS/libtorrent-rasterbar-0.15.6/include/libtorrent'
make[1]: Цель `all' не требует выполнения команд.
make[1]: Выход из каталога `/home/user/STB/TorrentsLIBS/libtorrent-rasterbar-0.15.6/include/libtorrent'
Making all in zlib
make[1]: Вход в каталог `/home/user/STB/TorrentsLIBS/libtorrent-rasterbar-0.15.6/zlib'
make[1]: Цель `all' не требует выполнения команд.
make[1]: Выход из каталога `/home/user/STB/TorrentsLIBS/libtorrent-rasterbar-0.15.6/zlib'
Making all in src
make[1]: Вход в каталог `/home/user/STB/TorrentsLIBS/libtorrent-rasterbar-0.15.6/src'
...
mv -f .deps/broadcast_socket.Tpo .deps/broadcast_socket.Plo
/bin/bash ../libtool  --tag=CXX   --mode=compile mips-linux-g++ -DPACKAGE_NAME=\"libtorrent-rasterbar\" -DPACKAGE_TARNAME=\"libtorrent-rasterbar\" -DPACKAGE_VERSION=\"0.15.6\" -DPACKAGE_STRING=\"libtorrent-rasterbar\ 0.15.6\" -DPACKAGE_BUGREPORT=\"arvid@cs.umu.se\" -DPACKAGE_URL=\"http://www.libtorrent.org\" -DPACKAGE=\"libtorrent-rasterbar\" -DVERSION=\"0.15.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD=1 -DHAVE_BOOST=1 -DHAVE_BOOST_SYSTEM=1 -DHAVE_BOOST_FILESYSTEM=1 -DHAVE_BOOST_THREAD=1 -D_FILE_OFFSET_BITS=64 -DHAVE_GETHOSTBYNAME=1 -DHAVE_GETHOSTBYNAME_R=1 -DGETHOSTBYNAME_R_RETURNS_INT=1 -DHAVE_LIBRT=1 -DNDEBUG=1 -DTORRENT_USE_OPENSSL=1 -DHAVE_LIBZ=1 -DWITH_SHIPPED_GEOIP_H=1 -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE=1 -DBOOST_FILESYSTEM_VERSION=2 -DTORRENT_BUILDING_SHARED=1 -I.  -ftemplate-depth-100 -I../include -Os    -I/home/user/STB/Boost/boost_1_47_0   -g -O2 -MT bt_peer_connection.lo -MD -MP -MF .deps/bt_peer_connection.Tpo -c -o bt_peer_connection.lo bt_peer_connection.cpp
libtool: compile:  mips-linux-g++ -DPACKAGE_NAME=\"libtorrent-rasterbar\" -DPACKAGE_TARNAME=\"libtorrent-rasterbar\" -DPACKAGE_VERSION=\"0.15.6\" "-DPACKAGE_STRING=\"libtorrent-rasterbar 0.15.6\"" -DPACKAGE_BUGREPORT=\"arvid@cs.umu.se\" -DPACKAGE_URL=\"http://www.libtorrent.org\" -DPACKAGE=\"libtorrent-rasterbar\" -DVERSION=\"0.15.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD=1 -DHAVE_BOOST=1 -DHAVE_BOOST_SYSTEM=1 -DHAVE_BOOST_FILESYSTEM=1 -DHAVE_BOOST_THREAD=1 -D_FILE_OFFSET_BITS=64 -DHAVE_GETHOSTBYNAME=1 -DHAVE_GETHOSTBYNAME_R=1 -DGETHOSTBYNAME_R_RETURNS_INT=1 -DHAVE_LIBRT=1 -DNDEBUG=1 -DTORRENT_USE_OPENSSL=1 -DHAVE_LIBZ=1 -DWITH_SHIPPED_GEOIP_H=1 -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE=1 -DBOOST_FILESYSTEM_VERSION=2 -DTORRENT_BUILDING_SHARED=1 -I. -ftemplate-depth-100 -I../include -Os -I/home/user/STB/Boost/boost_1_47_0 -g -O2 -MT bt_peer_connection.lo -MD -MP -MF .deps/bt_peer_connection.Tpo -c bt_peer_connection.cpp  -fPIC -DPIC -o .libs/bt_peer_connection.o
bt_peer_connection.cpp: In member function 'void libtorrent::bt_peer_connection::on_extended_handshake()':
bt_peer_connection.cpp:1544: error: 'boost::array<unsigned char, 4u>::<anonymous enum>' is/uses anonymous type
bt_peer_connection.cpp:1544: error:   trying to instantiate 'template<class T> struct boost::is_integral'
bt_peer_connection.cpp:1550: error: 'boost::array<unsigned char, 16u>::<anonymous enum>' is/uses anonymous type
bt_peer_connection.cpp:1550: error:   trying to instantiate 'template<class T> struct boost::is_integral'
make[1]: *** [bt_peer_connection.lo] Ошибка 1
make[1]: Выход из каталога `/home/user/STB/libtorrent-rasterbar-0.15.6/src'
make: *** [all-recursive] Ошибка 1

Вот версия компилятора:

root@PC-CODER:~/STB/TorrentsLIBS/libtorrent-rasterbar-0.15.6# mips-linux-g++ --version
mips-linux-g++ (GCC) 4.0.0 (DENX ELDK 4.0 4.0.0)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Nova
() автор топика
Ответ на: комментарий от Nova

Похоже, это (fix build with std::tr1::array instead of boost::array) исправили всего 8 дней назад (т.е. даже в последнем релизе 0.15.7 этого ещё нет). Но отличия можно посмотреть тут: http://libtorrent.svn.sourceforge.net/viewvc/libtorrent/trunk/src/bt_peer_connection.cpp?r1=5873&r2=5885 Может, просто хватит исправить эти две строчки (номера строк не совпадают: у вас это 1544 и 1550 против новых 1766 и 1774).

gag ★★★★★
()
Ответ на: комментарий от gag

Всё получилось! Спасибо, gag!

Поменял в файлах bt_peer_connection.cpp и http_tracker_connection.cpp строки

address_v4::bytes_type::static_size
на
address_v4::bytes_type().size()
и библиотека собралась, были вот такие предупреждения
  CXX    session_impl.lo
session_impl.cpp:186: warning: invalid access to non-static data member 'libtorrent::session_settings::user_agent' of NULL object
session_impl.cpp:186: warning: (perhaps the 'offsetof' macro was used incorrectly)
session_impl.cpp:187: warning: invalid access to non-static data member 'libtorrent::session_settings::tracker_completion_timeout' of NULL object
session_impl.cpp:187: warning: (perhaps the 'offsetof' macro was used incorrectly)
...
session_impl.cpp:316: warning: invalid access to non-static data member 'libtorrent::pe_settings::allowed_enc_level' of NULL object
session_impl.cpp:316: warning: (perhaps the 'offsetof' macro was used incorrectly)
session_impl.cpp:317: warning: invalid access to non-static data member 'libtorrent::pe_settings::prefer_rc4' of NULL object
session_impl.cpp:317: warning: (perhaps the 'offsetof' macro was used incorrectly)

Собранная библиотека весит 30 метров, как-то очень жирно получилось. Поискал в сети рекомендации по уменьшению размера - как будет результат, отпишусь.

Nova
() автор топика
Ответ на: комментарий от Nova

Попробовал поиграться с оптимизациями и сделать strip, получились такие результаты:

./configure --host=mips-linux => 30Mb => mips-linux-strip => 4,394,928 bytes
./configure --host=mips-linux CXXFLAGS=-Os => 9Mb => mips-linux-strip => 7Mb
./configute --host=mips-linux CXXFLAGS=-O2 => 5,2Mb => mips-linux-strip => 4,392,896 bytes
./configure --host=mips-linux CXXFLAGS=-O3 => 4,99Mb => mips-linux-strip => 4,265,964 bytes

В принципе 4,2 метра не так и плохо, но можно ли еще уменьшить размер?

И еще вопрос - если я делаю:

mips-linux-ldd libtorrent-rasterbar.so.6.0.0
libboost_system.so.1.47.0 => not found
libboost_filesystem.so.1.47.0 => not found
libboost_thread.so.1.47.0 => not found
...
Это значит, что мне еще и эти библиотеки буста будет необходимо положить в прошивку? В сумме они занимают 283876 байт. А можно как-нибудь скомпилировать libtorrent, чтобы он был самодостаточен?

Nova
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.