Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-10444

dev-db/mysql-5.7.26 fails to build on Next

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • Hide
      Impacts users that need specifically dev-db/mysql,
      dev-db/mariadb-10.6.8 compiles cleanly
      Show
      Impacts users that need specifically dev-db/mysql, dev-db/mariadb-10.6.8 compiles cleanly
    • Code not compliant with C++17 standard.

      This is the error that stops the build:

      /usr/bin/x86_64-pc-linux-gnu-g++ -fPIC -march=skylake -O2 -pipe -felide-constructors -fno-strict-aliasing -Wall -Wextra -Wformat-security -Wvla -Wimplicit-fallthrough=2 -Woverloaded-virtual -Wno-unused-parameter -DNDEBUG -DDBUG_OFF -fPIC -Wl,-O1 -Wl, --sort-common -Wl, --as-needed -shared -o udf_example.so CMakeFiles/ udf_example.dir/udf_example.cc.o \-lpthread ../archive_output_directory/libmysqlservices.a -lpthread
      
      In file included from /var/tmp/portage/dev-db/mysql-5.7.26/work/mysql/storage/innobase/buf/buf0checksum.cc:26: 
      /var/tmp/portage/dev-db/mysql-5.7.26/work/mysql/storage/innobase/include/univ.i:410:33: error: unnamed scoped enum is not allowed
      
      410 | #define byte unsigned char
                                  ^~~~~~~~ 
      /var/tmp/portage/dev-db/mysql-5.7.26/work/mysql/storage/innobase/include/univ.i:410:33: error: expected identifier before ‘unsigned’}}
      

      It looks like tweaking the gcc flags might solve the problem. I haven't researched to find out what, but I've seen other packages that fail to build with -std=c++17, which is standard for the gcc-11.* we're using.

      In fact, I found a bug report on Gentoo with this same error, but with myslq-8.0.24 and their solution was in fact to force std=c++14.

      I did a little test with the following code, using the same macro that apparently triggers the error:

      #define byte unsigned char
      
      #include <iostream>
      
      int main(int argc, char **argv) {
         byte test='b';
         std::cout << test;
      }

      ...which will trigger the same error as mysql when I compile with -std=c++17 and above, but not with -c++14 and below.

        1. build.log
          4.40 MB
        2. emerge_info.txt
          8 kB
        3. emerge_pqv.txt
          0.2 kB
        4. epro_show.txt
          0.3 kB

            Unassigned Unassigned
            adbosco adbosco
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: