Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error on arm32v7/debian:stretch #76

Open
devster31 opened this issue Apr 2, 2018 · 3 comments
Open

Build error on arm32v7/debian:stretch #76

devster31 opened this issue Apr 2, 2018 · 3 comments
Milestone

Comments

@devster31
Copy link

I'm encountering the below error on a clean system after following instruction and documentation.

checking for XMLRPC-C... failed
configure: error: Could not compile XMLRPC-C test.

and here the entire history of commands ran:

    1  apt update && apt-get install sudo locales lsb-release build-essential pkg-config     subversion git time lsof binutils tmux curl wget     python-setuptools python-virtualenv python-dev     libssl-dev zlib1g-dev libncurses-dev libncursesw5-dev     libcppunit-dev autoconf automake libtool     libffi-dev libxml2-dev libxslt1-dev
    2  git clone https://github.com/pyroscope/rtorrent-ps.git
    3  cd rtorrent-ps/
    4  ./build.sh install
    5  history

The system is a Scaleway server (C1) with an armv7l_armhf CPU (Marvell Armada I believe).

The failure is, as far as I can see, during the building steps for rtorrent itself.

@pyroscope
Copy link
Owner

Read your configure.log. This is a problem of your environment.

@devster31
Copy link
Author

Here the incriminated log rtorrent-0.9.6/config.log:

configure:18550: checking for XMLRPC-C
configure:18584: g++ -o conftest  -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -g -DDEBUG    -I/opt/rtorrent/include -I/opt/rtorrent/include  -I/opt/rtorrent/include  -I /opt/rtorrent/include -pthread -Wl,-rpath,/opt/rtorrent/lib -L/opt/rtorrent/lib conftest.cpp  -lncursesw -lcppunit  -L/opt/rtorrent/lib -lcurl -L/opt/rtorrent/lib -ltorrent -lpthread -L/opt/rtorrent/lib   -lxmlrpc_server -lxmlrpc  -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc_util -lpthread  >&5
/opt/rtorrent/lib/libtorrent.so: undefined reference to `torrent::request_list_constants::bucket_count'
/opt/rtorrent/lib/libtorrent.so: undefined reference to `torrent::PeerConnection<(torrent::Download::ConnectionType)1>::offer_chunk()'
/opt/rtorrent/lib/libtorrent.so: undefined reference to `torrent::PeerConnection<(torrent::Download::ConnectionType)0>::offer_chunk()'
/opt/rtorrent/lib/libtorrent.so: undefined reference to `torrent::MemoryChunk::sync_sync'
/opt/rtorrent/lib/libtorrent.so: undefined reference to `torrent::MemoryChunk::sync_async'
collect2: error: ld returned 1 exit status
configure:18584: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "rtorrent"
| #define PACKAGE_TARNAME "rtorrent"
| #define PACKAGE_VERSION "0.9.6"
| #define PACKAGE_STRING "rtorrent 0.9.6"
| #define PACKAGE_BUGREPORT "sundell.software@gmail.com"
| #define PACKAGE_URL ""
| #define API_VERSION 9
| #define PACKAGE "rtorrent"
| #define VERSION "0.9.6"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define HAVE_TR1 1
| #define HAVE_CXX11 1
| #define _FILE_OFFSET_BITS 64
| #define USE_EXECINFO 1
| #define USE_VARIABLE_FDSET 1
| #define HAVE_SYS_VFS_H 1
| #define HAVE_SYS_STATVFS_H 1
| #define HAVE_SYS_STATFS_H 1
| #define FS_STAT_FD fstatvfs(fd, &m_stat) == 0
| #define FS_STAT_FN statvfs(fn, &m_stat) == 0
| #define FS_STAT_STRUCT struct statvfs
| #define FS_STAT_SIZE_TYPE unsigned long
| #define FS_STAT_FN statvfs(fn, &m_stat) == 0
| #define FS_STAT_STRUCT struct statvfs
| #define FS_STAT_SIZE_TYPE unsigned long
| #define FS_STAT_COUNT_TYPE fsblkcnt_t
| #define FS_STAT_BLOCK_SIZE (m_stat.f_frsize)
| #define HAVE_PTHREAD_PRIO_INHERIT 1
| #define HAVE_PTHREAD 1
| #define HAVE_NCURSESW 1
| #define HAVE_CURSES 1
| #define HAVE_CURSES_ENHANCED 1
| #define HAVE_CURSES_COLOR 1
| #define HAVE_CURSES_OBSOLETE 1
| #define HAVE_NCURSESW_CURSES_H 1
| /* end confdefs.h.  */
|  #include <xmlrpc-c/server.h>
|
| int
| main ()
| {
|  xmlrpc_registry_new(NULL);
|   ;
|   return 0;
| }
configure:18591: result: failed
configure:18593: error: Could not compile XMLRPC-C test.

This also happens, with the same error output, with the ./build.sh docker_deb arm32v7/debian:stretch (this is needed because of moby/moby#34875 which would otherwise pull an armel image instead of an armhf image as appropriate).

My best guess is that it's related to these lines:

rtorrent-ps/build.sh

Lines 136 to 157 in 66e43c4

export USE_CXXFLAGS=true
if command which dpkg-architecture >/dev/null && dpkg-architecture -earmhf; then
GCC_TYPE="Raspbian"
elif command which gcc >/dev/null; then
GCC_TYPE=$(gcc --version | head -n1 | tr -s '()' ' ' | cut -f2 -d' ')
# Fix libtorrent bug with gcc version >= 6 and non-empty CXXFLAGS env var
GCC_MAIN_VER=$(gcc --version | head -n1 | cut -d' ' -f4 | cut -d'.' -f1)
test "${GCC_MAIN_VER:-0}" -ge 6 && export USE_CXXFLAGS=false || :
else
GCC_TYPE=none
fi
case "$GCC_TYPE" in
# Raspberry Pi 2 with one of
# gcc (Debian 4.6.3-14+rpi1) 4.6.3
# gcc (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2
Raspbian)
if uname -a | grep 'armv7' >/dev/null; then
export CFLAGS="$CFLAGS -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard"
export CFG_OPTS_LT="$CFG_OPTS_LT --disable-instrumentation"
fi
;;
esac
which may not be necessary anymore since gcc is now -ge 6 in arm32v7/debian:stretch.

# gcc --version
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Copyright (C) 2016 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.
$ gcc --version
gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516
Copyright (C) 2016 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.

This line in particular seems to be the culprit

export CFLAGS="$CFLAGS -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard"
commenting it out seems to solve the issue.

@pyroscope pyroscope self-assigned this Apr 21, 2018
@pyroscope pyroscope changed the title Build error on XMLRPC-C Build error on arm32v7/debian:stretch Apr 21, 2018
@pyroscope pyroscope removed their assignment Jun 3, 2018
@pyroscope pyroscope added this to the PS 1.2 milestone Jun 10, 2018
@pyroscope pyroscope modified the milestones: PS 1.2, Canvas v2 (PS-1.1) Jun 27, 2018
@pyroscope
Copy link
Owner

@devster31 I need an uname -a instead of the GCC version, and quick (before Sunday) if you want it in the upcoming 1.1 release.

@pyroscope pyroscope modified the milestones: Canvas v2 (PS-1.1), PS 1.2 Jul 1, 2018
zetafunction added a commit to zetafunction/rtorrent-ps that referenced this issue Jan 13, 2019
CPPFLAGS are used for building both C and C++ programs, and clang
complains when -std=c++11 is used when the driver is invoked in C mode.
Using CXXFLAGS to set this allows rtorrent-ps to be successfully built
with clang.

Unfortunately, fixing CXXFLAGS requires a new hack to ensure -O2 is
uniformly used. Otherwise, autoconf will break when detecting XMLRPC-C
support with an error like the one in pyroscope#76.
zetafunction added a commit to zetafunction/rtorrent-ps that referenced this issue Jan 14, 2019
Changes to CFLAGS/CXXFLAGS/LIBS affect following lines in configure.ac.
As originally written, this would cause random libraries, such as
libtorrent, to be linked into the autoconf test program. Occasionally,
this would cause the things like the pkgconfig checks to fail with
mysterious linker errors (e.g. pyroscope#76).

Instead, only populate these global flags with the additional flags for
dependencies at the very end, before the invocation of AC_OUTPUT.
zetafunction added a commit to zetafunction/rtorrent-ps that referenced this issue Jan 14, 2019
Changes to CFLAGS/CXXFLAGS/LIBS affect following lines in configure.ac.
As originally written, this would cause random libraries, such as
libtorrent, to be linked into the autoconf test program. Occasionally,
this would cause the things like the pkgconfig checks to fail with
mysterious linker errors (e.g. pyroscope#76).

Instead, only populate these global flags with the additional flags for
dependencies at the very end, before the invocation of AC_OUTPUT.
zetafunction added a commit to zetafunction/rtorrent-ps that referenced this issue Jan 14, 2019
Changes to CFLAGS/CXXFLAGS/LIBS affect following lines in configure.ac.
As originally written, this would cause random libraries, such as
libtorrent, to be linked into the autoconf test program. Occasionally,
this would cause the things like the pkgconfig checks to fail with
mysterious linker errors (e.g. pyroscope#76).

Instead, only populate these global flags with the additional flags for
dependencies at the very end, before the invocation of AC_OUTPUT.
zetafunction added a commit to zetafunction/rtorrent-ps that referenced this issue Sep 11, 2019
CPPFLAGS are used for building both C and C++ programs, and clang
complains when -std=c++11 is used when the driver is invoked in C mode.
Using CXXFLAGS to set this allows rtorrent-ps to be successfully built
with clang.

Unfortunately, fixing CXXFLAGS requires a new hack to ensure -O2 is
uniformly used. Otherwise, autoconf will break when detecting XMLRPC-C
support with an error like the one in pyroscope#76.

(cherry picked from commit 4453af5)
zetafunction added a commit to zetafunction/rtorrent-ps that referenced this issue Sep 11, 2019
Changes to CFLAGS/CXXFLAGS/LIBS affect following lines in configure.ac.
As originally written, this would cause random libraries, such as
libtorrent, to be linked into the autoconf test program. Occasionally,
this would cause the things like the pkgconfig checks to fail with
mysterious linker errors (e.g. pyroscope#76).

Instead, only populate these global flags with the additional flags for
dependencies at the very end, before the invocation of AC_OUTPUT.

(cherry picked from commit 9fb9d88)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants