Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 3.0.5
    • 3.0.6
    • General
    • None
    • Fedora - all

    Description

      Hello,
      version 3.0.3 is fine, but in 3.0.5 a compile time error has appeared and I'd need to fix it.

      [ 51%] Linking C shared library libmaodbc.so
      /usr/bin/cmake -E cmake_link_script CMakeFiles/maodbc.dir/link.txt --verbose=1
      /usr/bin/cc -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -DNDEBUG -Wl,--version-script=/builddir/build/BUILD/mariadb-connector-odbc-3.0.5-ga-src/maodbc.def -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -shared -Wl,-soname,libmaodbc.so -o libmaodbc.so CMakeFiles/maodbc.dir/odbc_3_api.c.o CMakeFiles/maodbc.dir/ma_error.c.o CMakeFiles/maodbc.dir/ma_connection.c.o CMakeFiles/maodbc.dir/ma_helper.c.o CMakeFiles/maodbc.dir/ma_debug.c.o CMakeFiles/maodbc.dir/ma_dsn.c.o CMakeFiles/maodbc.dir/ma_driver.c.o CMakeFiles/maodbc.dir/ma_info.c.o CMakeFiles/maodbc.dir/ma_environment.c.o CMakeFiles/maodbc.dir/ma_parse.c.o CMakeFiles/maodbc.dir/ma_statement.c.o CMakeFiles/maodbc.dir/ma_desc.c.o CMakeFiles/maodbc.dir/ma_string.c.o CMakeFiles/maodbc.dir/ma_result.c.o CMakeFiles/maodbc.dir/ma_common.c.o CMakeFiles/maodbc.dir/ma_server.c.o CMakeFiles/maodbc.dir/ma_legacy_helpers.c.o CMakeFiles/maodbc.dir/ma_typeconv.c.o CMakeFiles/maodbc.dir/ma_bulk.c.o CMakeFiles/maodbc.dir/ma_platform_posix.c.o -Wl,-rpath,/builddir/build/BUILD/mariadb-connector-odbc-3.0.5-ga-src/libmariadb/libmariadb: libmariadb/libmariadb/libmariadb.so.3 -lodbcinst -lm -ldl -lpthread -ldl -lpthread -lssl -lcrypto -Wl,--no-undefined libmariadb/libmariadb/mariadbclient.def -lm 
      /usr/bin/ld: anonymous version tag cannot be combined with other version tags
      /usr/bin/ld: anonymous version tag cannot be combined with other version tags
      /usr/bin/ld: anonymous version tag cannot be combined with other version tags
      /usr/bin/ld: libmaodbc.so: version node not found for symbol mysql_num_rows@libmariadbclient_18
      /usr/bin/ld: failed to set dynamic section sizes: Bad value
      collect2: error: ld returned 1 exit status
      make[2]: *** [CMakeFiles/maodbc.dir/build.make:376: libmaodbc.so] Error 1
      make[2]: Leaving directory '/builddir/build/BUILD/mariadb-connector-odbc-3.0.5-ga-src'
      make[1]: *** [CMakeFiles/Makefile2:71: CMakeFiles/maodbc.dir/all] Error 2
      make[1]: Leaving directory '/builddir/build/BUILD/mariadb-connector-odbc-3.0.5-ga-src'
      make: *** [Makefile:155: all] Error 2
      error: Bad exit status from /var/tmp/rpm-tmp.aqNWzQ (%install)
      
      


      I already tried to take latest CONC/C project and build the CONC/CODBC on the top of it, but that didn't solved the issue.

      Fedora sources: (for 3.0.3)
      https://src.fedoraproject.org/rpms/mariadb-connector-odbc/tree/master

      Build:
      https://copr.fedorainfracloud.org/coprs/mschorm/connector/builds/

      Full build log:
      https://copr-be.cloud.fedoraproject.org/results/mschorm/connector/fedora-rawhide-x86_64/00772340-mariadb-connector-odbc/build.log.gz


      btw in the 3.0.5 release, there is also forgotten CMake cache file from you, which has to me manually removed before the build:

      CMake Error: The current CMakeCache.txt directory /home/faramos/work/MDB/PATCHES/MDB_CONC-ODBC/mariadb-connector-odbc/mariadb-connector-odbc-3.0.5-ga-src/CMakeCache.txt is different than the directory /home/lawrin/mariadb-connector-odbc-3.0.5-ga-src/mariadb-connector-odbc-3.0.5-ga-src where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
      
      


      Feel free to ask for more resources you'd find usefull.

      Attachments

        Activity

          I've created ODBC-164. I guess that should work for you. I don't want to have any search for libmariadb, and/or checks if version is correct, though. I'll only add -lmariadb to the linking command, if libmariadb folder is not present

          Lawrin Lawrin Novitsky added a comment - I've created ODBC-164 . I guess that should work for you. I don't want to have any search for libmariadb, and/or checks if version is correct, though. I'll only add -lmariadb to the linking command, if libmariadb folder is not present
          mschorm Michal Schorm added a comment -

          I tried with today's GitHub master branches for CONC/C & CONC/ODBC.

          CONC/C built fine; CONC/ODBC dies on following error:

          [ 31%] Linking C executable odbc_multistatement
          cd /home/faramos/work/ISSUES/NEW/mariadb-connector-odbc/mariadb-connector-odbc-3.0.6-ga-src/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/odbc_multistatement.dir/link.txt --verbose=1
          /usr/bin/cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -DNDEBUG  -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -rdynamic CMakeFiles/odbc_multistatement.dir/multistatement.c.o  -o odbc_multistatement -lodbc -lmariadbclient -lm -lpthread -ldl 
          /usr/bin/ld: cannot find -lmariadbclient
          collect2: error: ld returned 1 exit status
          

          —

          Second issue is a patch I need to apply beforehand.
          Otherwise it searches the /usr/include directly? not sure why. Maybe I created the tarball some weird way. Can you please show me how do you create release tarballs?

          --- mariadb-connector-odbc-3.0.5-ga-src/test/tap.h      2018-07-31 13:39:02.000000000 +0200
          +++ mariadb-connector-odbc-3.0.5-ga-src/test/tap.h_patched      2018-08-01 16:00:45.992610338 +0200
          @@ -109,7 +109,7 @@ int strcpy_s(char *dest, size_t buffer_s
           #include <time.h>
           #include <assert.h>
           /* We need mysql for MARIADB_CHARSET_INFO type and conversion routine */
          -#include <mysql.h>
          +#include <mysql/mysql.h>
           
           static SQLCHAR *my_dsn=        (SQLCHAR *)"test";
           static SQLCHAR *my_uid=        (SQLCHAR *)"root";
          --- mariadb-connector-odbc-3.0.5-ga-src/ma_odbc.h       2018-07-31 13:39:02.000000000 +0200
          +++ mariadb-connector-odbc-3.0.5-ga-src/ma_odbc.h_patched       2018-08-01 16:10:09.962798000 +0200
          @@ -29,7 +29,7 @@
           
           #include <stdlib.h>
           
          -#include <mysql.h>
          +#include <mysql/mysql.h>
           
           #include <ma_legacy_helpers.h>
           
          @@ -37,7 +37,7 @@
           #include <sqlext.h>
           #include <odbcinst.h>
           
          -#include <errmsg.h>
          +#include <mysql/errmsg.h>
           #include <string.h>
           #include <stdio.h>
           #include <math.h>
          

          mschorm Michal Schorm added a comment - I tried with today's GitHub master branches for CONC/C & CONC/ODBC. CONC/C built fine; CONC/ODBC dies on following error: [ 31%] Linking C executable odbc_multistatement cd /home/faramos/work/ISSUES/NEW/mariadb-connector-odbc/mariadb-connector-odbc-3.0.6-ga-src/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/odbc_multistatement.dir/link.txt --verbose=1 /usr/bin/cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -DNDEBUG -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -rdynamic CMakeFiles/odbc_multistatement.dir/multistatement.c.o -o odbc_multistatement -lodbc -lmariadbclient -lm -lpthread -ldl /usr/bin/ld: cannot find -lmariadbclient collect2: error: ld returned 1 exit status — Second issue is a patch I need to apply beforehand. Otherwise it searches the /usr/include directly? not sure why. Maybe I created the tarball some weird way. Can you please show me how do you create release tarballs? --- mariadb-connector-odbc-3.0.5-ga-src/test/tap.h 2018-07-31 13:39:02.000000000 +0200 +++ mariadb-connector-odbc-3.0.5-ga-src/test/tap.h_patched 2018-08-01 16:00:45.992610338 +0200 @@ -109,7 +109,7 @@ int strcpy_s(char *dest, size_t buffer_s #include <time.h> #include <assert.h> /* We need mysql for MARIADB_CHARSET_INFO type and conversion routine */ -#include <mysql.h> +#include <mysql/mysql.h> static SQLCHAR *my_dsn= (SQLCHAR *)"test"; static SQLCHAR *my_uid= (SQLCHAR *)"root"; --- mariadb-connector-odbc-3.0.5-ga-src/ma_odbc.h 2018-07-31 13:39:02.000000000 +0200 +++ mariadb-connector-odbc-3.0.5-ga-src/ma_odbc.h_patched 2018-08-01 16:10:09.962798000 +0200 @@ -29,7 +29,7 @@ #include <stdlib.h> -#include <mysql.h> +#include <mysql/mysql.h> #include <ma_legacy_helpers.h> @@ -37,7 +37,7 @@ #include <sqlext.h> #include <odbcinst.h> -#include <errmsg.h> +#include <mysql/errmsg.h> #include <string.h> #include <stdio.h> #include <math.h>
          mschorm Michal Schorm added a comment -

          I tried the freshly released tarball for CONC/ODBC 3.0.6 and it builds fine with the following patch:

          --- mariadb-connector-odbc-3.0.6-ga-src/ma_odbc.h	2018-07-31 13:39:02.000000000 +0200
          +++ mariadb-connector-odbc-3.0.6-ga-src/ma_odbc.h_patched	2018-08-01 16:10:09.962798000 +0200
          @@ -29,7 +29,7 @@
           
           #include <stdlib.h>
           
          -#include <mysql.h>
          +#include <mysql/mysql.h>
           
           #include <ma_legacy_helpers.h>
           
          @@ -37,7 +37,7 @@
           #include <sqlext.h>
           #include <odbcinst.h>
           
          -#include <errmsg.h>
          +#include <mysql/errmsg.h>
           #include <string.h>
           #include <stdio.h>
           #include <math.h>
          

          That means all of the issues has been resolved, but the patch I need now. (but that does not seem to be related to the previous issues)

          mschorm Michal Schorm added a comment - I tried the freshly released tarball for CONC/ODBC 3.0.6 and it builds fine with the following patch: --- mariadb-connector-odbc-3.0.6-ga-src/ma_odbc.h 2018-07-31 13:39:02.000000000 +0200 +++ mariadb-connector-odbc-3.0.6-ga-src/ma_odbc.h_patched 2018-08-01 16:10:09.962798000 +0200 @@ -29,7 +29,7 @@ #include <stdlib.h> -#include <mysql.h> +#include <mysql/mysql.h> #include <ma_legacy_helpers.h> @@ -37,7 +37,7 @@ #include <sqlext.h> #include <odbcinst.h> -#include <errmsg.h> +#include <mysql/errmsg.h> #include <string.h> #include <stdio.h> #include <math.h> That means all of the issues has been resolved, but the patch I need now. (but that does not seem to be related to the previous issues)

          I build source package making "package_source" target, which deploys cpack in its turn.

          We don't include test folder into source package. Thus the build error.

          As for you headers problem. I am not sure what to do here. I think we install C/C headers into 'mariadb' subdirectory, you have them in 'mysql'. I am quite happy to have C/C as a subproject, and not having to look for headers anywhere at all. And that is what c/odbc cmake config does now - it does not look neither for headers nor for libraries. And I'd prefer to keep it this way.
          Would something like 'cmake -DCMAKE_C_FLAGS_RELWITHDEBINFO="-I/usr/local/include/mysql"...' be acceptable for you? You could build this way, but I suspect you won't like this.
          Another thing I could think of is to introduce new cmake parameter something like "HEADERS_LOCATION_PREFIX", that will be empty string by defauld, and will be used in C/C headers inclusion directives, if set. I guess that is something you may like.

          And I think we do need new JIRA issue for that.

          btw, 3.0.6 has been published yesterday

          Lawrin Lawrin Novitsky added a comment - I build source package making "package_source" target, which deploys cpack in its turn. We don't include test folder into source package. Thus the build error. As for you headers problem. I am not sure what to do here. I think we install C/C headers into 'mariadb' subdirectory, you have them in 'mysql'. I am quite happy to have C/C as a subproject, and not having to look for headers anywhere at all. And that is what c/odbc cmake config does now - it does not look neither for headers nor for libraries. And I'd prefer to keep it this way. Would something like 'cmake -DCMAKE_C_FLAGS_RELWITHDEBINFO="-I/usr/local/include/mysql"...' be acceptable for you? You could build this way, but I suspect you won't like this. Another thing I could think of is to introduce new cmake parameter something like "HEADERS_LOCATION_PREFIX", that will be empty string by defauld, and will be used in C/C headers inclusion directives, if set. I guess that is something you may like. And I think we do need new JIRA issue for that. btw, 3.0.6 has been published yesterday

          I've made small change related to the discussion here.
          mariadb dir in /usr(/local)/include is added to include directories if connector is built without libmariadb submodule in the source tree.

          Lawrin Lawrin Novitsky added a comment - I've made small change related to the discussion here. mariadb dir in /usr(/local)/include is added to include directories if connector is built without libmariadb submodule in the source tree.

          People

            Lawrin Lawrin Novitsky
            mschorm Michal Schorm
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.