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

Update RISCV64 image #854

Closed
wants to merge 3 commits into from
Closed

Update RISCV64 image #854

wants to merge 3 commits into from

Conversation

clamp03
Copy link
Member

@clamp03 clamp03 commented Apr 21, 2023

- Remove lld-15 due to libcoreclr.so link error
- Install binutils-riscv64-linux-gnu
@clamp03
Copy link
Member Author

clamp03 commented Apr 21, 2023

I removed lld-15 because of the below error message.
I will fix in runtime source.

[ 96%] Linking CXX static library libcoreclr_static.a
[ 96%] Linking CXX shared library libcoreclr.so
ld.lld: error: relocation R_RISCV_64 cannot be used against symbol 'UnhandledExceptionHandlerUnix'; recompile with -fPIC
>>> defined in ../../../vm/wks/CMakeFiles/cee_wks_core.dir/__/exceptionhandling.cpp.o
>>> referenced by ../../../vm/wks/CMakeFiles/cee_wks_core.dir/__/riscv64/asmhelpers.S.o:(.eh_frame+0xAC812)
[ 96%] Built target coreclr_static
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [dlls/mscoree/coreclr/CMakeFiles/coreclr.dir/build.make:941: dlls/mscoree/coreclr/libcoreclr.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:4254: dlls/mscoree/coreclr/CMakeFiles/coreclr.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
/work/dotnet/jobs/riscv/upstream/src/coreclr
Failed to build "CoreCLR component".

@clamp03 clamp03 marked this pull request as draft April 21, 2023 07:31
@clamp03 clamp03 marked this pull request as ready for review April 21, 2023 08:39
@clamp03
Copy link
Member Author

clamp03 commented Apr 21, 2023

In my opinion, the failure is due to download.freebsd.org. I didn't change anything in ubuntu-18.04.
@jkotas @mthalman Please review.

@mthalman
Copy link
Member

Yes, the build is blocked by #855.

@am11
Copy link
Member

am11 commented Apr 21, 2023

@clamp03, do you see that reloc error with lld-16? If not, then IMO, change 15 to 16 on this line

RUN wget -O- https://apt.llvm.org/llvm.sh | bash -s -- 15 \
without installing binutils.

@clamp03
Copy link
Member Author

clamp03 commented Apr 23, 2023

@clamp03, do you see that reloc error with lld-16? If not, then IMO, change 15 to 16 on this line

RUN wget -O- https://apt.llvm.org/llvm.sh | bash -s -- 15 \

without installing binutils.

I already tested with 16. And it has same error.
My solution is that set linker to bfd in the runtime and installs bintuils in the image.
Thank you.

@am11
Copy link
Member

am11 commented Apr 24, 2023

Here is the PR fixing the linker error dotnet/runtime#83682.

@clamp03
Copy link
Member Author

clamp03 commented Apr 24, 2023

@am11 Thank you.
I tested with your patch (dotnet/runtime#83682), but it still fails with the same error.
With mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-riscv64-20230414124529-3fc5553, it fails.
Next, I installed some packages with 16 on mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-coredeps-20230414124529-507c1c3 , it also fails.

If you successfully built the runtime with dotnet/runtime#83682, could you please let me know how to?
Thank you.

@am11
Copy link
Member

am11 commented Apr 24, 2023

We now get a preemptive symbol error explained in https://maskray.me/blog/2021-01-09-copy-relocations-canonical-plt-entries-and-protected. I have pushed another commit which explicitly specifies the visibility.

This command succeeds when I apply the current dotnet/runtime#83682 on main:

$ docker run --rm -v$(pwd):/runtime -e ROOTFS_DIR=/crossrootfs/riscv64 \
  mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-riscv64-20230420175531-3fc5553 \
  /runtime/build.sh clr -cross -a riscv64

@clamp03
Copy link
Member Author

clamp03 commented Apr 24, 2023

@am11 Wow. It works well!! Thanks for the link and the patch.

@clamp03 clamp03 closed this Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants