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

s390x detected as 32bit in mtr tests

Details

    Description

      mysql-test/include/have_32bit.inc
      mysql-test/include/have_64bit.inc
      storage/mroonga/mysql-test/mroonga/include/mroonga/check_64bit.inc

      All check 64 bit based on 64 appearing in @@version_compile_machine. On s390x this isn't the case.

      version_compile_machine is derived from SYSTEM_TYPE which though a lot of hackery in cmake/package_name.cmake defines PLATFORM. In s390x's case this is based on CMAKE_SYSTEM_PROCESSOR which in the unix case is from uname -m. On s390x this is exactly "s390x" hence no-match and therefore 32 bit (which is definitely not the case).

      As most of the mtr tests that use this macro are using it because of the UINT_MAX value used in system variable, lets use that as the test case for 32 vs 64 bit.

      Attachments

        Activity

          danblack Daniel Black created issue -
          danblack Daniel Black made changes -
          Field Original Value New Value
          Description mysql-test/include/have_32bit.inc
          mysql-test/include/have_64bit.inc
          storage/mroonga/mysql-test/mroonga/include/mroonga/check_64bit.inc

          All check 64 bit based on 64 appearing in @@version_compile_machine. On s390x this isn't the case.

          version_compile_machine is derived from SYSTEM_TYPE which though a lot of hackery in cmake/package_name.cmake defines PLATFORM. In s390x's case this is based on CMAKE_SYSTEM_PROCESSOR which in the [[https://cmake.org/cmake/help/latest/variable/CMAKE_HOST_SYSTEM_PROCESSOR.html#unix-platforms|unix case] is from {{uname -m}}. On s390x this is exactly "s390x" hence no-match and therefore 32 bit (which is definitely not the case).

          As most of the mtr tests that use this macro are using it because of the UINT_MAX value used in system variable, lets use that as the test case for 32 vs 64 bit.
          mysql-test/include/have_32bit.inc
          mysql-test/include/have_64bit.inc
          storage/mroonga/mysql-test/mroonga/include/mroonga/check_64bit.inc

          All check 64 bit based on 64 appearing in @@version_compile_machine. On s390x this isn't the case.

          version_compile_machine is derived from SYSTEM_TYPE which though a lot of hackery in cmake/package_name.cmake defines PLATFORM. In s390x's case this is based on CMAKE_SYSTEM_PROCESSOR which in the [unix case|https://cmake.org/cmake/help/latest/variable/CMAKE_HOST_SYSTEM_PROCESSOR.html#unix-platforms] is from {{uname -m}}. On s390x this is exactly "s390x" hence no-match and therefore 32 bit (which is definitely not the case).

          As most of the mtr tests that use this macro are using it because of the UINT_MAX value used in system variable, lets use that as the test case for 32 vs 64 bit.
          danblack Daniel Black made changes -

          Looking at cmake/package_name.cmake it is apparent that the intent of DEFAULT_PLATFORM define is to contain "64" if the platform is 64 bit.
          See for example how AIX os is handled:

          ELSEIF(CMAKE_SYSTEM_NAME MATCHES "AIX")                                                                                                                           
            SET(DEFAULT_PLATFORM "${CMAKE_SYSTEM_NAME}5.${CMAKE_SYSTEM_VERSION}")     
          IF(64BIT)                                                                 
            SET(DEFAULT_MACHINE "${CMAKE_SYSTEM_PROCESSOR}-64bit")                  
          ENDIF()                     
          

          Also for "exotic mips"

          IF(NOT 64BIT AND CMAKE_SYSTEM_PROCESSOR MATCHES "^mips64")
          ...
          

          Just do a similar check for S390x and append -64bit at the end (or always append 64bit at the end for s390x). No reason to couple the 64bit check to a system variable meant for a completely different purpose. It becomes much more likely to break the 64 bit check if for some strange reason, the valid range of the system variable changes.

          Side note:
          Reading cmake/package_name.cmake, there might be a similar problem with OS X too, but I can not check that presently.

          cvicentiu Vicențiu Ciorbaru added a comment - Looking at cmake/package_name.cmake it is apparent that the intent of DEFAULT_PLATFORM define is to contain "64" if the platform is 64 bit. See for example how AIX os is handled: ELSEIF(CMAKE_SYSTEM_NAME MATCHES "AIX") SET(DEFAULT_PLATFORM "${CMAKE_SYSTEM_NAME}5.${CMAKE_SYSTEM_VERSION}") IF(64BIT) SET(DEFAULT_MACHINE "${CMAKE_SYSTEM_PROCESSOR}-64bit") ENDIF() Also for "exotic mips" IF(NOT 64BIT AND CMAKE_SYSTEM_PROCESSOR MATCHES "^mips64") ... Just do a similar check for S390x and append -64bit at the end (or always append 64bit at the end for s390x). No reason to couple the 64bit check to a system variable meant for a completely different purpose. It becomes much more likely to break the 64 bit check if for some strange reason, the valid range of the system variable changes. Side note: Reading cmake/package_name.cmake , there might be a similar problem with OS X too, but I can not check that presently.
          cvicentiu Vicențiu Ciorbaru made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          cvicentiu Vicențiu Ciorbaru made changes -
          Status In Progress [ 3 ] In Review [ 10002 ]
          cvicentiu Vicențiu Ciorbaru made changes -
          Assignee Vicențiu Ciorbaru [ cvicentiu ] Daniel Black [ danblack ]
          Status In Review [ 10002 ] Stalled [ 10000 ]
          danblack Daniel Black added a comment -

          updated as requested.

          danblack Daniel Black added a comment - updated as requested.
          danblack Daniel Black made changes -
          Assignee Daniel Black [ danblack ] Vicențiu Ciorbaru [ cvicentiu ]
          Status Stalled [ 10000 ] In Review [ 10002 ]
          cvicentiu Vicențiu Ciorbaru made changes -
          Status In Review [ 10002 ] Stalled [ 10000 ]
          cvicentiu Vicențiu Ciorbaru made changes -
          Assignee Vicențiu Ciorbaru [ cvicentiu ] Daniel Black [ danblack ]
          danblack Daniel Black made changes -
          Fix Version/s 10.2.41 [ 26032 ]
          Fix Version/s 10.3.32 [ 26029 ]
          Fix Version/s 10.4.22 [ 26031 ]
          Fix Version/s 10.5.13 [ 26026 ]
          Fix Version/s 10.6.5 [ 26034 ]
          Fix Version/s 10.2 [ 14601 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 123331 ] MariaDB v4 [ 159494 ]

          People

            danblack Daniel Black
            danblack Daniel Black
            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.