theodelrieu / conan-darwin-toolchain

Conan build require to cross build to any darwin platform
MIT License
31 stars 21 forks source link

Architecture problem with clang + Conan #4

Closed sssilver closed 5 years ago

sssilver commented 6 years ago

This toolchain doesn't work with the current clang + Conan.

Problem

In conanfile.py, it says:

cflags.extend(["-arch",` darwin_arch])                                                                               
self.cpp_info.cflags = cflags                                                                                   
link_flags = copy.copy(common_flags)                                                                            
link_flags.append("-arch %s" % darwin_arch)

Since these flags are passed to clang, clang wants darwin_arch to be set to arm64. However, that makes Conan complain:

ERROR: Invalid setting 'arm64' is not a valid 'settings.arch' value.
Possible values are ['armv6', 'armv7', 'armv7hf', 'armv7k', 'armv7s', 'armv8', 'avr', 'mips', 'mips64', 'ppc64', 'ppc64le', 'sparc', 'sparcv9', 'x86', 'x86_64']

To Conan, "arm64" doesn't exist; instead it refers to it as "armv8" (which is technically incorrect--armv8 can operate in both 32 and 64 bit modes).

Solution

We had to modify conanfile.py to pass arm64 to clang and armv8 to Conan, to keep both happy.

sssilver commented 6 years ago

This is blocking our project; would you accept a pull request to fix the issue? I would consider forking, but I'm not sure how much of a headache it is to go through setting up a Conan repository on Bintray.

theodelrieu commented 5 years ago

I'm very sorry for the delay, apparently Github did not turn on notifications for my own project....

The issue should be fixed thanks to the addition of Apple Tools in Conan though