Skip to content

build failed on aarch64 centos 7.9 with gcc7.3 #4226

Closed

Description

@bxq2011hust

Steps to Reproduce

# build on aarch64 centos 7.9
yum install -y epel-release centos-release-scl
yum install -y git make llvm-toolset-7 devtoolset-7
source /opt/rh/devtoolset-7/enable
export LIBCLANG_PATH=/opt/rh/llvm-toolset-7.0/root/lib64/
source /opt/rh/llvm-toolset-7.0/enable 

cd crates/fiber
cargo build

the output is

$ cargo build
  Downloaded cc v1.0.68 (registry `ustc`)
  Downloaded semver v1.0.3 (registry `ustc`)
  Downloaded 2 crates (84.9 KB) in 1.12s
   Compiling semver v1.0.3
   Compiling cc v1.0.68
   Compiling linux-raw-sys v0.0.36
   Compiling bitflags v1.3.2
   Compiling wasmtime-fiber v0.32.0 (/data/home/xingqiangbai/wasmtime/crates/fiber)
   Compiling rustc_version v0.4.0
The following warnings were emitted during compilation:

warning: src/arch/aarch64.S: Assembler messages:
warning: src/arch/aarch64.S:21: Error: operand 1 must be a floating-point register -- `stp lr,fp,[sp,-16]!'
warning: src/arch/aarch64.S:50: Error: operand 1 must be a floating-point register -- `ldp lr,fp,[sp],16'
warning: src/arch/aarch64.S:90: Error: bad register expression

error: failed to run custom build command for `wasmtime-fiber v0.32.0 (/data/home/xingqiangbai/wasmtime/crates/fiber)`

Caused by:
  process didn't exit successfully: `/data/home/xingqiangbai/wasmtime/target/debug/build/wasmtime-fiber-5d0a77b56f840026/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("aarch64-unknown-linux-gnu")
  OPT_LEVEL = Some("0")
  HOST = Some("aarch64-unknown-linux-gnu")
  CC_aarch64-unknown-linux-gnu = None
  CC_aarch64_unknown_linux_gnu = None
  HOST_CC = None
  CC = None
  CFLAGS_aarch64-unknown-linux-gnu = None
  CFLAGS_aarch64_unknown_linux_gnu = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("neon,pmuv3")
  running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-Wall" "-Wextra" "-DCFG_TARGET_OS_linux" "-DCFG_TARGET_ARCH_aarch64" "-o" "/data/home/xingqiangbai/wasmtime/target/debug/build/wasmtime-fiber-3beb5f998a225eb9/out/src/arch/aarch64.o" "-c" "src/arch/aarch64.S"
  cargo:warning=src/arch/aarch64.S: Assembler messages:
  cargo:warning=src/arch/aarch64.S:21: Error: operand 1 must be a floating-point register -- `stp lr,fp,[sp,-16]!'
  cargo:warning=src/arch/aarch64.S:50: Error: operand 1 must be a floating-point register -- `ldp lr,fp,[sp],16'
  cargo:warning=src/arch/aarch64.S:90: Error: bad register expression
  exit status: 1

  --- stderr


  error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-Wall" "-Wextra" "-DCFG_TARGET_OS_linux" "-DCFG_TARGET_ARCH_aarch64" "-o" "/data/home/xingqiangbai/wasmtime/target/debug/build/wasmtime-fiber-3beb5f998a225eb9/out/src/arch/aarch64.o" "-c" "src/arch/aarch64.S" with args "cc" did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...

Expected Results

Build successfully.
It works on m1 mac and a virtual machine(ubuntu 20.04 aarch64) on m1 mac.

Activity

  1. added
    bugIncorrect behavior in the current implementation that needs fixing
    on Jun 6, 2022
  2. cfallin commented on Jun 6, 2022

    @cfallin
    Member

    @bxq2011hust thanks for the report! Can you show the output of cc --version and as --version?

    I suspect that really old versions of GNU as may not support referring to the fp and lr registers as fp and lr -- see e.g. the patch in Comment 8 on this WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=175512

    If so, we could modify our assembly to always spell these as x29 and x30 respectively, though that's a bit unfortunate... cc @akirilov-arm , thoughts on this re: aarch64 toolchain requirements/expectations?

  3. bxq2011hust commented on Jun 6, 2022

    @bxq2011hust
    ContributorAuthor

    @bxq2011hust thanks for the report! Can you show the output of cc --version and as --version?

    I suspect that really old versions of GNU as may not support referring to the fp and lr registers as fp and lr -- see e.g. the patch in Comment 8 on this WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=175512

    If so, we could modify our assembly to always spell these as x29 and x30 respectively, though that's a bit unfortunate... cc @akirilov-arm , thoughts on this re: aarch64 toolchain requirements/expectations?

    Thanks very much. I compare ubuntu 20.04 with CentOS7 and found that ubuntu 20.04 use gcc9. I tried gcc9 on aarch64 CentOS7, now it works fine. @cfallin

    cc --version
    cc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
    Copyright (C) 2017 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    
    as --version
    GNU assembler version 2.28-11.el7
    Copyright (C) 2017 Free Software Foundation, Inc.
    This program is free software; you may redistribute it under the terms of
    the GNU General Public License version 3 or later.
    This program has absolutely no warranty.
    This assembler was configured for a target of `aarch64-redhat-linux'.
  4. akirilov-arm commented on Jun 6, 2022

    @akirilov-arm
    Contributor

    I think it is reasonable to support older toolchain versions, provided that it is not too much of a hassle, which seems to be the case here. Personally, I think I have found myself wondering what register numbers fp and lr correspond to more often than the other way round, so I'd say that the proposed fix wouldn't even necessarily diminish readability.

    I will incorparate the fix in PR #4195, since I am tinkering with the fiber code anyway.

  5. changed the title [-]build failed on aarch64 centos 7.9[/-] [+]build failed on aarch64 centos 7.9 with gcc7.3[/+] on Jun 7, 2022
  6. alexcrichton commented on Jun 9, 2022

    @alexcrichton
    Member

    Fixed in #4195 so closing (thanks @akirilov-arm!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions