easybuilders / easybuild-easyconfigs

A collection of easyconfig files that describe which software to build using which build options with EasyBuild.
https://easybuild.io
GNU General Public License v2.0
378 stars 701 forks source link

MariaDB 10.2.11 does not link #7199

Open cmeesters opened 5 years ago

cmeesters commented 5 years ago

Dear All,

I tried to install MariaDB essentially by changing MariaDB-10.1.14-foss-2016a.eb to MariaDB-10.2.11-foss-2017a.eb and MariaDB-10.3.11-foss-2017a.eb. Compiling works, but the linker reports:

/usr/bin/ld.gold: error: /dev/shm/MariaDB/10.3.11/foss-2017a/easybuild_obj/libmariadb/libmariadb/mariadbclient.def:1:9: invalid use of VERSION in input file
/usr/bin/ld.gold: error: /dev/shm/MariaDB/10.3.11/foss-2017a/easybuild_obj/libmariadb/libmariadb/mariadbclient.def:254:9: invalid use of VERSION in input file
collect2: error: ld returned 1 exit status

Note, the list of dependencies is defined as follows (as I also partially altered those to reflect the more current 2017a trunk):

dependencies = [
    ('zlib', '1.2.11'),
    ('ncurses', '6.0'),
    ('jemalloc', '5.0.1'),
    ('XZ', '5.2.3'),
    ('Boost', '1.63.0'),
    ('libxml2', '2.9.7'),
]

builddependencies = [('CMake', '3.10.2')]

Has this been observed before? Any ideas? Anything I should clarify?

Best regards, Christian Meesters

verdurin commented 5 years ago

Hi @cmeesters - could you stick the modified easyconfig somewhere for us to try, perhaps as a gist?

cmeesters commented 5 years ago

Thank you for offering to look into the matter!

Here you go: https://gist.github.com/cmeesters/d863c4a7d768a7803fb6a1de7d274257

Please note line 35 and the comment before. The line specifying the linker was entered by me. This is additional info, because after reporting the issue I tried ld.gold and ld.bfd explicitely. However, nothing worked: No specification nor a specific one.

vanzod commented 5 years ago

@cmeesters I have hit the same issue you described here and I am trying to find a solution for this. Do you have any update?

boegel commented 5 years ago

Does this help at all? https://lists.gnu.org/archive/html/bug-binutils/2014-05/msg00007.html

Which binutils version is being used here?

vanzod commented 5 years ago

In my case I am building MariaDB/10.2.11 with foss/2017b, hence binutils/2.28. I have been reading into that thread and it definitely presents strong analogies with this issue. The solution there is to either split the file that contains the VERSION block into two files or to simply pass the -T flag to the linker. Although the latter is dirtier, it is definitely less painful to implement. I'm trying now.

vanzod commented 5 years ago

Unfortunately adding the -Wl,-T option does not seem to solve our issue.

/opt/easybuild/software/Core/GCCcore/6.4.0/bin/gcc -fPIC -O2 -ftree-vectorize -march=native -fno-math-errno -pie -fPIC -Wl,-z,relro,-z,now -fstack-protector --param=ssp-buffer-size=4 -DWITH_INNODB_DISALLOW_WRITES -Wall -Wextra -Wformat-security -Wno-init-self -Wvla -Wwrite-strings -Wdeclaration-after-statement -Wunused -Wno-uninitialized -Wall -Wextra -Wformat-security -Wno-init-self -Wwrite-strings -Wshift-count-overflow -Wdeclaration-after-statement -O2 -g -DNDEBUG -D_FORTIFY_SOURCE=2 -DDBUG_OFF -DDBUG_OFF -L/opt/easybuild/software/Core/GCCcore/6.4.0/lib64 -L/opt/easybuild/software/Core/GCCcore/6.4.0/lib -L/opt/easybuild/software/Compiler/GCC/6.4.0-2.28/OpenBLAS/0.2.20/lib -L/opt/easybuild/software/MPI/GCC/6.4.0-2.28/OpenMPI/2.1.1/ScaLAPACK/2.0.2-OpenBLAS-0.2.20/lib -L/opt/easybuild/software/MPI/GCC/6.4.0-2.28/OpenMPI/2.1.1/FFTW/3.3.6/lib -L/opt/easybuild/software/Compiler/GCCcore/6.4.0/zlib/1.2.11/lib -L/opt/easybuild/software/Compiler/GCCcore/6.4.0/ncurses/6.0/lib -L/opt/easybuild/software/Compiler/GCCcore/6.4.0/jemalloc/5.0.1/lib -L/opt/easybuild/software/Compiler/GCCcore/6.4.0/XZ/5.2.3/lib -L/opt/easybuild/software/MPI/GCC/6.4.0-2.28/OpenMPI/2.1.1/Boost/1.65.1/lib -L/opt/easybuild/software/Compiler/GCCcore/6.4.0/libxml2/2.9.7/lib -shared -Wl,-soname,libmariadb.so.3 -o libmariadb.so.3 CMakeFiles/mariadb_obj.dir/__/plugins/pvio/pvio_socket.c.o CMakeFiles/mariadb_obj.dir/__/plugins/auth/my_auth.c.o CMakeFiles/mariadb_obj.dir/__/plugins/auth/old_password.c.o CMakeFiles/mariadb_obj.dir/ma_array.c.o CMakeFiles/mariadb_obj.dir/ma_charset.c.o CMakeFiles/mariadb_obj.dir/ma_hash.c.o CMakeFiles/mariadb_obj.dir/ma_net.c.o CMakeFiles/mariadb_obj.dir/mariadb_charset.c.o CMakeFiles/mariadb_obj.dir/ma_time.c.o CMakeFiles/mariadb_obj.dir/ma_default.c.o CMakeFiles/mariadb_obj.dir/ma_errmsg.c.o CMakeFiles/mariadb_obj.dir/mariadb_lib.c.o CMakeFiles/mariadb_obj.dir/ma_list.c.o CMakeFiles/mariadb_obj.dir/ma_pvio.c.o CMakeFiles/mariadb_obj.dir/ma_tls.c.o CMakeFiles/mariadb_obj.dir/ma_alloc.c.o CMakeFiles/mariadb_obj.dir/ma_compress.c.o CMakeFiles/mariadb_obj.dir/ma_init.c.o CMakeFiles/mariadb_obj.dir/ma_password.c.o CMakeFiles/mariadb_obj.dir/ma_ll2str.c.o CMakeFiles/mariadb_obj.dir/ma_sha1.c.o CMakeFiles/mariadb_obj.dir/mariadb_stmt.c.o CMakeFiles/mariadb_obj.dir/ma_loaddata.c.o CMakeFiles/mariadb_obj.dir/ma_stmt_codec.c.o CMakeFiles/mariadb_obj.dir/ma_string.c.o CMakeFiles/mariadb_obj.dir/ma_dtoa.c.o CMakeFiles/mariadb_obj.dir/ma_client_plugin.c.o CMakeFiles/mariadb_obj.dir/ma_io.c.o CMakeFiles/mariadb_obj.dir/secure/openssl.c.o CMakeFiles/mariadb_obj.dir/mariadb_dyncol.c.o CMakeFiles/mariadb_obj.dir/mariadb_async.c.o CMakeFiles/mariadb_obj.dir/ma_context.c.o -lpthread -lnsl -lz -ldl -lm -lpthread -lpthread -ldl -lm -lssl -lcrypto -Wl,--no-undefined -Wl,-T mariadbclient.def 
/opt/easybuild/software/Compiler/GCCcore/6.4.0/binutils/2.28/bin/ld.gold: warning: wildcard match appears in both version 'libmysqlclient_18' and 'libmariadb_3' in script
/opt/easybuild/software/Compiler/GCCcore/6.4.0/binutils/2.28/bin/ld.gold: warning: using 'libmysqlclient_18' as version for 'mysql_get_timeout_value' which is also named in version 'libmariadb_3' in script
/opt/easybuild/software/Compiler/GCCcore/6.4.0/binutils/2.28/bin/ld.gold: warning: using 'libmysqlclient_18' as version for 'mysql_get_timeout_value_ms' which is also named in version 'libmariadb_3' in script
vanzod commented 5 years ago

This issue thread pointed me in the right direction: https://patchwork.openembedded.org/patch/111057

In a nutshell, replacing the gold linker used by default with bfd by adding DCMAKE_SHARED_LINKER_FLAGS='-fuse-ld=bfd' to the CMake command line, the build completes successfully. The bfd linker is not supported by old GCC releases, but it should not be our concern.

boegel commented 5 years ago

@vanzod Strictly speaking that's only required with an old glibc on the system, am I getting that right?