Skip to content

[icu] fix mac os x64 build on apple arm#16433

Closed
autoantwort wants to merge 3 commits intomicrosoft:masterfrom
autoantwort:icu-mac
Closed

[icu] fix mac os x64 build on apple arm#16433
autoantwort wants to merge 3 commits intomicrosoft:masterfrom
autoantwort:icu-mac

Conversation

@autoantwort
Copy link
Contributor

Describe the pull request

That was the only successful way to generate x64 binaries on an arm mac. I tried many different approaches but that one was the only successful one. See here.

@autoantwort
Copy link
Contributor Author

I could image that another solution is to cross build from arm to x64 on mac, but than you need icu installed for the host triplet, so that solution is only possible when #15424 gets merged.

@autoantwort
Copy link
Contributor Author

Can you rerun the pipeline? The mac machine was offline.

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 16433 in repo microsoft/vcpkg

@JackBoosY JackBoosY self-assigned this Mar 1, 2021
@JackBoosY JackBoosY added category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist labels Mar 1, 2021
Copy link
Contributor

@ras0219-msft ras0219-msft left a comment

Choose a reason for hiding this comment

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

Let me know what path you'd like to take with this PR.

LOGNAME "configure-${RELEASE_TRIPLET}")
if(VCPKG_TARGET_IS_OSX AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
file(READ "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/icudefs.mk" FILE_CONTENTS)
string(REPLACE "CC = clang" "CC = clang -arch x86_64" FILE_CONTENTS ${FILE_CONTENTS})
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like -arch x86_64 should be part of the target CFLAGS. We might want to look at using

https://github.com/microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_internal_get_cmake_vars.cmake

to compute the right flags. Otherwise, this PR looks like an acceptable incremental improvement.

@autoantwort
Copy link
Contributor Author

Let me know what path you'd like to take with this PR.

I think the host triplet way is a better one. It will also make cross compiling from linux -> windows possible and other cross compiling scenarios. The only downside to my understanding is that you build the port twice if you are using for example the triplet x86-windows (x86-windows + x64-windows)

@JackBoosY JackBoosY requested a review from ras0219-msft March 2, 2021 02:28
@autoantwort
Copy link
Contributor Author

Ok currently #16504 prevents a solution with host triplets on macs.

@JackBoosY JackBoosY added depends:different-pr This PR or Issue depends on a PR which has been filed and removed depends:different-pr This PR or Issue depends on a PR which has been filed labels Mar 3, 2021
@JackBoosY
Copy link
Contributor

@autoantwort It looks like we have to fix issue #16504 first.

@JackBoosY JackBoosY added the depends:different-pr This PR or Issue depends on a PR which has been filed label Mar 3, 2021
@ras0219-msft
Copy link
Contributor

From #16504 (comment):

As a workaround, you can set VCPKG_HOST_TRIPLET as an environment variable or pass --host-triplet= on the command line to change which triplet to use as the host.

@ras0219-msft
Copy link
Contributor

While we would need to build the port "twice":

  1. We need to build the port twice anyway if we need a different host port that depends on icu
  2. We can avoid building the "tools" part in the cross-compiled port, which hopefully means the total build time won't be 2x

@autoantwort
Copy link
Contributor Author

We can avoid building the "tools" part in the cross-compiled port

Some of the tools are needed to cross compile and I don't know if you can only build the tools needed for cross compiling.

I think this can be closed in favour of #16577

@autoantwort autoantwort deleted the icu-mac branch September 1, 2021 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist depends:different-pr This PR or Issue depends on a PR which has been filed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[qt-base] build failure (icu is build for arm with x64-osx triplet)

3 participants