build: Introduce cros_target_cpu_arch GN arg [chromium/src : main]

0 views
Skip to first unread message

Bob Haarman (Gerrit)

unread,
Oct 22, 2025, 4:52:52 PMOct 22
to Nico Weber, chromium...@chromium.org
Attention needed from Nico Weber

Bob Haarman added 1 comment

File build/config/compiler/arch.gni
Line 12, Patchset 4: target_cpu_arch = ""
Nico Weber . resolved

Thanks!

Two requests:

1. Since these archs are only used in a single .gn file, can we declare them there, instead of making a dedicated gni file?

2. Can we call this `cros_target_cpu_arch` and only use this if `target_os == "chromeos"`? (I imagine that's enough even for the android sub-part of a cros build?)

Bob Haarman

Sure, happy to make those changes.

I'll keep the `arm_arch` functionality the way it is now so that it continues to apply even if `target_os != "chromeos"`. And then `cros_target_cpu_arch` will apply only if `target_os == "chromeos"`, the same way `cros_extra_*flags` do today.

Bob Haarman

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Nico Weber
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ifcdb1344659f4bcd5f9a8f7dea2be61bacbe17f7
Gerrit-Change-Number: 7073192
Gerrit-PatchSet: 6
Gerrit-Owner: Bob Haarman <ingl...@chromium.org>
Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
Gerrit-Attention: Nico Weber <tha...@chromium.org>
Gerrit-Comment-Date: Wed, 22 Oct 2025 20:52:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Weber <tha...@chromium.org>
Comment-In-Reply-To: Bob Haarman <ingl...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Nico Weber (Gerrit)

unread,
Oct 22, 2025, 7:15:42 PMOct 22
to Bob Haarman, Nico Weber, chromium...@chromium.org
Attention needed from Bob Haarman

Nico Weber added 5 comments

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Nico Weber . resolved

Thanks!

Since I think we only need this for x64 and aarch64 on cros (...right?) and since those currently don't globally set `march=` there, maybe this can become a bit more targeted still (see below).

I wonder how https://source.chromium.org/chromium/chromium/src/+/main:third_party/zlib/BUILD.gn;l=155?q=march%3D%20f:%5C.gn interacts with a global -march flag, but I suppose that isn't new to this CL here. The specific order on the commandline might be different, probably worth verifying that the relative order of the two march flags doesn't change for these examples :)

File build/config/compiler/BUILD.gn
Line 958, Patchset 6 (Parent): if (current_cpu == "arm") {
Nico Weber . unresolved

Since cros no longer ships 32-bit arm, I think this can stay as it was.

Line 1331, Patchset 6 (Latest): cflags += [ "-msse3" ]
Nico Weber . unresolved
```
if (target_os == "chromeos" && cros_target_cpu_arch != "" &&
current_cpu == target_cpu) {
cflags += [ "-march=cros_target_cpu_arch" ]
ldflags += [ "-march=cros_target_cpu_arch" ]
}
```
Line 1358, Patchset 6 (Latest): }
Nico Weber . unresolved
```
if (target_os == "chromeos" && cros_target_cpu_arch != "" &&
current_cpu == target_cpu) {
cflags += [ "-march=cros_target_cpu_arch" ]
ldflags += [ "-march=cros_target_cpu_arch" ]
}
```
Line 1380, Patchset 6 (Latest): march = "mipsel"
Nico Weber . unresolved

We don't ship mipsel cros, do we? Maybe this can stay as-is?

Open in Gerrit

Related details

Attention is currently required from:
  • Bob Haarman
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifcdb1344659f4bcd5f9a8f7dea2be61bacbe17f7
    Gerrit-Change-Number: 7073192
    Gerrit-PatchSet: 6
    Gerrit-Owner: Bob Haarman <ingl...@chromium.org>
    Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
    Gerrit-Attention: Bob Haarman <ingl...@chromium.org>
    Gerrit-Comment-Date: Wed, 22 Oct 2025 23:15:37 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Bob Haarman (Gerrit)

    unread,
    Dec 5, 2025, 10:08:45 PM (6 hours ago) Dec 5
    to Nico Weber, chromium...@chromium.org
    Attention needed from Nico Weber

    Bob Haarman added 4 comments

    File build/config/compiler/BUILD.gn
    Line 958, Patchset 6 (Parent): if (current_cpu == "arm") {
    Nico Weber . resolved

    Since cros no longer ships 32-bit arm, I think this can stay as it was.

    Bob Haarman

    Done

    Line 1331, Patchset 6: cflags += [ "-msse3" ]
    Nico Weber . resolved
    ```
    if (target_os == "chromeos" && cros_target_cpu_arch != "" &&
    current_cpu == target_cpu) {
    cflags += [ "-march=cros_target_cpu_arch" ]
    ldflags += [ "-march=cros_target_cpu_arch" ]
    }
    ```
    Bob Haarman

    Done

    Line 1358, Patchset 6: }
    Nico Weber . resolved
    ```
    if (target_os == "chromeos" && cros_target_cpu_arch != "" &&
    current_cpu == target_cpu) {
    cflags += [ "-march=cros_target_cpu_arch" ]
    ldflags += [ "-march=cros_target_cpu_arch" ]
    }
    ```
    Bob Haarman

    Done

    Line 1380, Patchset 6: march = "mipsel"
    Nico Weber . resolved

    We don't ship mipsel cros, do we? Maybe this can stay as-is?

    Bob Haarman

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Nico Weber
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ifcdb1344659f4bcd5f9a8f7dea2be61bacbe17f7
      Gerrit-Change-Number: 7073192
      Gerrit-PatchSet: 7
      Gerrit-Owner: Bob Haarman <ingl...@chromium.org>
      Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
      Gerrit-Attention: Nico Weber <tha...@chromium.org>
      Gerrit-Comment-Date: Sat, 06 Dec 2025 03:08:31 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Nico Weber <tha...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Bob Haarman (Gerrit)

      unread,
      Dec 5, 2025, 10:27:43 PM (5 hours ago) Dec 5
      to Nico Weber, chromium...@chromium.org
      Attention needed from Nico Weber

      Bob Haarman voted Commit-Queue+1

      Commit-Queue+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Nico Weber
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ifcdb1344659f4bcd5f9a8f7dea2be61bacbe17f7
      Gerrit-Change-Number: 7073192
      Gerrit-PatchSet: 7
      Gerrit-Owner: Bob Haarman <ingl...@chromium.org>
      Gerrit-Reviewer: Bob Haarman <ingl...@chromium.org>
      Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
      Gerrit-Attention: Nico Weber <tha...@chromium.org>
      Gerrit-Comment-Date: Sat, 06 Dec 2025 03:27:24 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages