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

Arm build leg failing in runtime for 8.0 P4 #3424

Closed
mthalman opened this issue Apr 26, 2023 · 11 comments
Closed

Arm build leg failing in runtime for 8.0 P4 #3424

mthalman opened this issue Apr 26, 2023 · 11 comments

Comments

@mthalman
Copy link
Member

      In file included from /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/nativeaot/Runtime/unix/UnwindHelpers.cpp:26:
      In file included from /vmr/src/runtime/artifacts/source-build/self/src/src/native/external/llvm-libunwind/src/UnwindCursor.hpp:44:
      /vmr/src/runtime/artifacts/source-build/self/src/src/native/external/llvm-libunwind/src/DwarfInstructions.hpp:234:33: error: unknown architectural extension: memtag
                                     ".arch_extension memtag\n"
                                      ^
      <inline asm>:2:17: note: instantiated into assembly here
      .arch_extension memtag
                      ^
      In file included from /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/nativeaot/Runtime/unix/UnwindHelpers.cpp:26:
      In file included from /vmr/src/runtime/artifacts/source-build/self/src/src/native/external/llvm-libunwind/src/UnwindCursor.hpp:44:
      /vmr/src/runtime/artifacts/source-build/self/src/src/native/external/llvm-libunwind/src/DwarfInstructions.hpp:235:33: error: instruction requires: mte
                                     "stg %[Ptr], [%[Ptr]]\n"
                                      ^
      <inline asm>:3:1: note: instantiated into assembly here
      stg x8, [x8]
      ^
      In file included from /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/nativeaot/Runtime/unix/UnwindHelpers.cpp:26:
      In file included from /vmr/src/runtime/artifacts/source-build/self/src/src/native/external/llvm-libunwind/src/UnwindCursor.hpp:44:
      /vmr/src/runtime/artifacts/source-build/self/src/src/native/external/llvm-libunwind/src/DwarfInstructions.hpp:234:33: error: unknown architectural extension: memtag
                                     ".arch_extension memtag\n"
                                      ^
      <inline asm>:2:17: note: instantiated into assembly here
      .arch_extension memtag
                      ^
      In file included from /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/nativeaot/Runtime/unix/UnwindHelpers.cpp:26:
      In file included from /vmr/src/runtime/artifacts/source-build/self/src/src/native/external/llvm-libunwind/src/UnwindCursor.hpp:44:
      /vmr/src/runtime/artifacts/source-build/self/src/src/native/external/llvm-libunwind/src/DwarfInstructions.hpp:235:33: error: instruction requires: mte
                                     "stg %[Ptr], [%[Ptr]]\n"
                                      ^
      <inline asm>:3:1: note: instantiated into assembly here
      stg x8, [x8]
      ^
      4 errors generated.
make[2]: *** [nativeaot/Runtime/Full/CMakeFiles/Runtime.WorkstationGC.dir/build.make:849: nativeaot/Runtime/Full/CMakeFiles/Runtime.WorkstationGC.dir/__/unix/UnwindHelpers.cpp.o] Error 1
      make[2]: *** Waiting for unfinished jobs....
      make[1]: *** [CMakeFiles/Makefile2:3179: nativeaot/Runtime/Full/CMakeFiles/Runtime.WorkstationGC.dir/all] Error 2
      make: *** [Makefile:149: all] Error 2
      /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr
##[error]Failed to build "CoreCLR component".

Build link (internal)

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@mthalman
Copy link
Member Author

Adding @jkotas @trylek for help.

@jkotas
Copy link
Member

jkotas commented Apr 26, 2023

@VSadov Is this the same issue you have into in dotnet/runtime#85283 (comment)?

@jkotas
Copy link
Member

jkotas commented Apr 26, 2023

@mthalman
Copy link
Member Author

FYI: We'll need to have this addressed for the Preview 4 release since it's blocking source-build.

@VSadov
Copy link
Member

VSadov commented Apr 26, 2023

@jkotas - yes it looks like the same issue.

@VSadov
Copy link
Member

VSadov commented Apr 26, 2023

It seems like the following fixes it. But we must be careful if we need to compile this with GCC.

   -                            ".arch_extension memtag\n"
   +                            ".arch_extension mte\n"

@VSadov
Copy link
Member

VSadov commented Apr 26, 2023

Perhaps do memtag for GCC and mte with clang, to be safe?

I do not know what exactly causes the break to appear. My change made it to appear, but it was completely unrelated.

@am11
Copy link
Member

am11 commented Apr 27, 2023

FYI: We'll need to have this addressed for the Preview 4 release since it's blocking source-build.

We shouldn't be using gcc toolchain in official legs as it is a community supported platform. Runtime builds are tested with clang, and that's what is recommended for end-users: https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/#prerequisites.

Things should work with gcc (nice to have) but it shouldn't block any official build.

@jkotas
Copy link
Member

jkotas commented Apr 27, 2023

This is clang build break. Here is a small test:

root@b18ef9da89c7:/# cat test.c
int main()
{
          void* p = 0;
          __asm__ __volatile__(".arch armv8.5-a\n"
                               ".arch_extension memtag\n"
                               "stg %[Ptr], [%[Ptr]]\n"
                               :
                               : [Ptr] "r"(p)
                               : "memory");
}
root@b18ef9da89c7:/# clang test.c
test.c:5:33: error: unknown architectural extension: memtag
                               ".arch_extension memtag\n"
                                ^
<inline asm>:2:17: note: instantiated into assembly here
.arch_extension memtag
                ^
test.c:6:33: error: instruction requires: mte
                               "stg %[Ptr], [%[Ptr]]\n"
                                ^
<inline asm>:3:1: note: instantiated into assembly here
stg x8, [x8]
^
2 errors generated.
root@b18ef9da89c7:/#

The build container with the failure is mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-arm64v8

@am11
Copy link
Member

am11 commented Apr 27, 2023

It requires a new(er) assembler: apt install -y clang-13 then calng-13 test.c succeeds. ref: https://reviews.llvm.org/D103726?id=350009#2862258

VSadov pushed a commit to VSadov/runtime that referenced this issue Apr 27, 2023
Works around build breaks with some compiler versions.

Fixes dotnet/source-build#3424
VSadov pushed a commit to jkotas/runtime that referenced this issue Apr 27, 2023
Works around build breaks with some compiler versions.

Fixes dotnet/source-build#3424
jkotas added a commit to dotnet/runtime that referenced this issue Apr 27, 2023
Works around build breaks with some compiler versions.

Fixes dotnet/source-build#3424
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants