chromium: (cross) strip aarch64-linux-gnu- toolprefix only for native builds

Our existing chromium expression strips the `aarch64-linux-gnu-`
prefix off of toolchain names (like `aarch64-linux-gnu-gcc`) for all
`Aarch64` builds.  But when we are doing a cross compile *to* an
`Aarch64` hostPlatform we need to leave those prefixes in place.

This commit makes the prefix-stripping conditional on the build
being a native build.
This commit is contained in:
Adam Joseph
2023-04-22 18:41:35 -07:00
parent f6f7b673d4
commit 954e7dc3d1
@@ -239,7 +239,7 @@ let
# Allow building against system libraries in official builds
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' tools/generate_shim_headers/generate_shim_headers.py
'' + lib.optionalString stdenv.isAarch64 ''
'' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform && stdenv.hostPlatform.isAarch64) ''
substituteInPlace build/toolchain/linux/BUILD.gn \
--replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""'
'' + lib.optionalString ungoogled ''