Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 3.1.2
    • N/A
    • None
    • None
    • Fedora

    Description

      Hello,
      I have a problem running the debug build of the CONC/C.

      I use the following:

      %{?with_debug: CFLAGS="$CFLAGS -O0 -g"}
      CXXFLAGS="$CFLAGS"
      export CFLAGS CXXFLAGS
      

      -DCMAKE_BUILD_TYPE="Debug"
      

      on standard x86_64.

      What I get is:

      -- Check if the system is big endian
      -- Searching 16 bit integer
      -- Looking for sys/types.h
      -- Looking for sys/types.h - found
      -- Looking for stdint.h
      -- Looking for stdint.h - found
      -- Looking for stddef.h
      -- Looking for stddef.h - found
      -- Check size of unsigned short
      -- Check size of unsigned short - failed
      -- Check size of unsigned int
      -- Check size of unsigned int - failed
      -- Check size of unsigned long
      -- Check size of unsigned long - failed
      CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:50 (message):
        no suitable type found
      Call Stack (most recent call first):
        CMakeLists.txt:213 (TEST_BIG_ENDIAN)
       
       
      -- Configuring incomplete, errors occurred!
      

      Which, when googled:
      https://github.com/emscripten-core/emscripten/issues/400
      can be worked around by setting the "SET(CMAKE_16BIT_TYPE "unsigned short")" into /usr/share/cmake/Modules/TestBigEndian.cmake
      Which apparently isn't a good solution.


      The next error is:

      -- Configuring done
      CMake Error at libmariadb/CMakeLists.txt:369 (ADD_LIBRARY):
        Cannot find source file:
       
          ../zlib/adler32.c
       
        Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
        .hpp .hxx .in .txx
       
      CMake Error at libmariadb/CMakeLists.txt:369 (ADD_LIBRARY):
        No SOURCES given to target: mariadb_obj
       
      CMake Error at libmariadb/CMakeLists.txt:397 (ADD_LIBRARY):
        No SOURCES given to target: libmariadb
       
      CMake Error at libmariadb/CMakeLists.txt:393 (ADD_LIBRARY):
        No SOURCES given to target: mariadbclient
      

      Which is caused by me, executing "rm -r win zlib win-iconv examples" to be extra sure, those parts are not used during the compilation. For example that I force system zlib implementation.
      So the error above shouldn't IMHO happen with "-DWITH_EXTERNAL_ZLIB=YES", which I use.


      The next error is FTBFS

      In file included from /home/faramos/work/COCN-C_final/mariadb-connector-c/mariadb-connector-c-3.1.2-src/plugins/auth/caching_sha2_pw.c:31:
      /home/faramos/work/COCN-C_final/mariadb-connector-c/mariadb-connector-c-3.1.2-src/include/ma_global.h:621:2: error: #error "Neither int or long is of 4 bytes width"
       #error "Neither int or long is of 4 bytes width"
        ^~~~~
      make[2]: *** [CMakeFiles/caching_sha2_password.dir/build.make:66: CMakeFiles/caching_sha2_password.dir/plugins/auth/caching_sha2_pw.c.o] Error 1
      make[2]: Entering directory '/home/faramos/work/COCN-C_final/mariadb-connector-c/mariadb-connector-c-3.1.2-src'
      [  3%] Building C object CMakeFiles/caching_sha2_password.dir/plugins/auth/caching_sha2_pw.c.o
      /usr/bin/cc -DHAVE_OPENSSL -DHAVE_TLS -DMARIADB_MACHINE_TYPE=\"x86_64\" -DMARIADB_SYSTEM_TYPE=\"Linux\" -Dcaching_sha2_password_EXPORTS -I/usr/include -I/home/faramos/work/COCN-C_final/mariadb-connector-c/mariadb-connector-c-3.1.2-src/include -I/home/faramos/work/COCN-C_final/mariadb-connector-c/mariadb-connector-c-3.1.2-src/plugins/auth -I/home/faramos/work/COCN-C_final/mariadb-connector-c/mariadb-connector-c-3.1.2-src/plugins/pvio  -O0 -g -Wunused -Wlogical-op -Wno-uninitialized -Wall -Wextra -Wformat-security -Wno-init-self -Wwrite-strings -Wshift-count-overflow -Wdeclaration-after-statement -Wno-undef -Wno-unknown-pragmas -fPIC   -DPLUGIN_DYNAMIC=1  -o CMakeFiles/caching_sha2_password.dir/plugins/auth/caching_sha2_pw.c.o   -c /home/faramos/work/COCN-C_final/mariadb-connector-c/mariadb-connector-c-3.1.2-src/plugins/auth/caching_sha2_pw.c
      make[2]: Leaving directory '/home/faramos/work/COCN-C_final/mariadb-connector-c/mariadb-connector-c-3.1.2-src'
      make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/caching_sha2_password.dir/all] Error 2
      make: *** [Makefile:155: all] Error 2
      
      

      Which may be caused by the improper workaround of the first issue.


      Can reproduce same errors in your buildbot?

      For the full reference, the Fedora sources can be found here:
      https://src.fedoraproject.org/rpms/mariadb-connector-c/tree/master
      https://src.fedoraproject.org/rpms/mariadb-connector-c/blob/master/f/mariadb-connector-c.spec

      Attachments

        1. CMakeError.log
          18 kB
        2. CMakeError.log_2
          44 kB
        3. CMakeOutput.log
          21 kB
        4. CMakeOutput.log_2
          98 kB

        Activity

          georg Georg Richter added a comment -

          Hi Michal,

          can you please attach CMakeOutput/Error log files?

          Thanks!

          georg Georg Richter added a comment - Hi Michal, can you please attach CMakeOutput/Error log files? Thanks!
          georg Georg Richter added a comment - - edited

          About TestBigEndian:
          Cmake issue #16283
          Seems to happen only when cross compiling - possible workaround would be to disable test by setting
          -DTEST_BIG_ENDIAN=0

          georg Georg Richter added a comment - - edited About TestBigEndian: Cmake issue #16283 Seems to happen only when cross compiling - possible workaround would be to disable test by setting -DTEST_BIG_ENDIAN=0
          mschorm Michal Schorm added a comment - - edited

          The issue is sure appaering when building package on the smae architecture as the result. No cross-compiling ( yet ).
          It may happen in our build infrastructure that packages some arches are cross-compiled on others. However, in this ticket, let's assume I'm building x86_64 package on x86_64 architecture and nothing else.

          I gathered the log files with something like:

          mock --chroot cat /builddir/build/BUILD/mariadb-connector-c-3.1.2-src/CMakeFiles/CMakeOutput.log > /tmp/CMakeOutput.log
          

          Maybe you would like to see the build log nad CMake log files with some CMake debug options. You just need to specify wihch ones as I don't know them.

          mschorm Michal Schorm added a comment - - edited The issue is sure appaering when building package on the smae architecture as the result. No cross-compiling ( yet ). It may happen in our build infrastructure that packages some arches are cross-compiled on others. However, in this ticket, let's assume I'm building x86_64 package on x86_64 architecture and nothing else. I gathered the log files with something like: mock --chroot cat /builddir/build/BUILD/mariadb-connector-c-3 .1.2-src /CMakeFiles/CMakeOutput .log > /tmp/CMakeOutput .log Maybe you would like to see the build log nad CMake log files with some CMake debug options. You just need to specify wihch ones as I don't know them.
          georg Georg Richter added a comment -

          Hmm... something seems to be broken, all the size check type tests fail, e.g.

          /usr/bin/ld: CMakeFiles/cmTC_e503c.dir/CMAKE_SIZEOF_UNSIGNED_LONG.c.o: relocation R_X86_64_32S against symbol `info_size' can not be used when making a shared object; recompile with -fPIC
          

          georg Georg Richter added a comment - Hmm... something seems to be broken, all the size check type tests fail, e.g. /usr/bin/ld: CMakeFiles/cmTC_e503c.dir/CMAKE_SIZEOF_UNSIGNED_LONG.c.o: relocation R_X86_64_32S against symbol `info_size' can not be used when making a shared object; recompile with -fPIC
          mschorm Michal Schorm added a comment - - edited

          With added

          export LDFLAGS="$LDFLAGS -fPIC"
          

          it builds fine

          Here are the same logfiles for comparsion (*.log_2)


          Since the -fPIC is benefitial for the library, I'll just start using that to all future builds.
          Form my side, it's fine to close the issue.

          mschorm Michal Schorm added a comment - - edited With added export LDFLAGS= "$LDFLAGS -fPIC" it builds fine Here are the same logfiles for comparsion (*.log_2) Since the -fPIC is benefitial for the library, I'll just start using that to all future builds. Form my side, it's fine to close the issue.
          georg Georg Richter added a comment -

          Closed on user request

          georg Georg Richter added a comment - Closed on user request

          People

            georg Georg Richter
            mschorm Michal Schorm
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.