[Webkit-unassigned] [Bug 216537] New: [cmake][armv7] OFFLINE_ASM_BACKEND is wrongly set building in a native ARMv7 env in the top of a ARM64 host

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 15 07:06:04 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=216537

            Bug ID: 216537
           Summary: [cmake][armv7] OFFLINE_ASM_BACKEND is wrongly set
                    building in a native ARMv7 env in the top of a ARM64
                    host
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CMake
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: psaavedra at igalia.com

The OFFLINE_ASM_BACKEND cmake var is wrongly defined when you try to build WebKit in a chroom ARMv/armhf chroot (or similar) in  real ARM64 host. This bad definition of the OFFLINE_ASM_BACKEND var leads in a build error:


```
[899/4520] cd /webkit-debian-nightly/build/wpewebkit/obj-arm-linux-gnueabihf/Source/JavaScriptCore && /usr/bin/ruby /webkit-debian-nightly/build/wpewebkit/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb -I/webkit-debian-nightly/build/wpewebkit/obj-arm-linux-gnueabihf/DerivedSources/JavaScriptCore/ /webkit-debian-nightly/build/wpewebkit/Source/JavaScriptCore/llint/LowLevelInterpreter.asm /webkit-debian-nightly/build/wpewebkit/obj-arm-linux-gnueabihf/bin/LLIntSettingsExtractor /webkit-debian-nightly/build/wpewebkit/obj-arm-linux-gnueabihf/DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h ARM64
FAILED: DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h 
```



How to replicate the enviroment:


* Install Debian for ARM64 in the server.

* Using a powerful ARM64 server like this:
  * RAPTOR EV-883832-X3-0001
  * CPU: 32 Physical Cores @ 3.3 GHz (1 X AMPERE EMAG)
  * Memory: 128 GB of DDR4 ECC RAM
  * ref: https://store.avantek.co.uk/ampere-emag-64bit-arm-workstation.html

* Install Debian Stable for ARM64 in the server.
* Create an chroot environment with debootstrap for ARMv7. (ARMv7 can be executed by a ARM64 kernel)
* Enter en the chroot an set up the build as usual


The Debian enviroment into the chroot is ARMv7/armhf

```
root at c299a99a3ff5:/webkit-debian-nightly/build/wpewebkit# dpkg-architecture  
DEB_BUILD_ARCH=armhf
DEB_BUILD_ARCH_ABI=eabihf
DEB_BUILD_ARCH_BITS=32
DEB_BUILD_ARCH_CPU=arm
DEB_BUILD_ARCH_ENDIAN=little
DEB_BUILD_ARCH_LIBC=gnu
DEB_BUILD_ARCH_OS=linux
DEB_BUILD_GNU_CPU=arm
DEB_BUILD_GNU_SYSTEM=linux-gnueabihf
DEB_BUILD_GNU_TYPE=arm-linux-gnueabihf
DEB_BUILD_MULTIARCH=arm-linux-gnueabihf
DEB_HOST_ARCH=armhf
DEB_HOST_ARCH_ABI=eabihf
DEB_HOST_ARCH_BITS=32
DEB_HOST_ARCH_CPU=arm
DEB_HOST_ARCH_ENDIAN=little
DEB_HOST_ARCH_LIBC=gnu
DEB_HOST_ARCH_OS=linux
DEB_HOST_GNU_CPU=arm
DEB_HOST_GNU_SYSTEM=linux-gnueabihf
DEB_HOST_GNU_TYPE=arm-linux-gnueabihf
DEB_HOST_MULTIARCH=arm-linux-gnueabihf
DEB_TARGET_ARCH=armhf
DEB_TARGET_ARCH_ABI=eabihf
DEB_TARGET_ARCH_BITS=32
DEB_TARGET_ARCH_CPU=arm
DEB_TARGET_ARCH_ENDIAN=little
DEB_TARGET_ARCH_LIBC=gnu
DEB_TARGET_ARCH_OS=linux
DEB_TARGET_GNU_CPU=arm
DEB_TARGET_GNU_SYSTEM=linux-gnueabihf
DEB_TARGET_GNU_TYPE=arm-linux-gnueabihf
DEB_TARGET_MULTIARCH=arm-linux-gnueabihf
```

But the kernel is ARM 64 bits:


root at c299a99a3ff5:/webkit-debian-nightly/build/wpewebkit# uname.old  -a
Linux c299a99a3ff5 5.6.0-0.bpo.2-arm64 #1 SMP Debian 5.6.14-2~bpo10+1 (2020-06-09) aarch64 GNU/Linux
root at c299a99a3ff5:/webkit-debian-nightly/build/wpewebkit# uname.old  -m
aarch64



CMake uses `uname -m` to check and define the CMAKE_HOST_SYSTEM_PROCESSOR:

```
/usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake

        exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
```

what is used by WebKit's LOWERCASE_CMAKE_SYSTEM_PROCESSOR function to check the system:


```
 if (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(^aarch64|^arm64)")
    set(WTF_CPU_ARM64 1)
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
    set(WTF_CPU_ARM 1)
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200915/04d90d16/attachment.htm>


More information about the webkit-unassigned mailing list