Comments (8)
No, it's a workaround to resolve the problem that you cannot create an arm64 chroot on M1 systems, so you are forced to build inside an x86_64 chroot, and cmake misinterprets that as you wanting to build for x86_64 natively.
I have a fix that I'm about to commit that should resolve this.
from pkgsrc.
@jperkin @schmonz Do you think it will be possible to find another solution than b04d790?
How to reproduce the building issue on arm64
in an x86_64
chroot ?
from pkgsrc.
Certainly if there's a solution that avoids this that'd be preferable. Hard to see how removing -arch
causes ld: library not found for -lSystem
though, it should just use the default.
It's currently impossible to create arm64 chroots at all, so the only way to build arm64 packages is inside an x86_64 chroot.
from pkgsrc.
The patch is causing the sysroot
and syslibroot
are not added.
With -arch
patch:
Linking C executable cmTC_32a5e
/usr/local/pkg/bin/cmake -E cmake_link_script CMakeFiles/cmTC_32a5e.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_32a5e.dir/CMakeCCompilerABI.c.o -o cmTC_32a5e
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin21.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 12.0.0 12.0.0 -o cmTC_32a5e -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_32a5e.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/lib/darwin/libclang_rt.osx.a
@(#)PROGRAM:ld PROJECT:ld64-711
BUILD 21:57:11 Nov 17 2021
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
Library search paths:
/usr/lib
/usr/local/lib
Framework search paths:
/Library/Frameworks/
/System/Library/Frameworks/
ld: library not found for -lSystem
Without -arch
patch (working with sysroot and syslibroot):
Linking C executable cmTC_39687
/usr/local/Cellar/cmake/3.22.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_39687.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_39687.dir/CMakeCCompilerABI.c.o -o cmTC_39687
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin21.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 12.0.0 12.1 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -o cmTC_39687 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_39687.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/lib/darwin/libclang_rt.osx.a
@(#)PROGRAM:ld PROJECT:ld64-711
BUILD 21:57:11 Nov 17 2021
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
Library search paths:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib
Framework search paths:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/
Parsed C implicit include dir info from above output: rv=done
from pkgsrc.
Yeh I see this now, I'll figure something out.
from pkgsrc.
Is this patch is needed to add macOS M1 (arm based) support:
https://en.wikipedia.org/wiki/Apple_M1
?
I think such kind of patches should be submitted upstream in cmake:
https://gitlab.kitware.com/cmake/cmake
It will allow to gather feedback about implementation and the new features will be available to everyone (not only in pkgsrc).
Could you please create ticket on CMake project?
from pkgsrc.
@jperkin Can you also backport this patch to pkgsrc-2021Q4
branch:
https://github.com/NetBSD/pkgsrc/tree/pkgsrc-2021Q4/devel/cmake
from pkgsrc.
Have you tried to use the CMAKE_APPLE_SILICON_PROCESSOR
cmake variable, to choose which architecture has to be build: https://cmake.org/cmake/help/latest/variable/CMAKE_APPLE_SILICON_PROCESSOR.html
from pkgsrc.
Related Issues (20)
- Cross-compiling on Linux (native) for QNX (target) HOT 2
- Request to add tintin++ from pkgsrc-wip HOT 2
- cmake : build static linked executable failed HOT 2
- graphics/netpbm installation is failing on Ubuntu 22.04 HOT 1
- pkgtools/libnbcompat: unable to compile with GCC 11 (default compilers Ubuntu 22.04) HOT 2
- pkgtools/libnbcompat: incorrect sha256 hashes with -fstrict-aliasing HOT 8
- bootstrap failed on Artix Linux: ERROR: Circular dependency detected HOT 2
- ERROR: Circular dependency detected HOT 4
- HP UX 11.31 Variable OS_VERSION is recursive HOT 1
- Nagios plugins breaking in Freebsd 13.1 Release HOT 1
- Bootstrapping fails on OpenMPTCProuter v0.59 (a build of OpenWRT) HOT 13
- awk detection is broken on Musl-based Linux distros HOT 9
- Makefile:10: *** missing separator. Stop. HOT 1
- bmake: "/usr/share/mk/*" line n: Malformed conditional HOT 4
- Apply security patches HOT 1
- Kdenlive Compilation Error
- An OpenWRT derivative misses some programs HOT 3
- Error when bootstraping libarchive HOT 2
- `cc` is not found during AWK bootstrapping on OpenMPTCProuter HOT 1
- Lifting the gotosocial amd64 restriction HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pkgsrc.