Opened 6 years ago

Last modified 5 years ago

#12205 new Bugs

FTBFS boost.serialization 1.61: undefined reference to boost::archive::codecvt_null<wchar_t>

Reported by: xantares Owned by: Robert Ramey
Milestone: To Be Determined Component: serialization
Version: Boost 1.61.0 Severity: Regression
Keywords: Cc:

Description

hello,

I cannot compile boost 1.61 (1.60 is fine with the same setup):

boost/archive/codecvt_null.hpp:93: undefined reference to `vtable for boost::archive::codecvt_null<wchar_t>

The incriminated package seems serialization, as it goes on with '--without-serialization' flag.

The setup is mingw-w64 on linux, with gcc 6.1.

See full log attached.

Change History (12)

comment:1 by xantares, 6 years ago

Log was too big:

Performing configuration checks

    - 32-bit                   : yes
    - arm                      : no
    - mips1                    : no
    - power                    : no
    - sparc                    : no
    - x86                      : yes
    - symlinks supported       : yes
    - C++11 mutex              : yes
    - has_icu builds           : no
    - zlib                     : yes
    - iconv (libc)             : no
    - iconv (separate)         : yes
    - icu                      : no
    - icu (lib64)              : no
    - g++ -shared-* supported  : no
    - compiler-supports-visibility : yes
    - message-compiler         : no
    - compiler-supports-ssse3  : yes
    - compiler-supports-avx2   : yes
    - gcc visibility           : yes
    - long double support      : yes
    - zlib                     : yes

Component configuration:

    - atomic                   : building
    - chrono                   : building
    - container                : building
    - context                  : building
    - coroutine                : building
    - coroutine2               : building
    - date_time                : building
    - exception                : building
    - filesystem               : building
    - graph                    : building
    - graph_parallel           : not building
    - iostreams                : building
    - locale                   : building
    - log                      : building
    - math                     : building
    - metaparse                : building
    - mpi                      : not building
    - program_options          : building
    - python                   : not building
    - random                   : building
    - regex                    : building
    - serialization            : building
    - signals                  : building
    - system                   : building
    - test                     : building
    - thread                   : building
    - timer                    : building
    - type_erasure             : building
    - wave                     : building
bin.v2/libs/serialization/build/gcc-mingw-mingw64/release/target-os-windows/threading-multi/basic_text_wiprimitive.o: In function `ZN5boost7archive12codecvt_nullIwED4Ev':
/home/xantares/projects/aur-scripts/mingw-w64-boost/src/build-i686-w64-mingw32/./boost/archive/codecvt_null.hpp:95: undefined reference to `vtable for boost::archive::codecvt_null<wchar_t>'
/home/xantares/projects/aur-scripts/mingw-w64-boost/src/build-i686-w64-mingw32/./boost/archive/codecvt_null.hpp:95: undefined reference to `vtable for boost::archive::codecvt_null<wchar_t>'
bin.v2/libs/serialization/build/gcc-mingw-mingw64/release/target-os-windows/threading-multi/basic_text_wiprimitive.o: In function `ZN5boost7archive12codecvt_nullIwEC4Ej':
/home/xantares/projects/aur-scripts/mingw-w64-boost/src/build-i686-w64-mingw32/./boost/archive/codecvt_null.hpp:93: undefined reference to `vtable for boost::archive::codecvt_null<wchar_t>'
bin.v2/libs/serialization/build/gcc-mingw-mingw64/release/target-os-windows/threading-multi/basic_text_wiprimitive.o: In function `ZN5boost7archive12codecvt_nullIwED4Ev':
/home/xantares/projects/aur-scripts/mingw-w64-boost/src/build-i686-w64-mingw32/./boost/archive/codecvt_null.hpp:95: undefined reference to `vtable for boost::archive::codecvt_null<wchar_t>'
bin.v2/libs/serialization/build/gcc-mingw-mingw64/release/target-os-windows/threading-multi/basic_text_wiprimitive.o: In function `ZN5boost7archive12codecvt_nullIwEC4Ej':
/home/xantares/projects/aur-scripts/mingw-w64-boost/src/build-i686-w64-mingw32/./boost/archive/codecvt_null.hpp:93: undefined reference to `vtable for boost::archive::codecvt_null<wchar_t>'
bin.v2/libs/serialization/build/gcc-mingw-mingw64/release/target-os-windows/threading-multi/basic_text_wiprimitive.o:/home/xantares/projects/aur-scripts/mingw-w64-boost/src/build-i686-w64-mingw32/./boost/archive/codecvt_null.hpp:95: more undefined references to `vtable for boost::archive::codecvt_null<wchar_t>' follow
collect2: error: ld returned 1 exit status
...removing bin.v2/libs/serialization/build/gcc-mingw-mingw64/release/target-os-windows/threading-multi/libboost_wserialization-mt.dll.a
...skipped <p/home/xantares/projects/aur-scripts/mingw-w64-boost/pkg/mingw-w64-boost/usr/i686-w64-mingw32/lib>libboost_wserialization-mt.dll for lack of <pbin.v2/libs/serialization/build/gcc-mingw-mingw64/release/target-os-windows/threading-multi>libboost_wserialization-mt.dll...
gcc.compile.c++ bin.v2/libs/signals/build/gcc-mingw-mingw64/release/target-os-windows/threading-multi/connection.o

    "i686-w64-mingw32-g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -march=i686 -mthreads -m32 -std=c++11 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -DBOOST_ALL_NO_LIB=1 -DBOOST_SIGNALS_DYN_LINK=1 -DBOOST_SIGNALS_NO_LIB=1 -DNDEBUG  -I"." -c -o "bin.v2/libs/signals/build/gcc-mingw-mingw64/release/target-os-windows/threading-multi/connection.o" "libs/signals/src/connection.cpp"

comment:2 by anonymous, 6 years ago

Could it be related to https://github.com/boostorg/serialization/pull/31 ? Or https://github.com/boostorg/serialization/commit/a64bf6e4d55970dbc7b92e9fcbdd596cdbc32564 ?

If I move codecvt_null to WSOURCES to compilation continues, but in that case maybe BOOST_ARCHIVE_DECL should be changed to BOOST_WARCHIVE_DECL.

comment:3 by xantares, 6 years ago

In 1.61 and develop branch, codecvt_null is compiled in archive: https://github.com/boostorg/serialization/blob/develop/build/Jamfile.v2 whereas in codecvt_null.hpp uses BOOST_WARCHIVE_DECL: https://github.com/boostorg/serialization/blob/develop/include/boost/archive/codecvt_null.hpp

If I move codecvt_null from SOURCES to WSOURCES in Jamfile.v2, the build passes.

comment:4 by xantares, 6 years ago

If I replace BOOST_WARCHIVE_DECL by BOOST_ARCHIVE_DECL it works too.

comment:5 by xantares, 6 years ago

Ah nope, ignore the last comment.

comment:7 by anonymous, 6 years ago

+1, same on Windows for Mingw-w64 <Debug,Release>+shared configurations; not reproduced for ICC or MSVC.

with PR: #42 applied, build error gone for Release+shared configuration only, while still reproduce for Debug+shared.

comment:8 by sav_ix@…, 5 years ago

reproduced for Boost-1.65.0 builds too.

comment:9 by James E. King, III, 5 years ago

I can reproduce this with an appveyor build of uuid, which depends on serialization:

https://ci.appveyor.com/project/jeking3/uuid/build/job/8h9yd8425mydtaqt

PR with the appveyor file:

https://github.com/boostorg/uuid/pull/27

Also this looks a lot like #12741.

comment:10 by James E. King, III, 5 years ago

I am also able to reproduce this locally by installing msys2 and then running the build like:

Jim.King@Jking-P70 MINGW64 /c/boost/libs/serialization $ ../../b2.exe test toolset=gcc

gcc.link ..\..\bin.v2\libs\serialization\test\test_bitset_text_archive.test\gcc- mingw-6.3.0\debug\test_bitset_text_archive.exe ..\..\bin.v2\libs\serialization\test\test_bitset_text_archive.test\gcc-mingw-6.3 .0\debug\test_bitset.o:test_bitset.cpp:(.rdata$.refptr._ZTVN5boost7archive12code cvt_nullIwEE[.refptr._ZTVN5boost7archive12codecvt_nullIwEE]+0x0): undefined refe rence to `vtable for boost::archive::codecvt_null<wchar_t>' collect2.exe: error: ld returned 1 exit status

comment:11 by hanetzer@…, 5 years ago

Still a problem in boost-1.65.1 on with mingw-w64/gcc-6.4.0 on gentoo.

comment:12 by anonymous, 5 years ago

Still a problem in boost-1.65.1 on with mingw32/gcc 6.3.0 on Windows 7

Note: See TracTickets for help on using tickets.