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

About cross compile for SpecCPU06 #22

Open
Xxfore opened this issue Jul 13, 2023 · 3 comments
Open

About cross compile for SpecCPU06 #22

Xxfore opened this issue Jul 13, 2023 · 3 comments

Comments

@Xxfore
Copy link

Xxfore commented Jul 13, 2023

Hi,
Firstly , i hope run the benchmarks on a RISCV FPGA wich minimal linux kernel, So i want to do some cross-compile job on x86 server,
But as check your provide guide about build/run/copy instruction, I have few confuse about tool build.
Does it mean tools cant do cross-compile under such as x86 machine? it should build on a riscv machine with native compiler? From your guide and Spec official documation , i cant find any information about tool cross-compile build.

Hope your kindness reply.

@QL1115
Copy link

QL1115 commented Oct 15, 2023

Hi @Xxfore,

I'm not sure if this link below is what you're looking for. It mentioned Cross Compile and Triple Compile in the Environments section. Maybe you could search for the keyword "cross-compile" to find more information.

Runspec Avoidance

I encountered the same problem as you. In my approach, I used the pre-built tools on my x86 Linux and use the riscv.cfg file to compile (cross compilation) those benchmarks. After that, I put those files generated by --copy option into QEMU RISCV Linux.

@Xxfore
Copy link
Author

Xxfore commented Oct 31, 2023

Hi @Xxfore,

I'm not sure if this link below is what you're looking for. It mentioned Cross Compile and Triple Compile in the Environments section. Maybe you could search for the keyword "cross-compile" to find more information.

Runspec Avoidance

I encountered the same problem as you. In my approach, I used the pre-built tools on my x86 Linux and use the riscv.cfg file to compile (cross compilation) those benchmarks. After that, I put those files generated by --copy option into QEMU RISCV Linux.

Thank you so much for your kindness help.
I have tried to build target riscv benchmarks on x86 host by using Speckle,
When i run 403.gcc with command : gcc 166.in -o 166.s
it shows error like :

166.in:14985 : internal error : 4
It is possible that you may be trying to use SPEC's version of gcc 
without first defining the appropriate flags.  Please check the flags 
that are in the config files from recently-published results on your 
platform, and check that you are using an up-to-date compiler.  If
you still need help, please contact SPEC, reporting your hw/os 
platform, your compiler version, and your compilation flags.
Contact SPEC at xxxx

Have you ever meet this error before?

@QL1115
Copy link

QL1115 commented Oct 31, 2023

Hi, @Xxfore

  • Do you use riscv.cfg as the configuration file in gen_binaries.sh?
  • What is your CC, CXX, FC in your riscv.cfg?
  • Where do you run 403.gcc with command : gcc 166.in -o 166.s? on QEMU RISC-V Linux or anything else?
  • What information was shown when you used file ./gcc in 403.gcc folder?
  • You want to build 32 bits 403.gcc or 64 bits? What is your portability flags in your riscv.cfg?

In my case,
I use RISC-V GNU Toolchain 2021.06.18, which contains RISC-V GCC 10.2 (I use --enable-multilib option),
and I set the CC, CXX, FC to where I installed the tollchain in my riscv.cfg like the following:

CC  = riscv64-unknown-linux-gnu-gcc -static -Wl,-Ttext-segment,0x10000       -march=rv64imafdc -mabi=lp64d
CXX = riscv64-unknown-linux-gnu-g++ -static -Wl,-Ttext-segment,0x10000       -march=rv64imafdc -mabi=lp64d
FC  = riscv64-unknown-linux-gnu-gfortran -static -Wl,-Ttext-segment,0x10000  -march=rv64imafdc -mabi=lp64d

and the info of compiled 403.gcc (in 403.gcc after it compiled by RISC-V GCC) is like the following:

$ cd 403.gcc
$ file ./gcc
# ./gcc: ELF 64-bit LSB executable, UCB RISC-V, version 1 (SYSV), statically linked, for GNU/Linux 4.15.0, with debug_info, not stripped

I need more information about your environments.

QL

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

2 participants