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

Build on AIX: my_atomic.h", line 121.2: 1506-205 (S) #error atomic ops for this platform are not implemented

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.1.6
    • Fix Version/s: 10.1
    • Component/s: Compiling
    • Labels:
      None
    • Environment:

      Description

      Change optimization from O5 to O2 to see if could get past some errors but got this one

      [ 16%] Building C object mysys/CMakeFiles/mysys.dir/lf_alloc-pin.c.o
      "/home/buildsw/packages/mariadb-server-10.1.6/include/my_atomic.h", line 121.2: 1506-205 (S) #error atomic ops for this platform are not implemented
      "/home/buildsw/packages/mariadb-server-10.1.6/include/my_atomic.h", line 250.17: 1506-045 (S) Undeclared identifier ptr.
      mysys/CMakeFiles/mysys.dir/build.make:2198: recipe for target 'mysys/CMakeFiles/mysys.dir/lf_alloc-pin.c.o' failed
      make[2]: *** [mysys/CMakeFiles/mysys.dir/lf_alloc-pin.c.o] Error 1
      

      Found this in the cmake

      -- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS
      -- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS - Success
      -- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE
      -- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE - Failed
      -- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS_64
      -- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS_64 - Success
      -- Performing Test HAVE_IB_GCC_SYNC_SYNCHRONISE
      -- Performing Test HAVE_IB_GCC_SYNC_SYNCHRONISE - Success
      -- Performing Test HAVE_IB_GCC_ATOMIC_THREAD_FENCE
      -- Performing Test HAVE_IB_GCC_ATOMIC_THREAD_FENCE - Failed
      -- Performing Test HAVE_IB_ATOMIC_PTHREAD_T_GCC
      -- Performing Test HAVE_IB_ATOMIC_PTHREAD_T_GCC - Success
      -- Performing Test HAVE_C99_INITIALIZERS
      -- Performing Test HAVE_C99_INITIALIZERS - Success
      -- Looking for asprintf
      

      It looks like the tests for gcc are wrong, should not even be trying gcc since the compiler is xlc_r

      I have attached the output of the cmake pass

        Gliffy Diagrams

          Attachments

          1. cmake.out
            30 kB
          2. CMakeCache.txt
            70 kB
          3. env.out
            2 kB

            Activity

            Hide
            petepdx2 Pete Lancashire added a comment - - edited

            Same result

            CFLAGS   -O2 -qmaxmem=-1 -qarch=pwr7 -qtune=pwr7 -qcache=auto -I/usr/local/include
            CXXFLAGS -O2 -qmaxmem=-1 -qarch=pwr7 -qtune=pwr7 -qcache=auto -I/usr/local/include
            
            "/home/buildsw/packages/server/include/my_atomic.h", line 121.2: 1506-205 (S) #error atomic ops for this platform are not implemented
            "/home/buildsw/packages/server/include/my_atomic.h", line 250.17: 1506-045 (S) Undeclared identifier ptr.
            mysys/CMakeFiles/mysys.dir/build.make:2198: recipe for target 'mysys/CMakeFiles/mysys.dir/lf_alloc-pin.c.o' failed
            make[2]: *** [mysys/CMakeFiles/mysys.dir/lf_alloc-pin.c.o] Error 1
            CMakeFiles/Makefile2:7412: recipe for target 'mysys/CMakeFiles/mysys.dir/all' failed
            make[1]: *** [mysys/CMakeFiles/mysys.dir/all] Error 2
            Makefile:160: recipe for target 'all' failed
            
            CMakeCache.txt
            //Test HAVE_GCC_ATOMIC_BUILTINS
            HAVE_GCC_ATOMIC_BUILTINS:INTERNAL=1
            

            I've attached CMakeCache.txt

            BTW even more cut down CFLAGS

              590  export CFLAGS='-qmaxmem=-1 -I/usr/local/include'
              591  export CXXFLAGS='-qmaxmem=-1 -I/usr/local/include'
              593  rm -rf server
              594  tar xf mariadb_10.1.6.tar;cd server
              595  cmake -DPLUGIN_XTRADB:STRING=NO .
              596  make
            

            same

            Show
            petepdx2 Pete Lancashire added a comment - - edited Same result CFLAGS -O2 -qmaxmem=-1 -qarch=pwr7 -qtune=pwr7 -qcache=auto -I/usr/local/include CXXFLAGS -O2 -qmaxmem=-1 -qarch=pwr7 -qtune=pwr7 -qcache=auto -I/usr/local/include "/home/buildsw/packages/server/include/my_atomic.h", line 121.2: 1506-205 (S) #error atomic ops for this platform are not implemented "/home/buildsw/packages/server/include/my_atomic.h", line 250.17: 1506-045 (S) Undeclared identifier ptr. mysys/CMakeFiles/mysys.dir/build.make:2198: recipe for target 'mysys/CMakeFiles/mysys.dir/lf_alloc-pin.c.o' failed make[2]: *** [mysys/CMakeFiles/mysys.dir/lf_alloc-pin.c.o] Error 1 CMakeFiles/Makefile2:7412: recipe for target 'mysys/CMakeFiles/mysys.dir/all' failed make[1]: *** [mysys/CMakeFiles/mysys.dir/all] Error 2 Makefile:160: recipe for target 'all' failed CMakeCache.txt //Test HAVE_GCC_ATOMIC_BUILTINS HAVE_GCC_ATOMIC_BUILTINS:INTERNAL=1 I've attached CMakeCache.txt BTW even more cut down CFLAGS 590 export CFLAGS='-qmaxmem=-1 -I/usr/local/include' 591 export CXXFLAGS='-qmaxmem=-1 -I/usr/local/include' 593 rm -rf server 594 tar xf mariadb_10.1.6.tar;cd server 595 cmake -DPLUGIN_XTRADB:STRING=NO . 596 make same
            Hide
            svoj Sergey Vojtovich added a comment -

            We'd gladly fix this if we had AIX hosts around.

            The fact that gcc tests succeed are actually good news: xlc_r has support for "GCC atomic memory access built-in functions". That is there is no need to implement special code for xlc. But it looks like include/atomic/nolock.h didn't like this fact: it only accepts GCC sync built-ins when compiler is gcc.

            See also: http://www-01.ibm.com/support/docview.wss?uid=swg27024742&aid=1

            Show
            svoj Sergey Vojtovich added a comment - We'd gladly fix this if we had AIX hosts around. The fact that gcc tests succeed are actually good news: xlc_r has support for "GCC atomic memory access built-in functions". That is there is no need to implement special code for xlc. But it looks like include/atomic/nolock.h didn't like this fact: it only accepts GCC sync built-ins when compiler is gcc. See also: http://www-01.ibm.com/support/docview.wss?uid=swg27024742&aid=1
            Hide
            serg Sergei Golubchik added a comment -

            you can try this patch:

            --- a/include/atomic/nolock.h
            +++ b/include/atomic/nolock.h
            @@ -38,17 +38,12 @@
             */
             #  if defined(_MSC_VER)
             #    include "generic-msvc.h"
            -#  elif __GNUC__
            -#    if defined(HAVE_SOLARIS_ATOMIC)
            +#  elif defined(HAVE_SOLARIS_ATOMIC)
             #      include "solaris.h"
             #    elif defined(HAVE_GCC_ATOMIC_BUILTINS)
             #      include "gcc_builtins.h"
            -#    elif defined(__i386__) || defined(__x86_64__)
            +#    elif __GNUC__ && (defined(__i386__) || defined(__x86_64__))
             #      include "x86-gcc.h"
            -#    endif
            -#  elif defined(HAVE_SOLARIS_ATOMIC)
            -#    include "solaris.h"
            -#  endif
             #endif
            

            but make sure to run all related unit tests (my_atomic-t and lf-t) after your changes.

            Show
            serg Sergei Golubchik added a comment - you can try this patch: --- a/include/atomic/nolock.h +++ b/include/atomic/nolock.h @@ -38,17 +38,12 @@ */ # if defined(_MSC_VER) # include "generic-msvc.h" -# elif __GNUC__ -# if defined(HAVE_SOLARIS_ATOMIC) +# elif defined(HAVE_SOLARIS_ATOMIC) # include "solaris.h" # elif defined(HAVE_GCC_ATOMIC_BUILTINS) # include "gcc_builtins.h" -# elif defined(__i386__) || defined(__x86_64__) +# elif __GNUC__ && (defined(__i386__) || defined(__x86_64__)) # include "x86-gcc.h" -# endif -# elif defined(HAVE_SOLARIS_ATOMIC) -# include "solaris.h" -# endif #endif but make sure to run all related unit tests ( my_atomic-t and lf-t ) after your changes.
            Hide
            Aurelien_LEQUOY Aurélien LEQUOY added a comment - - edited
            [ 18%] Building C object mysys/CMakeFiles/mysys.dir/lf_alloc-pin.c.o
            In file included from /root/mariadb-10.1.6/include/lf.h:19:0,
                             from /root/mariadb-10.1.6/mysys/lf_alloc-pin.c:104:
            /root/mariadb-10.1.6/include/my_atomic.h:121:2: error: #error atomic ops for thi                                                                                                                                                             s platform are not implemented
            /root/mariadb-10.1.6/include/my_atomic.h: In function ‘my_atomic_casptr’:
            /root/mariadb-10.1.6/include/my_atomic.h:250:1: error: ‘ptr’ undeclared (first u                                                                                                                                                             se in this function)
            /root/mariadb-10.1.6/include/my_atomic.h:250:1: note: each undeclared identifier                                                                                                                                                              is reported only once for each function it appears in
            make[2]: *** [mysys/CMakeFiles/mysys.dir/lf_alloc-pin.c.o] Error 1
            make[1]: *** [mysys/CMakeFiles/mysys.dir/all] Error 2
            make: *** [all] Error 2
            make  542.83s user 34.05s system 98% cpu 9:48.54 total
            root has logged on pts/1 from 192.168.1.39.
            2 root@bananapi ~/mariadb-10.1.6 #
            

            this patch failed on BananaPi (ARM v7)

            
            #  if defined(_MSC_VER)
            #    include "generic-msvc.h"
            #  elif defined(HAVE_SOLARIS_ATOMIC)
            #      include "solaris.h"
            #  elif defined(HAVE_GCC_ATOMIC_BUILTINS)
            #      include "gcc_builtins.h"
            #  elif __GNUC__ && (defined(__i386__) || defined(__x86_64__))
            #      include "x86-gcc.h"
            #  endif
            
            Show
            Aurelien_LEQUOY Aurélien LEQUOY added a comment - - edited [ 18%] Building C object mysys/CMakeFiles/mysys.dir/lf_alloc-pin.c.o In file included from /root/mariadb-10.1.6/include/lf.h:19:0, from /root/mariadb-10.1.6/mysys/lf_alloc-pin.c:104: /root/mariadb-10.1.6/include/my_atomic.h:121:2: error: #error atomic ops for thi s platform are not implemented /root/mariadb-10.1.6/include/my_atomic.h: In function ‘my_atomic_casptr’: /root/mariadb-10.1.6/include/my_atomic.h:250:1: error: ‘ptr’ undeclared (first u se in this function) /root/mariadb-10.1.6/include/my_atomic.h:250:1: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [mysys/CMakeFiles/mysys.dir/lf_alloc-pin.c.o] Error 1 make[1]: *** [mysys/CMakeFiles/mysys.dir/all] Error 2 make: *** [all] Error 2 make 542.83s user 34.05s system 98% cpu 9:48.54 total root has logged on pts/1 from 192.168.1.39. 2 root@bananapi ~/mariadb-10.1.6 # this patch failed on BananaPi (ARM v7) # if defined(_MSC_VER) # include " generic -msvc.h" # elif defined(HAVE_SOLARIS_ATOMIC) # include "solaris.h" # elif defined(HAVE_GCC_ATOMIC_BUILTINS) # include "gcc_builtins.h" # elif __GNUC__ && (defined(__i386__) || defined(__x86_64__)) # include "x86-gcc.h" # endif
            Hide
            Aurelien_LEQUOY Aurélien LEQUOY added a comment - - edited

            after dunno why gcc broken lol

            ./configure
            configure.pl : calling cmake /root/mariadb-10.1.6
            -- Running cmake version 2.8.9
            -- The C compiler identification is unknown
            -- The CXX compiler identification is unknown
            -- Check for working C compiler: /usr/bin/gcc
            -- Check for working C compiler: /usr/bin/gcc -- broken
            CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
              The C compiler "/usr/bin/gcc" is not able to compile a simple test program.
            
              It fails with the following output:
            
               Change Dir: /root/mariadb-10.1.6/CMakeFiles/CMakeTmp
            
            
            
              Run Build Command:/usr/bin/make "cmTryCompileExec3840924219/fast"
            
              /usr/bin/make -f CMakeFiles/cmTryCompileExec3840924219.dir/build.make
              CMakeFiles/cmTryCompileExec3840924219.dir/build
            
              make[1]: Entering directory `/root/mariadb-10.1.6/CMakeFiles/CMakeTmp'
            
              /usr/bin/cmake -E cmake_progress_report
              /root/mariadb-10.1.6/CMakeFiles/CMakeTmp/CMakeFiles 1
            
              Building C object
              CMakeFiles/cmTryCompileExec3840924219.dir/testCCompiler.c.o
            
              /usr/bin/gcc -qmaxmem=-1 -I/usr/local/include -o
              CMakeFiles/cmTryCompileExec3840924219.dir/testCCompiler.c.o -c
              /root/mariadb-10.1.6/CMakeFiles/CMakeTmp/testCCompiler.c
            
              gcc: error: unrecognized option ‘-qmaxmem=-1’
            
              make[1]: *** [CMakeFiles/cmTryCompileExec3840924219.dir/testCCompiler.c.o]
              Error 1
            
              make[1]: Leaving directory `/root/mariadb-10.1.6/CMakeFiles/CMakeTmp'
            
              make: *** [cmTryCompileExec3840924219/fast] Error 2
            
            
            
            
            
              CMake will not be able to correctly generate this project.
            Call Stack (most recent call first):
              CMakeLists.txt:88 (PROJECT)
            
            
            -- Configuring incomplete, errors occurred!
            
            
            Show
            Aurelien_LEQUOY Aurélien LEQUOY added a comment - - edited after dunno why gcc broken lol ./configure configure.pl : calling cmake /root/mariadb-10.1.6 -- Running cmake version 2.8.9 -- The C compiler identification is unknown -- The CXX compiler identification is unknown -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- broken CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE): The C compiler "/usr/bin/gcc" is not able to compile a simple test program. It fails with the following output: Change Dir: /root/mariadb-10.1.6/CMakeFiles/CMakeTmp Run Build Command:/usr/bin/make "cmTryCompileExec3840924219/fast" /usr/bin/make -f CMakeFiles/cmTryCompileExec3840924219.dir/build.make CMakeFiles/cmTryCompileExec3840924219.dir/build make[1]: Entering directory `/root/mariadb-10.1.6/CMakeFiles/CMakeTmp' /usr/bin/cmake -E cmake_progress_report /root/mariadb-10.1.6/CMakeFiles/CMakeTmp/CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec3840924219.dir/testCCompiler.c.o /usr/bin/gcc -qmaxmem=-1 -I/usr/local/include -o CMakeFiles/cmTryCompileExec3840924219.dir/testCCompiler.c.o -c /root/mariadb-10.1.6/CMakeFiles/CMakeTmp/testCCompiler.c gcc: error: unrecognized option ‘-qmaxmem=-1’ make[1]: *** [CMakeFiles/cmTryCompileExec3840924219.dir/testCCompiler.c.o] Error 1 make[1]: Leaving directory `/root/mariadb-10.1.6/CMakeFiles/CMakeTmp' make: *** [cmTryCompileExec3840924219/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:88 (PROJECT) -- Configuring incomplete, errors occurred!
            Hide
            Aurelien_LEQUOY Aurélien LEQUOY added a comment -
            
            #  if defined(_MSC_VER)
            #    include "generic-msvc.h"
            #  elif defined(HAVE_SOLARIS_ATOMIC)
            #      include "solaris.h"
            #  elif defined(HAVE_GCC_ATOMIC_BUILTINS)
            #      include "gcc_builtins.h"
            #  elif __GNUC__ && (defined(__i386__) || defined(__x86_64__))
            #      include "x86-gcc.h"
            #  endif
            #  endif
            
            

            you forgot one #endif but it's work finally

            Show
            Aurelien_LEQUOY Aurélien LEQUOY added a comment - # if defined(_MSC_VER) # include " generic -msvc.h" # elif defined(HAVE_SOLARIS_ATOMIC) # include "solaris.h" # elif defined(HAVE_GCC_ATOMIC_BUILTINS) # include "gcc_builtins.h" # elif __GNUC__ && (defined(__i386__) || defined(__x86_64__)) # include "x86-gcc.h" # endif # endif you forgot one #endif but it's work finally

              People

              • Assignee:
                svoj Sergey Vojtovich
                Reporter:
                petepdx2 Pete Lancashire
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: