gearman / gearmand

http://gearman.org/
Other
741 stars 138 forks source link

gearadmin errors with CXXFLAGS='-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC' #274

Closed esabol closed 3 years ago

esabol commented 4 years ago

I did a gcc/g++ build on Fedora 31 (GCC 9.2.1 20190827 Red Hat 9.2.1-1) with CXXFLAGS='-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC' and the following errors popped up:

/usr/bin/ld: bin/gearadmin.o: in function `boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::xparse(boost::any&, std::__debug::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const':
/usr/include/boost/program_options/detail/value_semantic.hpp:184: undefined reference to `boost::program_options::validate(boost::any&, std::__debug::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, int)'
/usr/bin/ld: bin/gearadmin.o: in function `boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*)':
/usr/include/boost/program_options/detail/parsers.hpp:28: undefined reference to `boost::program_options::detail::cmdline::cmdline(std::__debug::vector<std::__cxx11::basic_string<char, std::char_traits<char>, s
td::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)'
/usr/bin/ld: bin/gearadmin.o:(.data.rel.ro._ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE[_ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::__debug::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:4590: bin/gearadmin] Error 1
...
/usr/bin/ld: bin/gearadmin.o: in function `boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::xparse(boost::any&, std::__debug::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const':
/usr/include/boost/program_options/detail/value_semantic.hpp:184: undefined reference to `boost::program_options::validate(boost::any&, std::__debug::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, int)'
/usr/bin/ld: bin/gearadmin.o: in function `boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*)':
/usr/include/boost/program_options/detail/parsers.hpp:28: undefined reference to `boost::program_options::detail::cmdline::cmdline(std::__debug::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)'
/usr/bin/ld: bin/gearadmin.o:(.data.rel.ro._ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE[_ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::__debug::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:4590: bin/gearadmin] Error 1

Dockerfile to reproduce:

FROM fedora:31

MAINTAINER gearmand

# Install packages
RUN dnf makecache
RUN dnf update -y
RUN dnf install -y 'dnf-command(builddep)' rpm-build git
RUN dnf install -y libtool autoconf automake
RUN dnf install -y make gettext-devel
RUN dnf install -y python3-sphinx
RUN dnf builddep -y gearmand
RUN dnf install -y mock
RUN useradd build && usermod -a -G mock build

ARG GEARMAN_REPO=https://github.com/gearman/gearmand

RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git
WORKDIR /tmp/gearmand
RUN ./bootstrap.sh -a
##ENV CXXFLAGS='-Wp,-D_GLIBCXX_ASSERTIONS'
ENV CXXFLAGS='-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC'
RUN ./configure --enable-ssl 2>&1 | tee ./configure.log
RUN make 2>&1 | tee ./build.log
RUN make test 2>&1 | tee ./test.log
p-alik commented 4 years ago

I've got same exception on Ubuntu 18.04

Configuration summary for gearmand version 1.1.19

   * Installation prefix:       /usr/local
   * System type:               pc-linux-gnu
   * Host CPU:                  x86_64
   * C Compiler:                cc
   * C Flags:                   -g -O2 -fstack-check -Wpragmas -Wunknown-pragmas -Wall -Wextra -Wunsuffixed-float-constants -Wjump-misses-init -Wno-attributes -Waddress
 -Wvarargs -Warray-bounds -Wbad-function-cast -Wchar-subscripts -Wcomment -Wfloat-equal -Wformat-security -Wformat=2 -Wformat-y2k -Wlogical-op -Wmaybe-uninitialized -Wm
issing-field-initializers -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wnormalized=id -Woverride-init -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wsh
adow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wtrampolines -Wundef -funsafe-loop-optimizations -Wclobbered -Wunused -Wunused-result -Wunused-variable -Wunused-
parameter -Wunused-local-typedefs -Wwrite-strings -fwrapv -pipe -fPIE -pie -Wsizeof-pointer-memaccess -Wpacked -Werror
   * C++ Compiler:              c++
   * C++ Flags:                  -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -g -O2 -fstack-check -Wpragmas -Wunknown-pragmas -Wall -Wextra -Wno-attributes -Wvarargs -Wa
ddress -Warray-bounds -Wchar-subscripts -Wcomment -Wctor-dtor-privacy -Wfloat-equal -Wformat=2 -Wformat-y2k -Wmaybe-uninitialized -Wmissing-field-initializers -Wlogical
-op -Wnon-virtual-dtor -Wnormalized=id -Woverloaded-virtual -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wtrampolines -W
undef -funsafe-loop-optimizations -Wc++11-compat -Wclobbered -Wunused -Wunused-result -Wunused-variable -Wunused-parameter -Wunused-local-typedefs -Wwrite-strings -Wfor
mat-security -fwrapv -pipe -fPIE -pie -Wsizeof-pointer-memaccess -Wpacked -Werror -std=c++0x
   * CPP Flags:                  -fvisibility=hidden
   * LIBS:
   * LDFLAGS Flags:              -Werror -rdynamic
   * Assertions enabled:        yes
   * Debug enabled:             no
   * Warnings as failure:       yes
   * Building with hiredis      yes
   * Building with libsqlite3   yes
   * Building with libdrizzle   yes
   * Building with libmemcached yes
   * Building with libpq        no
   * Building with tokyocabinet no
   * Building with libmysql     yes
   * SSL enabled:               no
   * wolfssl found:             no
   * openssl found:             yes
   * make -j:                   5
   * VCS checkout:              yes
esabol commented 4 years ago

I googled /usr/include/boost/program_options/detail/value_semantic.hpp:184: undefined reference toboost::program_options::validate` and found this:

https://stackoverflow.com/questions/39591067/undefined-reference-to-boostprogram-options-in-xubuntu

And this:

https://lists.boost.org/boost-users/2017/10/87969.php

Sounds like it’s not really a problem?

esabol commented 4 years ago

One of the stackoverflow.com answers said to try adding -D_GLIBCXX_USE_CXX11_ABI=0 to CXXFLAGS. That didn't work for me.

I also tried -Wp,-D_GLIBCXX_USE_CXX11_ABI=0. Same result.

esabol commented 4 years ago

I don’t think this is an issue. I’m going to close it unless someone comments that it should stay open.