Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-11484

hadoop-mapreduce-client-nativetask fails to build on ARM AARCH64 due to x86 asm statements

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.0.0-alpha1
    • native
    • None
    • ARM aarch64 development board

    Description

      Hadoop fails to build on ARM aarch64 (or any non x86 platform) because of the following in

      hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/lib/primitives.h

      /**
       * little-endian to big-endian or vice versa
       */
      inline uint32_t bswap(uint32_t val) {
        __asm__("bswap %0" : "=r" (val) : "0" (val));
        return val;
      }
      
      inline uint64_t bswap64(uint64_t val) {
      #ifdef __X64
        __asm__("bswapq %0" : "=r" (val) : "0" (val));
      #else
      
        uint64_t lower = val & 0xffffffffU;
        uint32_t higher = (val >> 32) & 0xffffffffU;
      
        lower = bswap(lower);
        higher = bswap(higher);
      
        return (lower << 32) + higher;
      
      #endif
        return val;
      }
      

      The following also fails in

      hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/util/Checksum.cc

      static uint32_t cpuid(uint32_t eax_in) {
        uint32_t eax, ebx, ecx, edx;
      #  if defined(__PIC__) && !defined(__LP64__)
      // 32-bit PIC code uses the ebx register for the base offset --
      // have to save and restore it on the stack
        asm("pushl %%ebx\n\t"
            "cpuid\n\t"
            "movl %%ebx, %[ebx]\n\t"
            "popl %%ebx" : "=a" (eax), [ebx] "=r"(ebx), "=c"(ecx), "=d"(edx) : "a" (eax_in) 
            : "cc");
      #  else
        asm("cpuid" : "=a" (eax), "=b"(ebx), "=c"(ecx), "=d"(edx) : "a"(eax_in)
            : "cc");
      #  endif
      
        return ecx;
      }
      

      Attachments

        1. HADOOP-11484.001.patch
          2 kB
          Edward Nevill

        Issue Links

          Activity

            People

              enevill Edward Nevill
              enevill Edward Nevill
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: