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

Allow cross compiling from m1 to intel on Macos #22

Closed
wants to merge 2 commits into from

Conversation

hellozee
Copy link
Member

@hellozee hellozee commented Aug 1, 2022

No description provided.

@hellozee hellozee requested a review from dean0x7d August 1, 2022 13:39
conanfile.py Outdated
@@ -264,6 +264,10 @@ def _build(self, dest_dir):
if self.conanfile.settings.os == "Linux":
env_vars["LDFLAGS"] += " -Wl,-rpath,'$$ORIGIN/../lib' -Wl,--disable-new-dtags"

# cause for some reason the CFLAGS are update but not the LDFLAGS
if self.conanfile.settings.os == "Macos" and self.conanfile.settings.arch == "x86_64":
env_vars["LDFLAGS"] += " -arch x86_64"
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be the bug: conan-io/conan#9252 It seems to be generally applicable for cross-compiling with auto tools. However, it might be also related to us not using the --profile:build/--profile:host feature of Conan, or have you tried that already?

But regardless of that, we need both cross-compiling cases covered on macOS: ARM -> x86 and x86 -> ARM. This is because our current Mac CI is x86.

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean something like this,

os=Macos
os_build=Macos
arch=armv8
arch_build=x86_64
compiler=clang
compiler.version=14
compiler.libcxx=libc++
build_type=Release
[options]
[build_requires]
[env]

Copy link
Member

Choose a reason for hiding this comment

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

That's the old way of doing it (Conan < v1.24). See here for the new way (2 profile files): https://docs.conan.io/en/latest/systems_cross_building/cross_building.html#conan-v1-24-and-newer

Copy link
Member Author

Choose a reason for hiding this comment

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

The old way didn't work (probably cause we don't use the variables in the recipe) but I don't see a way to leverage the new way into our existing pipeline

Copy link
Member

Choose a reason for hiding this comment

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

OK, then forget all that. Could you just ensure that macOS ARM on x86 works the same that you already set up x86 on ARM? Add an entry to the changelog and bump the patch version.

@hellozee
Copy link
Member Author

hellozee commented Aug 5, 2022

arm only for mac, intense facepalm

@hellozee hellozee marked this pull request as draft August 24, 2022 07:44
@hellozee
Copy link
Member Author

hellozee commented Mar 6, 2023

welp, this needs to be redone now

@hellozee hellozee closed this Mar 6, 2023
@dean0x7d dean0x7d deleted the intel-mac-cross branch June 13, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants