I am change the macOS sdk to 10.13 when build the chromium in macOS 13.2 with M1 chip, what I have tried to change configure chromium/src/build/config/Mac/mac_sdk.gni
file and set sdk:
# Path to a specific version of the Mac SDK, not including a slash at the end.
# If empty, the path to the lowest version greater than or equal to
# `mac_sdk_min` is used.
mac_sdk_path = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk"
but this config show error:
In file included from ../../base/allocator/partition_allocator/page_allocator.cc:5:
In file included from ../../base/allocator/partition_allocator/page_allocator.h:9:
In file included from ../../buildtools/third_party/libc++/trunk/include/cstdint:146:
In file included from ../../buildtools/third_party/libc++/trunk/include/stdint.h:124:
In file included from ../../third_party/llvm-build/Release+Asserts/lib/clang/17/include/stdint.h:52:
In file included from ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk/usr/include/stdint.h:53:
In file included from ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk/usr/include/sys/_types/_intptr_t.h:30:
../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
#error architecture not supported
^
In file included from ../../base/allocator/partition_allocator/page_allocator.cc:5:
In file included from ../../base/allocator/partition_allocator/page_allocator.h:9:
In file included from ../../buildtools/third_party/libc++/trunk/include/cstdint:146:
In file included from ../../buildtools/third_party/libc++/trunk/include/stdint.h:124:
In file included from ../../third_party/llvm-build/Release+Asserts/lib/clang/17/include/stdint.h:52:
In file included from ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk/usr/include/stdint.h:53:
../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk/usr/include/sys/_types/_intptr_t.h:32:9: error: unknown type name '__darwin_intptr_t'
typedef __darwin_intptr_t intptr_t;
^
In file included from ../../base/allocator/partition_allocator/page_allocator.cc:5:
In file included from ../../base/allocator/partition_allocator/page_allocator.h:11:
In file included from ../../base/allocator/partition_allocator/page_allocator_constants.h:16:
In file included from ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk/usr/include/mach/vm_page_size.h:33:
In file included from ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk/usr/include/mach/mach_types.h:80:
In file included from ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk/usr/include/mach/host_info.h:66:
In file included from ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk/usr/include/mach/message.h:75:
In file included from ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk/usr/include/mach/port.h:91:
In file included from ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk/usr/include/mach/boolean.h:73:
../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/MacOSX-SDKs/MacOSX10.13.sdk/usr/include/mach/machine/boolean.h:35:2: error: architecture not supported
#error architecture not supported
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
ninja: build stopped: subcommand failed.
this is the build command:
autoninja -C out/Default chrome
what should I do to build the chromium success? is it possible to build with macOS sdk 10.13 + M1 chip
?
This is only possible for x86_64.
The first version of macOS to support arm64 hardware was macOS 11.0, so if you want to compile for M1 targets, you'll have to use the 11.0 SDK or newer.
But if you just want to build on M1 hosts, then you can use the 10.13 SDK to cross-compile Chrome for x86_64. According to this help page, the way to do that should simply be:
gn gen out/Default --args='target_cpu="x64"'