How to build chromium for intel Mac from arm an arm Mac?

982 views
Skip to first unread message

Obaid Ur Rehman

unread,
Oct 11, 2022, 1:18:57 PM10/11/22
to Chromium-dev
I am trying to build chromium for Mac devices. I have already built it for arm Mac which is M1 and M2 chips-based Mac devices but unable to build it for intel chip devices. I tried setting the target_cpu in GN args to 'x86' but it gives the error Do not know how to build a snapshot for //build/toolchain/mac:clang_x86. 

Dirk Pranke

unread,
Oct 11, 2022, 2:50:13 PM10/11/22
to obaid...@gmail.com, Chromium-dev
You want to use `target_cpu = 'x64'`, not 'x86'. x86 is a 32-bit build, which is not supported on Mac.

-- Dirk

On Tue, Oct 11, 2022 at 10:18 AM Obaid Ur Rehman <obaid...@gmail.com> wrote:
I am trying to build chromium for Mac devices. I have already built it for arm Mac which is M1 and M2 chips-based Mac devices but unable to build it for intel chip devices. I tried setting the target_cpu in GN args to 'x86' but it gives the error Do not know how to build a snapshot for //build/toolchain/mac:clang_x86. 

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/3a7829fa-0d65-48b8-9d2b-b212ecfd27b0n%40chromium.org.

Dirk Pranke

unread,
Oct 11, 2022, 4:51:53 PM10/11/22
to Obaid Ur Rehman, Chromium-dev
`target_cpu="x64"` should be for 64-bit intel/amd chips. `target_cpu="arm64"` should give you a native binary for the M1/M2.

Are you sure you're not getting an M1/M2/arm binary? I don't actually have an M1/M2 in front of me at the moment to test this; perhaps someone else on the list can chime in one way or another.

-- Dirk

On Tue, Oct 11, 2022 at 1:19 PM Obaid Ur Rehman <obaid...@gmail.com> wrote:
Thanks, @Dirk but  `target_cpu = 'x64' only builds binary for Apple silicon chips. How can I build for intel chips from M2 device?

Nick Harper

unread,
Oct 11, 2022, 6:52:08 PM10/11/22
to dpr...@google.com, Obaid Ur Rehman, Chromium-dev
I was able to on an arm mac confirm that by default the binary built is arm64, and if I specify target_cpu="x64" I get an x86_64 binary.

Obaid Ur Rehman

unread,
Oct 11, 2022, 7:21:51 PM10/11/22
to Chromium-dev, Dirk Pranke, Chromium-dev, Obaid Ur Rehman
Thanks, @Dirk but  `target_cpu = 'x64' only builds binary for Apple silicon chips. How can I build for intel chips from M2 device?

On Tuesday, October 11, 2022 at 11:50:13 PM UTC+5 Dirk Pranke wrote:

Obaid Ur Rehman

unread,
Oct 12, 2022, 1:17:00 PM10/12/22
to Chromium-dev, Obaid Ur Rehman, Dirk Pranke, Chromium-dev
Got it! Thanks guys.
For M1 & M2 chips:  `target_cpu = 'arm64'
For Intel chips:  `target_cpu = 'x64'
One last thing about the redistribution of the browser, when I download it on any other device, the browsers set the 'com.apple.quarantine bit' and displays an error message Chromium" is damaged and can't be opened. You should move it to the Trash. I know this could be fixed using xattr -rc command but is there any way to bypass this issue as doing this fix on every single machine won't be possible?

Dirk Pranke

unread,
Oct 12, 2022, 4:06:47 PM10/12/22
to Obaid Ur Rehman, Chromium-dev
I do not know the answer to this. I would vaguely guess that there's no way around it, but I could easily be wrong. Maybe someone else can speak more authoritatively.

-- Dirk
Reply all
Reply to author
Forward
0 new messages