-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[boost] linking failure on Mac M1 arm64-osx #16630
Comments
I think you have to use |
I don't think that helps, as I forgot to say in the above description that I set the environment variable |
I have just removed boost and installed it again with explicit triplet command line parameter as suggested, but nothing changed. It is reported that boost is installed for arm64, but the errors are the same as above when trying to link:
and
|
Ok can reproduce this. boost build creates x86_64 binaries even if you pass |
can you explain where exactly should I add that in the vcpkg port, and how to do this efficiently for all boost ports? |
As a quickfix add |
@autoantwort thx for trying to help, but that does not work for me, boos does not compile anymore; I guess I'll wait for the real fix in |
Ok strange. So your new file looks like:
What errors you get now? |
yes, here is the error file:
|
Hm. My config is nearly the same (see here). The only difference is that it is using the build in zlib library. |
is really no one interested in using boost on arm64? |
Seems not, because x64 just works, but I have created an issue at boost-build |
Does it work if you remove this line? |
yes, I confirm that by removing that line it works on arm64 |
@autoantwort Hi, is it possible that we can build universal libraries for boost? Here is my command: However when I check:
I am using boost 1.72.0 any suggestions? Thank you! |
This workaround (remove |
Even if I remove |
Never mind, I found they are copied to installed/arch/share/boost-build and used from there. So it's necessary to remove and reinstall boost-modular-build-helper to get the new files in place. I can confirm, removing --hash is not sufficient to get arm64 libraries generated. |
Building off the universal binary link above, the following modification to ports/boost-modular-build-helper/CMakeLists.txt appears to build both x64 and arm64 binaries, depending on the target. --- a/ports/boost-modular-build-helper/CMakeLists.txt
+++ b/ports/boost-modular-build-helper/CMakeLists.txt
@@ -46,7 +46,11 @@ else()
endif()
if(APPLE)
- list(APPEND B2_OPTIONS target-os=darwin toolset=clang)
+ if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
+ list(APPEND B2_OPTIONS target-os=darwin toolset=darwin cxxflags=\"-arch;arm64\")
+ else()
+ list(APPEND B2_OPTIONS target-os=darwin toolset=clang)
+ endif()
elseif(WIN32)
list(APPEND B2_OPTIONS target-os=windows toolset=gcc)
elseif(ANDROID) |
Hey @treellama! I tried your solution and it definitelly works and boost builds for
But I'm sure this is the separate problem. Could you please create PR with your change? |
I definitely did not try to build all of boost, just the modules our project needs. I can submit a PR but jamming cxxflags in is not ideal, and ordinarily would break overriding of CXXFLAGS, but according to #11132 that is already broken :D |
Possibly fixed by: #18529. |
@cdcseacave, could you help double confirm if this has been resolved? |
yes, this is solved now, thx |
Thanks for your response! |
Host Environment
To Reproduce
Steps to reproduce the behavior:
./vcpkg install boost
followed by trying to link to boost in any app.
Failure logs
Many error of this type:
The text was updated successfully, but these errors were encountered: