Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are P* extensions supported for 32-bit toolchain ? #1298

Closed
vedanttalnikar opened this issue Jul 24, 2023 · 9 comments
Closed

Are P* extensions supported for 32-bit toolchain ? #1298

vedanttalnikar opened this issue Jul 24, 2023 · 9 comments

Comments

@vedanttalnikar
Copy link

I am getting below error:
riscv32-unknown-elf-ar rc ../libc.a *.o
riscv32-unknown-elf-ar: ../stdlib/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../time/lib.a: No such file or directory
riscv32-unknown-elf-ranlib libc.a

I used following build procedure:

$ git clone https://github.com/riscv-collab/riscv-gnu-toolchain.git
$ cd riscv-gnu-toolchain/
as mentioned in #1291 I used following repositories
$ git clone https://github.com/plctlab/riscv-gcc -b riscv-gcc-p-ext riscv-gcc-p-ext
$ git clone https://github.com/plctlab/riscv-binutils-gdb -b riscv-binutils-p-ext riscv-binutils-p-ext

$ ./configure --prefix=$RISCV32 --with-arch=rv32imafd_zpn_zifencei --with-abi=ilp32d --with-gcc-src=pwd/riscv-gcc-p-ext --with-binutils-src=pwd/riscv-binutils-p-ext
$ make

I have attached the make.log
where you can spot the actual error as mentioned below :
make.log

riscv-gnu-toolchain/newlib/newlib/libc/stdlib/rand.c:82:1: error: unrecognizable insn:
   82 | }
      | ^
(insn 19 18 20 2 (set (reg:DI 89)
        (mult:DI (zero_extend:DI (reg:SI 90))
            (zero_extend:DI (reg:SI 91)))) "/manjup/vedant/projects/RISCV/riscv32/riscv-gnu-toolchain/newlib/newlib/libc/stdlib
     (nil))
during RTL pass: vregs
/manjup/vedant/projects/RISCV/riscv32/riscv-gnu-toolchain/newlib/newlib/libc/stdlib/rand.c:82:1: internal compiler error: in ex
0x59ada8 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
    /manjup/vedant/projects/RISCV/riscv32/riscv-gnu-toolchain/riscv-gcc-p-ext/gcc/rtl-error.c:108
0x59adca _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
    /manjup/vedant/projects/RISCV/riscv32/riscv-gnu-toolchain/riscv-gcc-p-ext/gcc/rtl-error.c:116
0x59a2d0 extract_insn(rtx_insn*)
    /manjup/vedant/projects/RISCV/riscv32/riscv-gnu-toolchain/riscv-gcc-p-ext/gcc/recog.c:2294
0x8109ff instantiate_virtual_regs_in_insn
    /manjup/vedant/projects/RISCV/riscv32/riscv-gnu-toolchain/riscv-gcc-p-ext/gcc/function.c:1607
0x8109ff instantiate_virtual_regs
    /manjup/vedant/projects/RISCV/riscv32/riscv-gnu-toolchain/riscv-gcc-p-ext/gcc/function.c:1977
0x8109ff execute
    /manjup/vedant/projects/RISCV/riscv32/riscv-gnu-toolchain/ri
(https://github.com/riscv-collab/riscv-gnu-toolchain/files/12146110/make.log)
scv-gcc-p-ext/gcc/function.c:2026
Please submit a full bug report,

Is the current configuration mentioned in configure command supported by the toolchain or anything missing in the procedure ?

@kito-cheng
Copy link
Collaborator

Seem like you hit bug in their compiler implementation, cc @pz9115

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Jul 24, 2023

Seem like you hit bug in their compiler implementation, cc @pz9115

It would also be good if PLCT Lab enabled the GitHub Issues section of their repo so that the issue could be reported there rather than here.

Also - just for context, issue #1298 relates back to this issue #1291 which is now closed:

@pz9115
Copy link
Contributor

pz9115 commented Jul 24, 2023

I had repeated this bug, it seems exist some compatible problems with current riscv-gnu-tool chain repo. I will check it soon.

@pz9115
Copy link
Contributor

pz9115 commented Jul 25, 2023

@vedanttalnikar I had fixed this bug, now you can try build again on RV32, thanks for your report.

@vedanttalnikar
Copy link
Author

@pz9115 Thanks for the quick support.
Now the build is working fine for me :)

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Jul 25, 2023

The original build works but this one fails:

git clone https://github.com/riscv-collab/riscv-gnu-toolchain issue-1298
cd issue-1298
git clone https://github.com/plctlab/riscv-gcc -b riscv-gcc-p-ext riscv-gcc-p-ext
git clone https://github.com/plctlab/riscv-binutils-gdb -b riscv-binutils-p-ext riscv-binutils-p-ext
./configure --prefix=`pwd`/installed-tools --with-arch=rv32imafdp --with-abi=ilp32d --with-gcc-src=`pwd`/riscv-gcc-p-ext --with-binutils-src=`pwd`/riscv-binutils-p-ext
make 2>&1 | tee build.log

...
Making all in ssp
make[6]: Entering directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc/ssp'
riscv32-unknown-elf-gcc -B/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/ -isystem /home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/targ-include -isystem /home/user/Downloads/issue-1298/newlib/newlib/libc/include -B/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/libgloss/riscv32 -L/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/libgloss/libnosys -L/home/user/Downloads/issue-1298/newlib/libgloss/riscv32    -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"4.1.0\" -DPACKAGE_STRING=\"newlib\ 4.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I/home/user/Downloads/issue-1298/newlib/newlib/libc/ssp -fno-builtin -DHAVE_NANOSLEEP      -O2 -D_POSIX_MODE -ffunction-sections -fdata-sections    -mcmodel=medlow -c -o lib_a-chk_fail.o `test -f 'chk_fail.c' || echo '/home/user/Downloads/issue-1298/newlib/newlib/libc/ssp/'`chk_fail.c
Assembler messages:
Error: -march=rv32imaf_d0p0p_zbpbo_zpn_zpsf: unknown z ISA extension `zbpbo'
/tmp/ccVM4nNT.s:3: Error: -march=rv32i2p0_m2p0_a2p0_f2p0_d0p0_p2p0_zbpbo2p0_zpn2p0_zpsf2p0: unknown z ISA extension `zbpbo'
make[6]: *** [Makefile:397: lib_a-chk_fail.o] Error 1
make[6]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc/ssp'
Making all in .
make[6]: Entering directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc'
rm -f libc.a
rm -rf tmp
mkdir tmp
cd tmp; \
 for i in argz/lib.a stdlib/lib.a ctype/lib.a search/lib.a stdio/lib.a   string/lib.a signal/lib.a time/lib.a locale/lib.a reent/lib.a  errno/lib.a misc/lib.a ssp/lib.a   syscalls/lib.a  machine/lib.a ; do \
   riscv32-unknown-elf-ar x ../$i; \
 done; \
riscv32-unknown-elf-ar rc ../libc.a *.o
riscv32-unknown-elf-ar: ../argz/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../stdlib/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../ctype/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../search/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../stdio/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../string/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../signal/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../time/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../locale/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../reent/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../errno/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../misc/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../ssp/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../syscalls/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../machine/lib.a: No such file or directory
riscv32-unknown-elf-ar: *.o: No such file or directory
make[6]: *** [Makefile:1034: libc.a] Error 1
make[6]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc'
make[5]: *** [Makefile:683: all-recursive] Error 1
make[5]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc'
make[4]: *** [Makefile:641: all-recursive] Error 1
make[4]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib'
make[3]: *** [Makefile:452: all] Error 2
make[3]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib'
make[2]: *** [Makefile:8492: all-target-newlib] Error 2
make[2]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib'
make[1]: *** [Makefile:879: all] Error 2
make[1]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib'
make: *** [Makefile:623: stamps/build-newlib] Error 2

Full compressed build log: build.log.tar.gz

@pz9115
Copy link
Contributor

pz9115 commented Jul 26, 2023

The original build works but this one fails:

git clone https://github.com/riscv-collab/riscv-gnu-toolchain issue-1298
cd issue-1298
git clone https://github.com/plctlab/riscv-gcc -b riscv-gcc-p-ext riscv-gcc-p-ext
git clone https://github.com/plctlab/riscv-binutils-gdb -b riscv-binutils-p-ext riscv-binutils-p-ext
./configure --prefix=`pwd`/installed-tools --with-arch=rv32imafdp --with-abi=ilp32d --with-gcc-src=`pwd`/riscv-gcc-p-ext --with-binutils-src=`pwd`/riscv-binutils-p-ext

Since the P extension

make 2>&1 | tee build.log

...
Making all in ssp
make[6]: Entering directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc/ssp'
riscv32-unknown-elf-gcc -B/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/ -isystem /home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/targ-include -isystem /home/user/Downloads/issue-1298/newlib/newlib/libc/include -B/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/libgloss/riscv32 -L/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/libgloss/libnosys -L/home/user/Downloads/issue-1298/newlib/libgloss/riscv32 -DPACKAGE_NAME="newlib" -DPACKAGE_TARNAME="newlib" -DPACKAGE_VERSION="4.1.0" -DPACKAGE_STRING="newlib\ 4.1.0" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -I. -I/home/user/Downloads/issue-1298/newlib/newlib/libc/ssp -fno-builtin -DHAVE_NANOSLEEP -O2 -D_POSIX_MODE -ffunction-sections -fdata-sections -mcmodel=medlow -c -o lib_a-chk_fail.o test -f 'chk_fail.c' || echo '/home/user/Downloads/issue-1298/newlib/newlib/libc/ssp/'chk_fail.c
Assembler messages:
Error: -march=rv32imaf_d0p0p_zbpbo_zpn_zpsf: unknown z ISA extension zbpbo' /tmp/ccVM4nNT.s:3: Error: -march=rv32i2p0_m2p0_a2p0_f2p0_d0p0_p2p0_zbpbo2p0_zpn2p0_zpsf2p0: unknown z ISA extension zbpbo'
make[6]: *** [Makefile:397: lib_a-chk_fail.o] Error 1
make[6]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc/ssp'
Making all in .
make[6]: Entering directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc'
rm -f libc.a
rm -rf tmp
mkdir tmp
cd tmp;
for i in argz/lib.a stdlib/lib.a ctype/lib.a search/lib.a stdio/lib.a string/lib.a signal/lib.a time/lib.a locale/lib.a reent/lib.a errno/lib.a misc/lib.a ssp/lib.a syscalls/lib.a machine/lib.a ; do
riscv32-unknown-elf-ar x ../$i;
done;
riscv32-unknown-elf-ar rc ../libc.a *.o
riscv32-unknown-elf-ar: ../argz/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../stdlib/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../ctype/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../search/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../stdio/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../string/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../signal/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../time/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../locale/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../reent/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../errno/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../misc/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../ssp/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../syscalls/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../machine/lib.a: No such file or directory
riscv32-unknown-elf-ar: *.o: No such file or directory
make[6]: *** [Makefile:1034: libc.a] Error 1
make[6]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc'
make[5]: *** [Makefile:683: all-recursive] Error 1
make[5]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc'
make[4]: *** [Makefile:641: all-recursive] Error 1
make[4]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib'
make[3]: *** [Makefile:452: all] Error 2
make[3]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib'
make[2]: *** [Makefile:8492: all-target-newlib] Error 2
make[2]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib'
make[1]: *** [Makefile:879: all] Error 2
make[1]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib'
make: *** [Makefile:623: stamps/build-newlib] Error 2


Full compressed build log: [build.log.tar.gz](https://github.com/riscv-collab/riscv-gnu-toolchain/files/12164503/build.log.tar.gz)

The original build works but this one fails:

git clone https://github.com/riscv-collab/riscv-gnu-toolchain issue-1298
cd issue-1298
git clone https://github.com/plctlab/riscv-gcc -b riscv-gcc-p-ext riscv-gcc-p-ext
git clone https://github.com/plctlab/riscv-binutils-gdb -b riscv-binutils-p-ext riscv-binutils-p-ext
./configure --prefix=`pwd`/installed-tools --with-arch=rv32imafdp --with-abi=ilp32d --with-gcc-src=`pwd`/riscv-gcc-p-ext --with-binutils-src=`pwd`/riscv-binutils-p-ext
make 2>&1 | tee build.log

...
Making all in ssp
make[6]: Entering directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc/ssp'
riscv32-unknown-elf-gcc -B/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/ -isystem /home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/targ-include -isystem /home/user/Downloads/issue-1298/newlib/newlib/libc/include -B/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/libgloss/riscv32 -L/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/libgloss/libnosys -L/home/user/Downloads/issue-1298/newlib/libgloss/riscv32    -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"4.1.0\" -DPACKAGE_STRING=\"newlib\ 4.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I/home/user/Downloads/issue-1298/newlib/newlib/libc/ssp -fno-builtin -DHAVE_NANOSLEEP      -O2 -D_POSIX_MODE -ffunction-sections -fdata-sections    -mcmodel=medlow -c -o lib_a-chk_fail.o `test -f 'chk_fail.c' || echo '/home/user/Downloads/issue-1298/newlib/newlib/libc/ssp/'`chk_fail.c
Assembler messages:
Error: -march=rv32imaf_d0p0p_zbpbo_zpn_zpsf: unknown z ISA extension `zbpbo'
/tmp/ccVM4nNT.s:3: Error: -march=rv32i2p0_m2p0_a2p0_f2p0_d0p0_p2p0_zbpbo2p0_zpn2p0_zpsf2p0: unknown z ISA extension `zbpbo'
make[6]: *** [Makefile:397: lib_a-chk_fail.o] Error 1
make[6]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc/ssp'
Making all in .
make[6]: Entering directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc'
rm -f libc.a
rm -rf tmp
mkdir tmp
cd tmp; \
 for i in argz/lib.a stdlib/lib.a ctype/lib.a search/lib.a stdio/lib.a   string/lib.a signal/lib.a time/lib.a locale/lib.a reent/lib.a  errno/lib.a misc/lib.a ssp/lib.a   syscalls/lib.a  machine/lib.a ; do \
   riscv32-unknown-elf-ar x ../$i; \
 done; \
riscv32-unknown-elf-ar rc ../libc.a *.o
riscv32-unknown-elf-ar: ../argz/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../stdlib/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../ctype/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../search/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../stdio/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../string/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../signal/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../time/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../locale/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../reent/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../errno/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../misc/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../ssp/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../syscalls/lib.a: No such file or directory
riscv32-unknown-elf-ar: ../machine/lib.a: No such file or directory
riscv32-unknown-elf-ar: *.o: No such file or directory
make[6]: *** [Makefile:1034: libc.a] Error 1
make[6]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc'
make[5]: *** [Makefile:683: all-recursive] Error 1
make[5]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib/libc'
make[4]: *** [Makefile:641: all-recursive] Error 1
make[4]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib'
make[3]: *** [Makefile:452: all] Error 2
make[3]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib/riscv32-unknown-elf/newlib'
make[2]: *** [Makefile:8492: all-target-newlib] Error 2
make[2]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib'
make[1]: *** [Makefile:879: all] Error 2
make[1]: Leaving directory '/home/user/Downloads/issue-1298/build-newlib'
make: *** [Makefile:623: stamps/build-newlib] Error 2

Full compressed build log: build.log.tar.gz

@TommyMurphyTM1234 Repeated and fixed this problem, thanks

@TommyMurphyTM1234
Copy link
Collaborator

@cmuellner / @kito-cheng / others ...

Can/should this issue be closed?

It doesn't really seem to be a valid riscv-gnu-toolchain issue as far as I can see.
It seems to be an issue with the PCLT fork of the tools:

And/or this long open PR

on the riscv-gcc repo (riscv-gcc-experiment branch):

It's still unclear to me what the precise purpose of the riscv-gcc repo is, what active development is ongoing there, and why/when anybody would use it instead of upstream gcc.

@cmuellner
Copy link
Collaborator

Yes, we can close this issue because it is not directly related to the riscv-gnu-toolchain repo or repositories that are referenced by the submodules.

It is a valid issue (thank you for reporting), but the issue tracker of this repo is not the right place. We don't need to be too strict on this, but after three months it is reasonable to close it here. Especially since the issue got recognition from the owner of the affected code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants