-
Notifications
You must be signed in to change notification settings - Fork 285
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
build error #240
Comments
The the fundamental problem I figured out is related to cmake. One workaround is to modify the cmake_configure.zeroriscy.gcc.sh script to add the linker flags to the C_FLGAS in the script, but this is more like a hack. Another idea is to somehow make the riscv gcc use a default linker script so that it passes compiler probing, but use user-specified flags during real compilation. However, the riscv-gcc toolchain I compiled from the pulp doesn't seem to have a default linker script thus failing the compiler probe. Any ideas/comments? |
After working around the -m32 and compiler probing problem, now there is another problem "make helloworld": riscv32-unknown-elf/bin/ld: unrecognised emulation mode: elflriscv |
pulp-riscv-gnu-toolchain cannot be used with the current pulpino cmake flow you have to use this compiler instead: https://github.com/pulp-platform/ri5cy_gnu_toolchain |
I believe the correct toolchain for PULPino is this one: https://github.com/pulp-platform/ri5cy_gnu_toolchain (the one you are using is more up to date and we use it for PULP / PULPissimo, and it is used by derivatives e.g. https://github.com/GreenWaves-Technologies/gap_sdk). However, I am assigning the issue to @haugoug who might know better. |
Whoops, @haugoug was too fast for me :) |
That's good to know. Thanks for the replies! |
Well, the problem with https://github.com/pulp-platform/ri5cy_gnu_toolchain is that it failed to build: libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/home/wsun/ri5cy_gnu_toolchain/build/src/binutils/bfd -I. -I/home/wsun/ri5cy_gnu_toolchain/build/src/binutils/bfd -I/home/wsun/ri5cy_gnu_toolchain/build/src/binutils/bfd/../include -DHAVE_riscv_elf32_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec -DBINDIR="/home/wsun/ri5cy_gnu_toolchain/install/bin" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -g -O2 -MT elf32-riscv.lo -MD -MP -MF .deps/elf32-riscv.Tpo -c elf32-riscv.c -o elf32-riscv.o |
I'm running into the same problem trying to use this toolchain with CMake. In particular, the project I'm working on uses a line like
@dragonware-com you wouldn't happen to have any patches doing this floating around, would you? I tried just creating an empty riscv.ld in the temporary CMake build directory which is being used by
I'm stuck on the same at this point. @FrancescoConti, @haugoug, any advice appreciated. |
Hi @haugoug , as you said, pulp-riscv-gnu-toolchain cannot be used with the pulpino cmake flow. But the pulp-riscv-gnu-toolchain readme.md told that
Does it mean that the pulp-riscv-gnu-toolchain supports pulpino cores with some cmake modification? Thank you very much. |
Indeed pulp-riscv-gnu-toolchain should supports pulpino, this just requires a few modifications in the pulpino cmake flow. |
Thank you very much, haugoug |
So I just come across exactly the same problem, ri5cy_gnu_toolchain is failed to build, pulp-riscv-gnu-toolchain can be built but it doesn't support pulpino. Could @haugoug suggest a fix to the cmake flow? |
@dragonware-com I found a solution, by adding the following to my CMake files before doing the compiler probing:
The CMAKE_REQUIRED_FLAGS variable is exactly what you write about: it allows setting options for compiler probing only. It is not used during real compilation. |
(Note that you need to make an empty file named "empty-file.ld" in the directory containing your CMakeLists.txt for the above to work) |
@haugoug Great! Thanks for the effort! |
I am not hagoug but you are welcome! |
@mbolivar Sorry, thank you for the effort! |
@mbolivar, the issue remains on me, should I add this to the CMakeList.txt file before cmake version probing? Thanks. |
Hi @jasonchu024, I assume you are using a CMake function like check_c_compiler_flag() or some other function that calls check_c_source_compiles() as the "compiler probe" discussed in previous comments. In that case, yup, you will need to set this variable first. See https://cmake.org/cmake/help/latest/module/CheckCSourceCompiles.html#module:CheckCSourceCompiles for details. |
@mbolivar or @dragonware-com can you please specify where Thanks |
@sofchet I'm not sure how to answer your question unfortunately. People's individual CMake projects are going to vary a lot. They may contain one or more CMakeLists.txt files to control the project build. There may be multiple projects being integrated into a parent build system in this way. I've tried to clarify that if toolchain checks in functions like check_c_compiler_flag are the problem, they can be worked around as described above by using a dummy linker script. (If you already have a real linker script to use at this point in the build, so much the better, but the environment I'm working on can't figure out the real linker script until later in the build so I have to provide a dummy via See for example https://sourceware.org/binutils/docs/ld/Scripts.html for more information on linker scripts. See the gcc manpage for details on Good luck! |
Hi --- I just thought I'd ping this issue again. In my opinion, something is misconfigured with this ld. You can run Forcing the user to create a riscv.ld seems like a bug then: all the information to do a default link is already available to the linker. If that file is missing, there should be no error. |
Hi, With an empty linker script I get this as first error (when linking):
(followed by When I change the linker script to the output of
(that is indeed not mentioned in the linker script). FWIW, I was creating the toolchain using |
Add a special target that's marked build_only so the BLE SW LL implementation on VEGABoard is built daily. This helps ensuring that it doesn't get inadvertedly broken by subsequent updates. The name of the target is peripheral_hr_rv32m1_vega_ri5cy and it can be run with the following command: sanitycheck -v --all -p rv32m1_vega_ri5cy \ -x=CMAKE_REQUIRED_FLAGS=-Wl,-dT=/dev/null \ --test samples/bluetooth/peripheral_hr/\ sample.bluetooth.peripheral_hr_rv32m1_vega_ri5cy Note: The extra CMake flags are required due to this linker issue: pulp-platform/pulpino#240 Signed-off-by: Alex Porosanu <alexandru.porosanu@nxp.com>
Hi @stefanct , About the error:
The symbol Another solution I think is, don't use the |
Hi, I found the issue about missing The flag |
How to generate bitstream on pulpino using fpga zedboard or zybo.
set the environment variable BOARD. In the tcsh script file as steven BOARD
"Zybo"
also i did not specify the BOAD PART and BOARD NUMBER it will take default
XILINX_PART "xc7z020clg484-1" XILINX_BOARD "em.avnet.com:zynq:zed:c"
inside the environment variable set "RISCY_RV32F"
and set the vivado toolchain PATH and Xilinx SDK PATH as
export PATH=/root/pulpino/ri5cy_gnu_toolchain/install/bin:$PATH
export LD_LIBRARY_PATH=/root/pulpino/Xilinx/Vivado/2019.1/lib/lnx64.o
export PATH=/root/pulpino/Xilinx/Vivado/2019.1/bin:$PATH
export PATH=/root/pulpino/Xilinx/SDK/2019.1/bin:$PATH
export PATH=/root/pulpino/Xilinx/SDK/2019.1/gnu/microblaze/lin/bin:$PATH
export
PATH=/root/pulpino/Xilinx/SDK/2019.1/gnu/armr5/lin/gcc-arm-none-eabi/bin:$PATH
export
PATH=/root/pulpino/Xilinx/SDK/2019.1/gnu/microblaze/linux_toolchain/lin64_le/bin:$PATH
export PATH=/root/pulpino/Xilinx/DocNav:$PATH
After this i type "make all" targated to *"cmake_configure.riscvfloat.gcc.sh
<http://cmake_configure.riscvfloat.gcc.sh/>"* in the fpga directory i am
getting an error as
root@sunil-Inspiron-3542:~/pulpino/fpga# make all
make -C ips/xilinx_fp_fma/ clean all
make[1]: Entering directory '/root/pulpino/fpga/ips/xilinx_fp_fma'
rm -rf ip/*
mkdir -p ip
rm -rf xilinx_fp_fma.xpr
rm -rf xilinx_fp_fma.hw
rm -rf xilinx_fp_fma.data
rm -rf xilinx_fp_fma.runs
rm -rf xilinx_fp_fma.srcs
rm -rf xilinx_fp_fma.cache
rm -rf component.xml
rm -rf vivado*.jou
rm -rf vivado*.log
rm -rf vivado*.str
rm -rf xgui
vivado -mode batch -source tcl/run.tcl
****** Vivado v2019.1 (64-bit)
**** SW Build 2552052 on Fri May 24 14:47:09 MDT 2019
**** IP Build 2548770 on Fri May 24 18:01:18 MDT 2019
** Copyright 1986-2019 Xilinx, Inc. All Rights Reserved.
source tcl/run.tcl
# if { ![info exists ::env(XILINX_PART)] } {
# set ::env(XILINX_PART) "xc7z020clg484-1"
# }
# if { ![info exists ::env(XILINX_BOARD)] } {
# set ::env(XILINX_BOARD) "em.avnet.com:zynq:zed:c"
# }
# set partNumber $::env(XILINX_PART)
# set boardName $::env(XILINX_BOARD)
# create_project xilinx_fp_fma . -part $partNumber
ERROR: [Common 17-53] User Exception: Project already exists on disk,
please use '-force' option to overwrite:
/root/pulpino/fpga/ips/xilinx_fp_fma/xilinx_fp_fma.ip_user_files
INFO: [Common 17-206] Exiting Vivado at Mon Oct 21 16:41:39 2019...
Makefile:4: recipe for target 'all' failed
make[1]: *** [all] Error 1
make[1]: Leaving directory '/root/pulpino/fpga/ips/xilinx_fp_fma'
Makefile:33: recipe for target 'ips/xilinx_fp_fma/ip/xilinx_fp_fma.dcp'
failed
make: *** [ips/xilinx_fp_fma/ip/xilinx_fp_fma.dcp] Error 2
please let me know the issue.
Thank you
also please let know how to Prepare the SD card and the ZedBoard for
booting via SD card and Extract the content of the rootfs.tar archive and
put it on the second partition of the SD card
OR
it will enough to direct run the
"Running applications on PULPino"
please can help the issues
Thank you
…On Wed, Oct 23, 2019, 12:25 PM zejiangfish ***@***.***> wrote:
Hi,
I found the issue about missing riscv.ld is because of the LINK_SPEC
defined in
https://github.com/pulp-platform/pulp-riscv-gcc/blob/daa865ea46d212dee71872cabd390f700ac2f0c4/gcc/config/riscv/elf.h
The flag %{!T:-dT riscv.ld} means if the T is not defined in link
command, then use -dT riscv.ld. The detailed explanation could be found
here <https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html>. I removed this
line and rebuild the toolchain, the issue disappears.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#240?email_source=notifications&email_token=ANAORJNW5LCGZFHLGFH2BYLQP7YO7A5CNFSM4FSZRF4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECAJMJA#issuecomment-545297956>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANAORJJD5QQZ3K37GMK24HLQP7YO7ANCNFSM4FSZRF4A>
.
|
Note that doing this would break the build for any users that rely on this file implicitly being used as the linker script. They would all have to update their build systems to use -T riscv.ld manually. |
- The issue is pulp-platform/pulpino#240 - The root cause is, `LINK_SPEC` defined `-dT riscv.ld`, which means that if the `T` is not defined in link command, then use `-dT riscv.ld`. The workaround is user define `-dT=${CMAKE_CURRENT_LIST_DIR}/empty-file.ld` to override the default setting. - This patch removes the flag, then the workaround is not necessary. Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
Add a special target that's marked build_only so the BLE SW LL implementation on VEGABoard is built daily. This helps ensuring that it doesn't get inadvertedly broken by subsequent updates. The name of the target is peripheral_hr_rv32m1_vega_ri5cy and it can be run with the following command: sanitycheck -v --all -p rv32m1_vega_ri5cy \ -x=CMAKE_REQUIRED_FLAGS=-Wl,-dT=/dev/null \ --test samples/bluetooth/peripheral_hr/\ sample.bluetooth.peripheral_hr_rv32m1_vega_ri5cy Note: The extra CMake flags are required if running with the official VEGABoard compiler, due to this linker issue: pulp-platform/pulpino#240 Signed-off-by: Alex Porosanu <alexandru.porosanu@nxp.com>
Add a special target that's marked build_only so the BLE SW LL implementation on VEGABoard is built daily. This helps ensuring that it doesn't get inadvertedly broken by subsequent updates. The name of the target is peripheral_hr_rv32m1_vega_ri5cy and it can be run with the following command: sanitycheck -v --all -p rv32m1_vega_ri5cy \ -x=CMAKE_REQUIRED_FLAGS=-Wl,-dT=/dev/null \ --test samples/bluetooth/peripheral_hr/\ sample.bluetooth.peripheral_hr_rv32m1_vega_ri5cy Note: The extra CMake flags are required if running with the official VEGABoard compiler, due to this linker issue: pulp-platform/pulpino#240 Signed-off-by: Alex Porosanu <alexandru.porosanu@nxp.com>
So I built the riscv-gnu-toolchain without any problem (https://github.com/pulp-platform/pulp-riscv-gnu-toolchain), however, cmake_configure.zeroriscy.gcc.sh execution has some problems:
it says -m32 is not supported. So I removed the -m32 in cmake_configure.zeroriscy.gcc.sh. Then it has the second problem:
riscv32-unknown-elf/bin/ld: cannot open linker script file riscv.ld: No such file or directory
The text was updated successfully, but these errors were encountered: