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

LP:992312 - Support spec file doesn't compile (5.5.23)

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      The ~/mariadb-5.5.23/debug/support-files/mysql.5.5.23.spec does not compile.

      This is the upstream (oracle) spec file, so I modified it to work with the mariadb source tarball.

      The only modification to it was:

      diff mysql.5.5.23.spec /build/SPECS/mariadb.5.5.23.spec
      81c81
      < %define src_base mysql

      > %define src_base mariadb

      doing a rpmbuild -ba mariadb.5.5.23.spec mostly builds (78% done) until the following error:

      Linking CXX executable mysqlbinlog
      cd /build/BUILD/mariadb-5.5.23/debug/client && /usr/bin/cmake -E cmake_link_script CMakeFiles/mysqlbinlog.dir/link.txt --verbose=1
      /usr/bin/gcc -g -felide-constructors -fno-exceptions -fno-rtti -fPIC -Wall -Wno-unused-parameter -fno-implicit-templates -fno-exceptions -fno-rtti -O -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DENABLED_DEBUG_SYNC -DSAFE_MUTEX -DSAFEMALLOC -Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Wno-unused-parameter -Woverloaded-virtual -fPIC CMakeFiles/mysqlbinlog.dir/mysqlbinlog.cc.o -o mysqlbinlog -lpthread ../libmysql/libmysqlclient.a -lpthread -lm -lrt -ldl
      CMakeFiles/mysqlbinlog.dir/mysqlbinlog.cc.o: In function `cleanup':
      /build/BUILD/mariadb-5.5.23/mariadb-5.5.23/client/mysqlbinlog.cc:1465: undefined reference to `operator delete(void*)'
      CMakeFiles/mysqlbinlog.dir/mysqlbinlog.cc.o: In function `Table_map_log_event::create_table_def()':
      /build/BUILD/mariadb-5.5.23/mariadb-5.5.23/sql/log_event.h:3603: undefined reference to `operator new(unsigned long)'
      CMakeFiles/mysqlbinlog.dir/mysqlbinlog.cc.o: In function `Rows_log_event::print_verbose(st_io_cache*, st_print_event_info*)':
      /build/BUILD/mariadb-5.5.23/mariadb-5.5.23/sql/log_event.cc:2317: undefined reference to `operator delete(void*)'
      CMakeFiles/mysqlbinlog.dir/mysqlbinlog.cc.o: In function `main':
      /build/BUILD/mariadb-5.5.23/mariadb-5.5.23/client/mysqlbinlog.cc:2347: undefined reference to `operator new(unsigned long)'
      collect2: ld returned 1 exit status
      make[2]: *** [client/mysqlbinlog] Error 1
      make[2]: Leaving directory `/build/BUILD/mariadb-5.5.23/debug'
      make[1]: *** [client/CMakeFiles/mysqlbinlog.dir/all] Error 2
      make[1]: Leaving directory `/build/BUILD/mariadb-5.5.23/debug'
      make: *** [all] Error 2
      error: Bad exit status from /build/tmp/rpm-tmp.iXJazy (%build)

      Does anyone have a working spec file for 5.5.23?

      Thanks

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            wlad Vladislav Vaintroub added a comment -

            Re: Support spec file doesn't compile (5.5.23)
            I#m afraid nobody has a working spec right now. But if you want to try out a fix, I noticed that in your build gcc is being used as C++ compiler. Could you try out g++ as C++ compiler, this has better chance for success.

            Show
            wlad Vladislav Vaintroub added a comment - Re: Support spec file doesn't compile (5.5.23) I#m afraid nobody has a working spec right now. But if you want to try out a fix, I noticed that in your build gcc is being used as C++ compiler. Could you try out g++ as C++ compiler, this has better chance for success.
            Hide
            shawnsterling Shawn Sterling added a comment -

            Re: Support spec file doesn't compile (5.5.23)
            Hi Vladislav, thank you for the prompt reply.

            g++ was already installed on this build system, but the following option in the upstream spec file prevents it's use:

            export CXX=${MYSQL_BUILD_CXX:-${CXX:-gcc}}

            After removing that line, it will compile properly; however, there is this related line as well:

            export CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:${CXXFLAGS:$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti}}

            The $RPM_OPT_FLAGS is basically unset unless someone has it setup for their build system (which I'll say is not common in my experience). So the question is, are the other options:

            -felide-constructors -fno-exceptions -fno-rtti

            appropriate for mariadb compiled with g++?

            The rest of the issues with the rpm look like missing files and and renames, of which I'll take care of and contribute the spec file back.

            Have a good day.
            -Shawn

            Show
            shawnsterling Shawn Sterling added a comment - Re: Support spec file doesn't compile (5.5.23) Hi Vladislav, thank you for the prompt reply. g++ was already installed on this build system, but the following option in the upstream spec file prevents it's use: export CXX=${MYSQL_BUILD_CXX:-${CXX:-gcc}} After removing that line, it will compile properly; however, there is this related line as well: export CXXFLAGS=${MYSQL_BUILD_CXXFLAGS: ${CXXFLAGS: $RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti}} The $RPM_OPT_FLAGS is basically unset unless someone has it setup for their build system (which I'll say is not common in my experience). So the question is, are the other options: -felide-constructors -fno-exceptions -fno-rtti appropriate for mariadb compiled with g++? The rest of the issues with the rpm look like missing files and and renames, of which I'll take care of and contribute the spec file back. Have a good day. -Shawn
            Hide
            wlad Vladislav Vaintroub added a comment -

            Re: Support spec file doesn't compile (5.5.23)
            Hi,
            -fno-exceptions -fno-rtti should not affect the build in negavitve way . These flags do not bring much in my understanding, and this use is mosly "traditional" (because they were always there in MySQL build So it should work ok with flags, but without flags it should work too.

            -felide-constructors is less familiar to me, but description of it does not sound inappropriate, i.e might be fine to compile with it

            Show
            wlad Vladislav Vaintroub added a comment - Re: Support spec file doesn't compile (5.5.23) Hi, -fno-exceptions -fno-rtti should not affect the build in negavitve way . These flags do not bring much in my understanding, and this use is mosly "traditional" (because they were always there in MySQL build So it should work ok with flags, but without flags it should work too. -felide-constructors is less familiar to me, but description of it does not sound inappropriate, i.e might be fine to compile with it
            Hide
            shawnsterling Shawn Sterling added a comment -

            Re: Support spec file doesn't compile (5.5.23)
            Thanks for the help with the compiler flags.

            I have tested compiling with both options and it compiles either way, so I am inclined to leave the CXXFLAGS alone.

            I have gone through and renamed the instances of MySQL-xxxx to mariadb-xxxx (capslock is for newbs) and I have added the additional files that mariadb needs and removed some files that mariadb no longer requires.

            I will put the spec file up in bzr shortly, I have put the spec file on github for the interim.

            https://github.com/shawn-sterling/mysql_stuff/tree/master/mariadb-5.5.23

            Show
            shawnsterling Shawn Sterling added a comment - Re: Support spec file doesn't compile (5.5.23) Thanks for the help with the compiler flags. I have tested compiling with both options and it compiles either way, so I am inclined to leave the CXXFLAGS alone. I have gone through and renamed the instances of MySQL-xxxx to mariadb-xxxx (capslock is for newbs) and I have added the additional files that mariadb needs and removed some files that mariadb no longer requires. I will put the spec file up in bzr shortly, I have put the spec file on github for the interim. https://github.com/shawn-sterling/mysql_stuff/tree/master/mariadb-5.5.23
            Hide
            wlad Vladislav Vaintroub added a comment -

            Re: Support spec file doesn't compile (5.5.23)
            We ended up compiling our RPMs without using hand-written specs, but using CPack functionality instead, it resulted in somewhat cleaner and better maintainable code. The process is described here http://kb.askmonty.org/en/source-building-mariadb-on-centos/ , under "Building MariaDB 5.5 and above"

            We would also recommend that 3rd parties build RPMs the same way as we do.

            Thus I'd close the bug as "Invalid" (in MariaDb, there is no need to maintain hand-written spec) . Still, many thanks for bringing the issue to our attention.

            Show
            wlad Vladislav Vaintroub added a comment - Re: Support spec file doesn't compile (5.5.23) We ended up compiling our RPMs without using hand-written specs, but using CPack functionality instead, it resulted in somewhat cleaner and better maintainable code. The process is described here http://kb.askmonty.org/en/source-building-mariadb-on-centos/ , under "Building MariaDB 5.5 and above" We would also recommend that 3rd parties build RPMs the same way as we do. Thus I'd close the bug as "Invalid" (in MariaDb, there is no need to maintain hand-written spec) . Still, many thanks for bringing the issue to our attention.
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 992312

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 992312

              People

              • Assignee:
                Unassigned
                Reporter:
                shawnsterling Shawn Sterling
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: