Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5982

`make` fail @ ".../libmysql_versions.ld:155:9: invalid use of VERSION in input file"

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.0.9, 10.0.10
    • 5.5.49, 10.0.25, 10.1.14
    • Compiling
    • None

    Description

      with both

      	trunk/r4140
      	tag 10.0.9/r4040

      build

      	cmake .. \
      	...
      	make VERBOSE=1

      fails at

      	...
      	Scanning dependencies of target libmysql
      	make[2]: Leaving directory `/usr/local/src/mariadb/bld'
      	make -f libmysql/CMakeFiles/libmysql.dir/build.make libmysql/CMakeFiles/libmysql.dir/build
      	make[2]: Entering directory `/usr/local/src/mariadb/bld'
      	/usr/bin/cmake -E cmake_progress_report /usr/local/src/mariadb/bld/CMakeFiles 
      	[ 78%] Building CXX object libmysql/CMakeFiles/libmysql.dir/libmysql_exports_file.cc.o
      	cd /usr/local/src/mariadb/bld/libmysql && /usr/bin/g++-4.8   -DHAVE_CONFIG_H -DHAVE_OPENSSL -Dlibmysql_EXPORTS -Wall -O2 -D_FORTIFY_SOURCE=2 -fmessage-length=0 -fstack-protector -march=amdfam10 -mtune=amdfam10 -felide-constructors -fno-exceptions -fno-rtti -Wall -Wno-unused-parameter -fno-exceptions -fno-rtti -O2 -g -DNDEBUG -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1 -fPIC -I/usr/local/src/mariadb/bld/include -I/usr/local/src/mariadb/include -I/usr/local/src/mariadb/libmysql -I/usr/local/src/mariadb/bld/pcre -I/usr/local/src/mariadb/pcre -I/usr/local/src/mariadb/strings -I/usr/local/ssl/include    -O2 -D_FORTIFY_SOURCE=2 -fmessage-length=0 -fstack-protector -march=amdfam10 -mtune=amdfam10 -o CMakeFiles/libmysql.dir/libmysql_exports_file.cc.o -c /usr/local/src/mariadb/bld/libmysql/libmysql_exports_file.cc
      	Linking CXX shared library libmysqlclient.so
      	cd /usr/local/src/mariadb/bld/libmysql && /usr/bin/cmake -E cmake_link_script CMakeFiles/libmysql.dir/link.txt --verbose=1
      	/usr/bin/g++-4.8  -fPIC -Wall -O2 -D_FORTIFY_SOURCE=2 -fmessage-length=0 -fstack-protector -march=amdfam10 -mtune=amdfam10 -felide-constructors -fno-exceptions -fno-rtti -Wall -Wno-unused-parameter -fno-exceptions -fno-rtti -O2 -g -DNDEBUG -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1  -Wl,--no-undefined -Wl,--no-undefined -Wl,/usr/local/src/mariadb/bld/libmysql/libmysql_versions.ld   -shared -Wl,-soname,libmysqlclient.so.18 -o libmysqlclient.so.18.0.0 CMakeFiles/libmysql.dir/libmysql_exports_file.cc.o -lpthread libclientlib.a ../dbug/libdbug.a ../strings/libstrings.a ../vio/libvio.a ../mysys/libmysys.a ../mysys_ssl/libmysys_ssl.a -lz /usr/local/ssl/lib64/libssl.so /usr/local/ssl/lib64/libcrypto.so -ldl -ldl ../dbug/libdbug.a ../mysys/libmysys.a ../dbug/libdbug.a ../mysys/libmysys.a -lz -lm ../strings/libstrings.a -lpthread -Wl,-rpath,/usr/local/ssl/lib64: 
      	/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: error: /usr/local/src/mariadb/bld/libmysql/libmysql_versions.ld:155:9: invalid use of VERSION in input file
      	collect2: error: ld returned 1 exit status
      	make[2]: *** [libmysql/libmysqlclient.so.18.0.0] Error 1
      	make[2]: Leaving directory `/usr/local/src/mariadb/bld'
      	make[1]: *** [libmysql/CMakeFiles/libmysql.dir/all] Error 2
      	make[1]: Leaving directory `/usr/local/src/mariadb/bld'
      	make: *** [all] Error 2

      where

      	cat /usr/local/src/mariadb/bld/libmysql/libmysql_versions.ld
      		...
       
      		/*
      		  On Fedora the following symbols are exported, but renamed into a mysql_
      		  namespace. We export them as aliases, but keep original symbols too. See
      		  MDEV-4127.
      		*/
      		mysql_default_charset_info = default_charset_info;
      		mysql_get_charset = get_charset;
      		mysql_get_charset_by_csname = get_charset_by_csname;
      		mysql_net_realloc = net_realloc;
      		mysql_client_errors = client_errors;
       
      155		VERSION {
       
      		libmysqlclient_18 {
      		  global:
      		    get_tty_password;
      		    mysql_thread_end;
      		    mysql_thread_init;
      		...

      Attachments

        Activity

          pgnd pgnd added a comment -

          In communicating with the ld.gold devs, upon their review of THIS bug, the following was shared:

          "The initial analysis is basically correct: gold doesn't accept VERSION
          in an implicit linker script. However, the fix for that is
          straightforward, and it looks like they applied it.

          The last two comments then say that something else went wrong, but
          there are no details, so I have no idea what they did or what the
          problem was.

          In general please file gold bug reports at
          http://sourceware.org/bugzilla and discuss gold issues on the mailing
          list binutils@sourceware.org."

          Since MariaDB dev (hopefully) has the details of what's been done, and what's still not working, it'd be generally helpful if you communicated the issue – which clearly affects MariaDB build – to ld upstream, avoiding any 'fogging' by the uninformed (aka, me).

          Thanks.

          pgnd pgnd added a comment - In communicating with the ld.gold devs, upon their review of THIS bug, the following was shared: "The initial analysis is basically correct: gold doesn't accept VERSION in an implicit linker script. However, the fix for that is straightforward, and it looks like they applied it. The last two comments then say that something else went wrong, but there are no details, so I have no idea what they did or what the problem was. In general please file gold bug reports at http://sourceware.org/bugzilla and discuss gold issues on the mailing list binutils@sourceware.org." Since MariaDB dev (hopefully) has the details of what's been done, and what's still not working, it'd be generally helpful if you communicated the issue – which clearly affects MariaDB build – to ld upstream, avoiding any 'fogging' by the uninformed (aka, me). Thanks.

          Thanks. First, don't worry, comments to closed bugs are still forwarded.

          Second. My last comment on the gold bug tracker (https://sourceware.org/bugzilla/show_bug.cgi?id=16895#c7) from 2014-05-31 explains the problem exactly. The linking worked but versioning of symbols was incorrect, there were no symbols in the libmysqlclient_16 version node.

          My comment in this MDEV-5982 says the same. I don't know what other details are required. Considering that there were no comments on https://sourceware.org/bugzilla/show_bug.cgi?id=16895 after mine, I believed that no more information is needed.

          serg Sergei Golubchik added a comment - Thanks. First, don't worry, comments to closed bugs are still forwarded. Second. My last comment on the gold bug tracker ( https://sourceware.org/bugzilla/show_bug.cgi?id=16895#c7 ) from 2014-05-31 explains the problem exactly. The linking worked but versioning of symbols was incorrect, there were no symbols in the libmysqlclient_16 version node. My comment in this MDEV-5982 says the same. I don't know what other details are required. Considering that there were no comments on https://sourceware.org/bugzilla/show_bug.cgi?id=16895 after mine, I believed that no more information is needed.

          we'll do the following:
          if cmake detects gold it aborts with the error message like "gold linker doesn't support our symbol versioning scheme (https://sourceware.org/bugzilla/show_bug.cgi?id=16895), use ld or run cmake with -DDISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING=1"

          serg Sergei Golubchik added a comment - we'll do the following: if cmake detects gold it aborts with the error message like "gold linker doesn't support our symbol versioning scheme ( https://sourceware.org/bugzilla/show_bug.cgi?id=16895 ), use ld or run cmake with -DDISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING=1"
          pgnd pgnd added a comment - - edited

          > we'll do the following:
          > if cmake detects gold it aborts with the error message like "gold linker
          > doesn't support our symbol versioning scheme (https://sourceware.org/bugzilla/
          > show_bug.cgi?id=16895), use ld or run cmake with -
          > DDISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING=1"

          checking back on the error handling on this

          bldg from latest 10.1 sources,

          switching

          -	-DCMAKE_LINKER=/usr/bin/ld.bfd \
          +	-DCMAKE_LINKER=/usr/bin/ld.gold \
          

          allows config to pass with NO errors, but subsequent make still fires error at

          	...
          	[ 76%] Built target clientlib
          	[ 76%] Linking CXX shared library libmysqlclient.so
          	/usr/lib64/gcc/x86_64-suse-linux/5/../../../../x86_64-suse-linux/bin/ld: error: /usr/local/src/mariadb/bld/libmysql/libmysql_versions.ld:155:9: invalid use of VERSION in input file
          	collect2: error: ld returned 1 exit status
          	libmysql/CMakeFiles/libmysql.dir/build.make:110: recipe for target 'libmysql/libmysqlclient.so.18.0.0' failed
          	make[2]: *** [libmysql/libmysqlclient.so.18.0.0] Error 1
          	CMakeFiles/Makefile2:4149: recipe for target 'libmysql/CMakeFiles/libmysql.dir/all' failed
          	make[1]: *** [libmysql/CMakeFiles/libmysql.dir/all] Error 2
          	Makefile:138: recipe for target 'all' failed
          	make: *** [all] Error 2
          

          it looks like it's still not detected/messaged correctly in 10.1

          pgnd pgnd added a comment - - edited > we'll do the following: > if cmake detects gold it aborts with the error message like "gold linker > doesn't support our symbol versioning scheme ( https://sourceware.org/bugzilla/ > show_bug.cgi?id=16895), use ld or run cmake with - > DDISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING=1" checking back on the error handling on this bldg from latest 10.1 sources, switching - -DCMAKE_LINKER=/usr/bin/ld.bfd \ + -DCMAKE_LINKER=/usr/bin/ld.gold \ allows config to pass with NO errors, but subsequent make still fires error at ... [ 76%] Built target clientlib [ 76%] Linking CXX shared library libmysqlclient.so /usr/lib64/gcc/x86_64-suse-linux/5/../../../../x86_64-suse-linux/bin/ld: error: /usr/local/src/mariadb/bld/libmysql/libmysql_versions.ld:155:9: invalid use of VERSION in input file collect2: error: ld returned 1 exit status libmysql/CMakeFiles/libmysql.dir/build.make:110: recipe for target 'libmysql/libmysqlclient.so.18.0.0' failed make[2]: *** [libmysql/libmysqlclient.so.18.0.0] Error 1 CMakeFiles/Makefile2:4149: recipe for target 'libmysql/CMakeFiles/libmysql.dir/all' failed make[1]: *** [libmysql/CMakeFiles/libmysql.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 it looks like it's still not detected/messaged correctly in 10.1
          serg Sergei Golubchik added a comment - - edited

          I've implemented configure-time gold detection and the DISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING option.

          serg Sergei Golubchik added a comment - - edited I've implemented configure-time gold detection and the DISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING option.

          People

            serg Sergei Golubchik
            pgnd pgnd
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.