镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

clr.alljits subset fails cross-compiling for linux-x86 on linux-x64 #68044

Closed

Description

@ta264

Description

Cross-compiling the clr.alljits subset for linux-x86 on linux-x64 fails.

The issue seems to be related to building the win-x86 jit as commenting out this line lets the build succeed:

create_standalone_jit(TARGET clrjit_win_x86_${ARCH_HOST_NAME} OS win ARCH x86 DESTINATIONS .)

I think the solution might be to change TARGET_UNIX to HOST_UNIX here:

#ifndef TARGET_UNIX

Reproduction Steps

Checkout repo on ubuntu 20.04, build with

./eng/common/cross/build-rootfs.sh x86
./eng/build.sh -ci -c Release -cross -os Linux -arch x86 -subset clr.alljits

Expected behavior

Build succeeds

Actual behavior

Build fails with the error

Consolidate compiler generated dependencies of target gcinfo_win_x86
  [  4%] Built target jitinterface_x86
  [  4%] Built target gcinfo_universal_arm
  Consolidate compiler generated dependencies of target eventprovider
  [  4%] Building CXX object gcinfo/CMakeFiles/gcinfo_win_x86.dir/__/gcdump/gcdump.cpp.o
  [  4%] Building CXX object gcinfo/CMakeFiles/gcinfo_win_x86.dir/__/gcdump/i386/gcdumpx86.cpp.o
  Scanning dependencies of target libunwind
  Consolidate compiler generated dependencies of target libunwind
  [  4%] Built target eventprovider
  [  4%] Building C object /runtime/artifacts/obj/external/libunwind/CMakeFiles/libunwind.dir/runtime/src/native/external/libunwind/src/os-linux.c.o
  [  4%] Built target eventing_headers
  [  4%] Building C object /runtime/artifacts/obj/external/libunwind/CMakeFiles/libunwind.dir/runtime/src/native/external/libunwind/src/mi/init.c.o
  [  4%] Building C object /runtime/artifacts/obj/external/libunwind/CMakeFiles/libunwind.dir/runtime/src/native/external/libunwind/src/mi/flush_cache.c.o
  [  4%] Building C object /runtime/artifacts/obj/external/libunwind/CMakeFiles/libunwind.dir/runtime/src/native/external/libunwind/src/mi/mempool.c.o
  [  4%] Building C object /runtime/artifacts/obj/external/libunwind/CMakeFiles/libunwind.dir/runtime/src/native/external/libunwind/src/mi/strerror.c.o
  In file included from /runtime/src/coreclr/gcdump/i386/gcdumpx86.cpp:12:
  In file included from /runtime/src/coreclr/inc/utilcode.h:44:
  /runtime/src/coreclr/inc/clrnt.h:841:16: error: redefinition of '_RUNTIME_FUNCTION'
  typedef struct _RUNTIME_FUNCTION {
                 ^
  /runtime/src/coreclr/pal/inc/pal.h:3085:16: note: previous definition is here
  typedef struct _RUNTIME_FUNCTION {
                 ^
  In file included from /runtime/src/coreclr/gcdump/i386/gcdumpx86.cpp:12:
  In file included from /runtime/src/coreclr/inc/utilcode.h:44:
  /runtime/src/coreclr/inc/clrnt.h:846:16: error: redefinition of '_DISPATCHER_CONTEXT'
  typedef struct _DISPATCHER_CONTEXT {
                 ^
  /runtime/src/coreclr/pal/inc/rt/palrt.h:1205:16: note: previous definition is here
  typedef struct _DISPATCHER_CONTEXT {
                 ^
  In file included from /runtime/src/coreclr/gcdump/gcdump.cpp:14:
  In file included from /runtime/src/coreclr/inc/utilcode.h:44:
  /runtime/src/coreclr/inc/clrnt.h:841:16: error: redefinition of '_RUNTIME_FUNCTION'
  typedef struct _RUNTIME_FUNCTION {
                 ^
  /runtime/src/coreclr/pal/inc/pal.h:3085:16: note: previous definition is here
  typedef struct _RUNTIME_FUNCTION {
                 ^
  In file included from /runtime/src/coreclr/gcdump/gcdump.cpp:14:
  In file included from /runtime/src/coreclr/inc/utilcode.h:44:
  /runtime/src/coreclr/inc/clrnt.h:846:16: error: redefinition of '_DISPATCHER_CONTEXT'
  typedef struct _DISPATCHER_CONTEXT {
                 ^
  /runtime/src/coreclr/pal/inc/rt/palrt.h:1205:16: note: previous definition is here
  typedef struct _DISPATCHER_CONTEXT {
                 ^

Regression?

This built for .NET 5.0.3 (though the resulting product didn't function).

I think the regression may have been in #41126 but I'm not sure about this.

The build fails in .NET 6.0.3 also.

Known Workarounds

I think the solution might be to change TARGET_UNIX to HOST_UNIX here:

#ifndef TARGET_UNIX

Configuration

Attempting to cross-compile main commit 89b034d8e3.

Using Ubuntu 20.04 x64 VM under Windows 10 x64 hyper-v.

Other information

No response

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Apr 14, 2022
  2. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Apr 14, 2022
  3. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Apr 27, 2022
  4. removed
    untriagedNew issue has not been triaged by the area owner
    on May 6, 2022
  5. ghost locked as resolved and limited conversation to collaborators on Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions