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

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

Closed
ta264 opened this issue Apr 14, 2022 · 1 comment · Fixed by #68046
Closed

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

ta264 opened this issue Apr 14, 2022 · 1 comment · Fixed by #68046

Comments

@ta264
Copy link
Contributor

ta264 commented Apr 14, 2022

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

@dotnet-issue-labeler dotnet-issue-labeler bot added area-Infrastructure-coreclr untriaged New issue has not been triaged by the area owner labels Apr 14, 2022
@ghost
Copy link

ghost commented Apr 14, 2022

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

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

Author: ta264
Assignees: -
Labels:

area-Infrastructure-coreclr, untriaged

Milestone: -

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Apr 14, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Apr 27, 2022
@jeffhandley jeffhandley removed the untriaged New issue has not been triaged by the area owner label May 6, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants