Hi Hoa, Using the -static flag results in an output warning of: Using 'dlopen' in statically linked applications requires the shared libraries from the glibc version used for linking. Then on simulation: "fatal: syscall sched_getaffinity (#123) unimplemented".
On 4/29/22, Hoa Nguyen <hoangu...@ucdavis.edu> wrote: > Hi, > > If it is an option in your case, you can compile the workload statically by > adding "--static" to the gcc command. > > Regards, > Hoa Nguyen > > On Fri, Apr 29, 2022, 15:50 Felipe Vega <felipe.veg...@ug.uchile.cl> wrote: > >> Hi Boris, >> >> sorry I forgot some details: >> >> $ riscv64-unknown-elf-gcc helloworld.c -o binario.riscv ---> compiles and >> run. >> The thing the helloworld I use includes "#include<omp.h>" because my >> true workload needs this library. >> $ riscv64-unknown-elf-gcc helloworld.c -fopenmp -o binario.riscv ---> >> won't compile >> $ riscv64-unknown-linux-gnu-gcc helloworld.c -fopenmp -o binario.riscv >> ---> compiles >> if no interp-dir present ---> complains "failed to open >> /lib/ld-linux-riscv64-lpd64d.so.1" >> with interp-dir ---> complains "Someone allocated physical memory >> ..." >> >> >> The output of file is: >> binario.riscv: ELF 64-bit LSB executable, UCB RISC-V, RVC, >> double-float ABI, version 1 (SYSV), dynamically linked, interpreter >> /lib/ld-linux-riscv64-lp64d.so.1, for GNU/Linux 4.15.0, with >> debug_info, not stripped >> >> I'm not shure what flags for objdump would be helpful and I don't want >> to clutter this message. Please let me know if you need it. >> >> Thanks for answering, >> Felipe >> >> On 4/29/22, Boris Shingarov <shinga...@labware.com> wrote: >> > Felipe, >> > >> > What do `file` and `riscv-linux-gnu-objdump` (or whatever your >> > cross-toolchain calls objdump) say about `binario.riscv`? I don't know >> > where that "--interp-dir sysroot" in your output came from, but it >> > smells like we are dealing with dynamic-ELF here and I suggest you >> > start >> > from the much simpler static-ELF first. What happens if you invoke gcc >> > manually with something like >> > >> > riscv-linux-gnu-gcc -o binario.riscv helloworld.c >> > >> > does that work? >> > >> > Regards, >> > >> > Boris >> > >> > On 4/29/22 02:12, Felipe Vega wrote: >> >> Hi, >> >> >> >> I know it might be a basic question, and I've seen it asked in similar >> >> form but can't find (understand, really) the answer. I'm trying to run >> >> a simple program in SE mode using the GNU cross compiler toolchain. >> >> When i run it i get the following output: >> >> >> ------------------------------------------------------------------------------------------- >> >> gem5 version 21.2.1.0 >> >> gem5 compiled Apr 23 2022 01:10:08 >> >> gem5 started Apr 29 2022 01:34:49 >> >> gem5 executing on fvAIO, pid 32017 >> >> command line: build/RISCV/gem5.opt configs/example/se.py --interp-dir >> >> /opt/riscv/sysroot/ --cmd ../../versionC/c/binario.riscv >> >> >> >> Setting the interpreter path to: /opt/riscv/sysroot/ >> >> For dynamically linked applications you might still need to setup the >> >> --redirects so that libraries are found >> >> >> >> Global frequency set at 1000000000000 ticks per second >> >> warn: No dot file generated. Please install pydot to generate the dot >> >> file and pdf. >> >> build/RISCV/mem/mem_interface.cc:791: warn: DRAM device capacity (8192 >> >> Mbytes) does not match the address range assigned (512 Mbytes) >> >> 0: system.remote_gdb: listening for remote gdb on port 7000 >> >> **** REAL SIMULATION **** >> >> build/RISCV/sim/simulate.cc:194: info: Entering event queue @ 0. >> >> Starting simulation... >> >> build/RISCV/sim/mem_state.cc:443: info: Increasing stack size by one >> >> page. >> >> build/RISCV/sim/mem_state.cc:99: panic: Someone allocated physical >> >> memory at VA 0x4000000000000000 without creating a VMA! >> >> ----------------------------------------------------------------------- >> >> >> >> I get this output even when I use a "Hello World" program. >> >> Browsing on the project folders I found examples of compilation for >> >> x86 using docker, so I tried to run it using gcc and the Makefile >> >> found in the project, and again the gcc (v 11.2.0) doesn't work but >> >> the docker version does. >> >> >> >> Is this the issue, do I have to compile the RISCV version using a >> >> similar method, in which case how can I do that? Am I missing >> >> something obvious? Sorry if its too RTFM but I really don't >> >> understand? >> >> _______________________________________________ >> >> gem5-users mailing list -- gem5-users@gem5.org >> >> To unsubscribe send an email to gem5-users-le...@gem5.org >> > >> _______________________________________________ >> gem5-users mailing list -- gem5-users@gem5.org >> To unsubscribe send an email to gem5-users-le...@gem5.org >> > _______________________________________________ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org