← Back to team overview

maria-discuss team mailing list archive

Re: Cross compile error

 

On this error I'm not sure. Looks to be some sort of inheritance
hierarchy that is different in musl from glibc et al. I'd chase them up
to see who is violating the C++ spec.

Have you tried using buildroot? It has a stable 10.1 version that is
kept up to date and it has the one outstanding uclibc patch (that is
waiting in jira https://jira.mariadb.org/browse/MDEV-10841)


On 26/03/17 02:52, Lucian Cristian wrote:
> Hi
> 
> I'm trying to cross compile (any 10.* versions) using musl and uClibc++
> for a LEDE/Openwrt system and I have problems with these errors:
> 
> 
> staging_dir/target-x86_64_musl/usr/include/uClibc++/associative_base:444:8:
> error: 'void std::__base_associative<Key, ValueType, Compare,
> Allocator>::swap(std::__base_associative<Key, ValueType, Compare,
> Allocator>&) [with Key = dict_foreign_t*; ValueType = dict_foreign_t*;
> Compare = dict_foreign_compare; Allocator =
> ut_allocator<dict_foreign_t*>]' is protected
>    void __base_associative<Key, ValueType, Compare,
> Allocator>::swap(__base_associative<Key, ValueType, Compare, Allocator>& m)
>         ^
> build_dir/target-x86_64_musl/mariadb-10.2.4/storage/innobase/dict/dict0dict.cc:1996:32:
> error: within this context
>   table->foreign_set.swap(fk_set);
>                                 ^
> storage/innobase/CMakeFiles/innobase.dir/build.make:542: recipe for
> target 'storage/innobase/CMakeFiles/innobase.dir/dict/dict0dict.cc.o'
> failed
> 
> 
> 
> staging_dir/target-x86_64_musl/usr/include/uClibc++/map: In
> instantiation of 'std::map<Key, T, Compare, Allocator>::reference
> std::map<Key, T, Compare, Allocator>::operator[](const key_type&) [with
> Key = const char*; T = dict_index_t*; Compare = ut_strcmp_functor;
> Allocator = ut_allocator<std::pair<const char*, dict_index_t*> >;
> std::map<Key, T, Compare, Allocator>::reference = std::pair<const char*,
> dict_index_t*>&; std::map<Key, T, Compare, Allocator>::key_type = const
> char*]':
> build_dir/target-x86_64_musl/mariadb-10.2.4/storage/innobase/dict/dict0stats.cc:2518:22:
> required from here
> staging_dir/target-x86_64_musl/usr/include/uClibc++/map:143:13: error:
> invalid initialization of reference of type 'std::map<const char*,
> dict_index_t*, ut_strcmp_functor, ut_allocator<std::pair<const char*,
> dict_index_t*> > >::reference {aka std::pair<const char*,
> dict_index_t*>&}' from expression of type 'dict_index_t*'
>    return i->second;
>              ^
> storage/innobase/CMakeFiles/innobase.dir/build.make:614: recipe for
> target 'storage/innobase/CMakeFiles/innobase.dir/dict/dict0stats.cc.o'
> failed
> 
> 
> 
> build_dir/target-x86_64_musl/mariadb-10.2.4/plugin/handler_socket/handlersocket/hstcpsvr.cpp:
> In constructor 'dena::hstcpsvr::hstcpsvr(const dena::config&)':
> build_dir/target-x86_64_musl/mariadb-10.2.4/plugin/handler_socket/handlersocket/hstcpsvr.cpp:92:37:
> error: invalid initialization of non-const reference of type
> 'std::auto_ptr<volatile dena::database_i>&' from an rvalue of type
> 'dena::database_ptr {aka std::auto_ptr<volatile dena::database_i>}'
>    cshared.dbptr = database_i::create(c);
>                                      ^
> In file included from
> staging_dir/target-x86_64_musl/usr/include/uClibc++/vector:22:0,
>                  from
> build_dir/target-x86_64_musl/mariadb-10.2.4/plugin/handler_socket/handlersocket/hstcpsvr.cpp:12:
> 
> staging_dir/target-x86_64_musl/usr/include/uClibc++/memory:137:12:
> note:   initializing argument 1 of 'std::auto_ptr<T>&
> std::auto_ptr<T>::operator=(std::auto_ptr<T>&) [with T = volatile
> dena::database_i]'
>   auto_ptr& operator=(auto_ptr& p) throw(){
>             ^
> plugin/handler_socket/CMakeFiles/handlersocket.dir/build.make:134:
> recipe for target
> 'plugin/handler_socket/CMakeFiles/handlersocket.dir/handlersocket/hstcpsvr.cpp.o'
> failed
> make[5]: ***
> [plugin/handler_socket/CMakeFiles/handlersocket.dir/handlersocket/hstcpsvr.cpp.o]
> Error 1
> 
> 
> this is the command line
> 
> (cd /build_dir/target-x86_64_musl/mariadb-10.2.4; CFLAGS="-Os -pipe
> -fno-caller-saves -fno-plt -fhonour-copts
> -Wno-error=unused-but-set-variable -Wno-error=unused-result
> -iremap/build_dir/target-x86_64_musl/mariadb-10.2.4:mariadb-10.2.4
> -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1
> -Wl,-z,now -Wl,-z,relro -fpic " CXXFLAGS="-Os -pipe -fno-caller-saves
> -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable
> -Wno-error=unused-result
> -iremap/build_dir/target-x86_64_musl/mariadb-10.2.4:mariadb-10.2.4
> -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1
> -Wl,-z,now -Wl,-z,relro -fpic "
> LDFLAGS="-L/staging_dir/target-x86_64_musl/usr/lib
> -L/staging_dir/target-x86_64_musl/lib
> -L/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/usr/lib
> -L/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/lib -znow -zrelro " cmake
> -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1
> -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_BUILD_TYPE=Release
> -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG"
> -DCMAKE_C_COMPILER="/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/bin/x86_64-openwrt-linux-musl-gcc"
> -DCMAKE_C_COMPILER_ARG1=""
> -DCMAKE_CXX_COMPILER="/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/bin/g++-uc"
> -DCMAKE_CXX_COMPILER_ARG1=""
> -DCMAKE_ASM_COMPILER="/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/bin/x86_64-openwrt-linux-musl-gcc"
> -DCMAKE_ASM_COMPILER_ARG1=""
> -DCMAKE_EXE_LINKER_FLAGS:STRING="-L/staging_dir/target-x86_64_musl/usr/lib
> -L/staging_dir/target-x86_64_musl/lib
> -L/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/usr/lib
> -L/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/lib -znow -zrelro"
> -DCMAKE_MODULE_LINKER_FLAGS:STRING="-L/staging_dir/target-x86_64_musl/usr/lib
> -L/staging_dir/target-x86_64_musl/lib
> -L/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/usr/lib
> -L/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/lib -znow -zrelro
> -Wl,-Bsymbolic-functions"
> -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L/staging_dir/target-x86_64_musl/usr/lib
> -L/staging_dir/target-x86_64_musl/lib
> -L/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/usr/lib
> -L/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/lib -znow -zrelro
> -Wl,-Bsymbolic-functions"
> -DCMAKE_AR="/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/bin/x86_64-openwrt-linux-musl-gcc-ar"
> -DCMAKE_NM="/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/bin/x86_64-openwrt-linux-musl-gcc-nm"
> -DCMAKE_RANLIB="/staging_dir/toolchain-x86_64_gcc-5.4.0_musl/bin/x86_64-openwrt-linux-musl-gcc-ranlib"
> -DCMAKE_FIND_ROOT_PATH="/staging_dir/target-x86_64_musl/usr;/staging_dir/toolchain-x86_64_gcc-5.4.0_musl"
> -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH
> -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
> -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_STRIP=:
> -DCMAKE_INSTALL_PREFIX=/usr -DDL_LIBRARY=/staging_dir/target-x86_64_musl
> -DCMAKE_PREFIX_PATH=/staging_dir/target-x86_64_musl
> -DCMAKE_SKIP_RPATH=TRUE -DCMAKE_SYSTEM_NAME=Linux -DSTACK_DIRECTION=-1
> -DWITH_WSREP=ON -DWITH_INNODB_DISALLOW_WRITES=1 -DCONNECT_WITH_JDBC=OFF
> -DWITHOUT_TOKUDB=1
> -DIMPORT_EXECUTABLES=/build_dir/hostpkg/mariadb-10.2.4/host/import_executables.cmake
> /build_dir/target-x86_64_musl/mariadb-10.2.4 )
> 
> 
> can someone give me an advice ?
> 
> Regards
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~maria-discuss
> Post to     : maria-discuss@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~maria-discuss
> More help   : https://help.launchpad.net/ListHelp
> 



Follow ups