Uploaded image for project: 'IoTivity'
  1. IoTivity
  2. IOT-2755

IoTivity does not build on many 32-bit systems by default

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Undecided
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: IoTivity 1.3.0
    • Component/s: Build System
    • Labels:
    • Found in Version/s:
      1.3.0
    • Fixed in Version/s:
      1.3.1
    • Operating System:
      Ubuntu
    • Hardware / OEM Platform:
      N/A
    • Issue Severity:
      Normal
    • Reproducibility:
      Always (100%)
    • Bugzilla ID:
      None

      Description

       

      IoTivity 1.3.0 does not build anymore for some Linux in 32-bit mode (previous versions such as 1.2.1 built just fine). Specifically, when the platform.machine() (see [1]) returns something like 'i586' or 'i686', it will simply not build. You can override this by forcing TARGET_ARCH to 'x86' but that shouldn't be needed.

      IoTivity 1.2.x had a mechanism in place so that when the 'default_arch' value was not in the 'os_arch_map' list (see [2]), then the very first arch from the list for that particular OS was selected. It's a bit rough as for Linux as an example, any unrecognized ARM, MIPS architecture would make the build system attempt to build for 'x86'. My patch [3] below is therefore a slight variation of that logic in that it simply detects if 'i586' or 'i686' was detected (for Linux) and if so, it replaces that value by 'x86'. Does that sound like the right fix to the problem?

       

      [1] https://github.com/iotivity/iotivity/blob/master/build_common/SConscript#L68

      [2] https://github.com/iotivity/iotivity/blob/1.2-rel/build_common/SConscript#L57

      [3]

      diff --git a/build_common/SConscript b/build_common/SConscript index 46a6735..61c5889 100755

      — a/build_common/SConscript

      +++ b/build_common/SConscript

      @@ -55,6 +55,9 @@ else:

           default_arch = platform.machine()

           if target_os == 'windows':

               default_arch = default_arch.lower()

      +    if target_os == 'linux':

      +        if default_arch in ['i586', 'i686']:

      +         default_arch = 'x86'

       

       target_arch = ARGUMENTS.get('TARGET_ARCH', default_arch) # target arch

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              mwichmann Mats Wichmann
              Reporter:
              gvancuts Geoffroy Van Cutsem
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: