-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
8e90057
to
ee8243f
Compare
arm only for mac, intense facepalm |
0850197
to
9882093
Compare
welp, this needs to be redone now |
No description provided.