Skip to content
  • Philippe Mathieu-Daudé's avatar
    e3e477c3
    configure: Fix cross-building for RISCV host · e3e477c3
    Philippe Mathieu-Daudé authored
    While when building on native Linux the host architecture
    is reported as "riscv32" or "riscv64":
    
      Host machine cpu family: riscv64
      Host machine cpu: riscv64
      Found pkg-config: /usr/bin/pkg-config (0.29.2)
    
    Since commit ba0e7333 ("configure: Merge riscv32 and riscv64
    host architectures"), when cross-compiling it is detected as
    "riscv". Meson handles the cross-detection but displays a warning:
    
      WARNING: Unknown CPU family riscv, please report this at https://github.com/mesonbuild/meson/issues/new
      Host machine cpu family: riscv
      Host machine cpu: riscv
      Target machine cpu family: riscv
      Target machine cpu: riscv
      Found pkg-config: /usr/bin/riscv64-linux-gnu-pkg-config (1.8.1)
    
    Now since commit 278c1bce ("target/riscv: Only unify 'riscv32/64'
    -> 'riscv' for host cpu in meson") Meson expects the cpu to be in
    [riscv32, riscv64]. So when cross-building (for example on our
    cross-riscv64-system Gitlab-CI job) we get:
    
      WARNING: Unknown CPU family riscv, please report this at https://github.com/mesonbuild/meson/issues/new
    
    
      Host machine cpu family: riscv
      Host machine cpu: riscv
      Target machine cpu family: riscv
      Target machine cpu: riscv
      ../meson.build:684:6: ERROR: Problem encountered: Unsupported CPU riscv, try --enable-tcg-interpreter
    
    Fix by partially revert commit ba0e7333 so when cross-building
    the ./configure script passes the proper host architecture to meson.
    
    Fixes: ba0e7333 ("configure: Merge riscv32 and riscv64 host architectures")
    Fixes: 278c1bce ("target/riscv: Only unify 'riscv32/64' -> 'riscv' for host cpu in meson")
    Reported-by: default avatarRichard Henderson <richard.henderson@linaro.org>
    Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    Message-Id: <20230711110619.56588-1-philmd@linaro.org>
    Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
    e3e477c3
    configure: Fix cross-building for RISCV host
    Philippe Mathieu-Daudé authored
    While when building on native Linux the host architecture
    is reported as "riscv32" or "riscv64":
    
      Host machine cpu family: riscv64
      Host machine cpu: riscv64
      Found pkg-config: /usr/bin/pkg-config (0.29.2)
    
    Since commit ba0e7333 ("configure: Merge riscv32 and riscv64
    host architectures"), when cross-compiling it is detected as
    "riscv". Meson handles the cross-detection but displays a warning:
    
      WARNING: Unknown CPU family riscv, please report this at https://github.com/mesonbuild/meson/issues/new
      Host machine cpu family: riscv
      Host machine cpu: riscv
      Target machine cpu family: riscv
      Target machine cpu: riscv
      Found pkg-config: /usr/bin/riscv64-linux-gnu-pkg-config (1.8.1)
    
    Now since commit 278c1bce ("target/riscv: Only unify 'riscv32/64'
    -> 'riscv' for host cpu in meson") Meson expects the cpu to be in
    [riscv32, riscv64]. So when cross-building (for example on our
    cross-riscv64-system Gitlab-CI job) we get:
    
      WARNING: Unknown CPU family riscv, please report this at https://github.com/mesonbuild/meson/issues/new
    
    
      Host machine cpu family: riscv
      Host machine cpu: riscv
      Target machine cpu family: riscv
      Target machine cpu: riscv
      ../meson.build:684:6: ERROR: Problem encountered: Unsupported CPU riscv, try --enable-tcg-interpreter
    
    Fix by partially revert commit ba0e7333 so when cross-building
    the ./configure script passes the proper host architecture to meson.
    
    Fixes: ba0e7333 ("configure: Merge riscv32 and riscv64 host architectures")
    Fixes: 278c1bce ("target/riscv: Only unify 'riscv32/64' -> 'riscv' for host cpu in meson")
    Reported-by: default avatarRichard Henderson <richard.henderson@linaro.org>
    Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    Message-Id: <20230711110619.56588-1-philmd@linaro.org>
    Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Loading