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

Fix armel cross build of native part of libraries #32127

Merged
merged 1 commit into from
Feb 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ if(CLR_CMAKE_HOST_UNIX_ARM)
set(CLR_CMAKE_HOST_ARCH_ARM 1)
set(CLR_CMAKE_HOST_ARCH "arm")

if(CLR_CMAKE_HOST_HOST_ARMV7L)
if(CLR_CMAKE_HOST_UNIX_ARMV7L)
set(CLR_CMAKE_HOST_ARCH_ARMV7L 1)
endif()
elseif(CLR_CMAKE_HOST_UNIX_ARM64)
Expand Down Expand Up @@ -169,6 +169,12 @@ endif()
# if target arch is not specified then host & target are same
if(NOT DEFINED CLR_CMAKE_TARGET_ARCH OR CLR_CMAKE_TARGET_ARCH STREQUAL "" )
set(CLR_CMAKE_TARGET_ARCH ${CLR_CMAKE_HOST_ARCH})

# This is required for "arm" targets (CMAKE_SYSTEM_PROCESSOR "armv7l"),
# for which this flag otherwise won't be set up below
if (CLR_CMAKE_HOST_ARCH_ARMV7L)
set(CLR_CMAKE_TARGET_ARCH_ARMV7L 1)
endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines shouldn't be needed. Line 190 below should be sufficient. Any reason this is duplicated here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated my commit, this would be a better solution. Problem was that we ended up with

CLR_CMAKE_HOST_UNIX_ARM 1
CLR_CMAKE_HOST_UNIX_ARMV7L 1
CLR_CMAKE_HOST_ARCH_ARM 1
CLR_CMAKE_HOST_ARCH "arm"
CLR_CMAKE_HOST_ARCH_ARMV7L 1

which lead to

CLR_CMAKE_TARGET_ARCH "arm"
CLR_CMAKE_TARGET_ARCH_ARM 1

Now, CLR_CMAKE_HOST_ARCH "armel" and target will be set correctly.

Copy link
Contributor

@sdmaclea sdmaclea Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need set(ARM_SOFTFP 1) here to? From your previous discussion, I assume Line 191 below will not be reached.

Or

set(CLR_CMAKE_TARGET_ARCH "armel")

And let the code below set the variables.
OR

set(CLR_CMAKE_HOST_ARCH "armel")

in 141 above. If this would work it seems the cleanest.

Copy link
Member Author

@gbalykov gbalykov Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARM_SOFTFP=1 is passed from outside for this case (see ./eng/native/gen-buildsys.sh), so it is not needed here.
We can't set neither CLR_CMAKE_TARGET_ARCH to "armel", nor CLR_CMAKE_HOST_ARCH, because we actually can't distinguish armel from arm here (CLR_CMAKE_HOST_ARCH_ARMV7L=1, CLR_CMAKE_HOST_UNIX_ARMV7L=1 for both).

endif()

# Set target architecture variables
Expand All @@ -182,6 +188,7 @@ if (CLR_CMAKE_TARGET_ARCH STREQUAL x64)
set(CLR_CMAKE_TARGET_ARCH_ARM 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL armel)
set(CLR_CMAKE_TARGET_ARCH_ARM 1)
set(CLR_CMAKE_TARGET_ARCH_ARMV7L 1)
set(ARM_SOFTFP 1)
else()
clr_unknown_arch()
Expand Down