Skip to content

Cannot build using --host=riscv64-unknown-linux-gnu #337

Description

@MarcoBonino

When running with the following settings I cannot build:

../configure --prefix=$RISCV --host=riscv64-unknown-linux-gnu --with-arch=rv64imafdc_zifencei

I get this error:

riscv64-unknown-linux-gnu-ranlib libmachine.a
riscv64-unknown-linux-gnu-gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -fno-PIE  -march=rv64imafdc_zifencei -mabi=lp64 -DBBL_LOGO_FILE=\"bbl_logo_file\" -DMEM_START=0x80000000 -fno-stack-protector -U_FORTIFY_SOURCE -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../util/snprintf.c
In file included from /home/makko/cross-compiler-riscv64/riscv-gnu-toolchain/build-linux/sysroot/usr/include/features.h:535,
                 from /home/makko/cross-compiler-riscv64/riscv-gnu-toolchain/build-linux/sysroot/usr/include/bits/libc-header-start.h:33,
                 from /home/makko/cross-compiler-riscv64/riscv-gnu-toolchain/build-linux/sysroot/usr/include/stdint.h:26,
                 from /home/makko/cross-compiler-riscv64/riscv-gnu-toolchain/build-linux/lib/gcc/riscv64-unknown-linux-gnu/13.2.0/include/stdint.h:9,
                 from ../util/snprintf.c:3:
/home/makko/cross-compiler-riscv64/riscv-gnu-toolchain/build-linux/sysroot/usr/include/gnu/stubs.h:14:11: fatal error: gnu/stubs-lp64.h: No such file or directory
   14 | # include <gnu/stubs-lp64.h>
      |           ^~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:336: snprintf.o] Error 1

For more context:

$ ls /home/makko/cross-compiler-riscv64/riscv-gnu-toolchain/build-linux/sysroot/usr/include/gnu
libc-version.h  lib-names.h  lib-names-lp64d.h  stubs.h  stubs-lp64d.h

I'm using the compiler from https://github.com/riscv-collab/riscv-gnu-toolchain doing "Installation (Linux)":

./configure --prefix=my_path
make linux

I also tried passing --with-arch=rv64imafdc_zifencei (thinking the compiler was for a restricted architecture) but same result.

Am I building the compiler correctly ?
The issue is due to this repo or the toolchain (Linux) repo ?

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions