OpenXiangShan / NEMU

Other
236 stars 90 forks source link

build: enable -fPIC to avoid relocation against the same label #473

Closed Ziyue-Zhang closed 2 months ago

Ziyue-Zhang commented 2 months ago
poemonsense commented 2 months ago

I do not know about -fPIC. Any test for this?

Or maybe other people familar with this should have a review. I don't know much about this option

Ziyue-Zhang commented 2 months ago

I do not know about -fPIC. Any test for this?

Or maybe other people familar with this should have a review. I don't know much about this option

when I run make riscv64-xs_defconfig and make, there is a compilation failure. Using -fPIC can solve it. I also don't know why using -fPIC can solve this problem, fpic is generally used when compiling dynamic link libraries. Maybe using fpic doesn't really solve the problem.

Following is my compile error: