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

Link error #4

Open
Fresher14 opened this issue Nov 10, 2020 · 1 comment
Open

Link error #4

Fresher14 opened this issue Nov 10, 2020 · 1 comment

Comments

@Fresher14
Copy link

Hi,
I tried this nice project in a unix environment.
It compiles but I had to use additional compilation flags:
-std=c++11
-D_GLIBCXX_USE_CXX11_ABI=0

Now the link error:
g++ -O2 -L*** -L./lib -L../../isa_sim obj/riscv_tcm_top_rtl.o obj/main.o -o build/test.x -lsystemc -lisa_sim -lsyscverilated -lelf -lbfd
obj/main.o: In function testbench::process()': main.cpp:(.text._ZN9testbench7processEv[_ZN9testbench7processEv]+0x41): undefined reference to cosim::attach_cpu(std::string, cosim_cpu_api*)'
main.cpp:(.text._ZN9testbench7processEv[_ZN9testbench7processEv]+0x8a): undefined reference to cosim::attach_mem(std::string, cosim_mem_api*, unsigned int, unsigned int)' ld: build/test.x: hidden symbol bfd_check_format_matches' in /usr/lib64/libbfd.a(format.o) is referenced by DSO
ld: final link failed: Bad value

Looking inside the content of isa_sim library, it seems to be there though:
0000000000009e60 T cosim::attach_cpu(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, cosim_cpu_api*)
0000000000009f30 T cosim::attach_mem(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, cosim_mem_api*, unsigned int, unsigned int)

@riverchen306
Copy link

Hi,
i have met the same proplem. you can try this :
cd ../../isa_sim
make clean // --- to clear the *.o file under the obj/riscv-sim path
make
cd ../top_tcm_axi/tb
make

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