Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 940530 - www-client/chromium: add ability to specify custom *FLAGS
Summary: www-client/chromium: add ability to specify custom *FLAGS
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-30 13:16 UTC by Benjamino Masyura
Modified: 2024-10-02 07:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Add ability to specify custom *FLAGS when building Chromium (9002-add-ability-to-specify-custom-flags.patch,1.40 KB, patch)
2024-09-30 13:16 UTC, Benjamino Masyura
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamino Masyura 2024-09-30 13:16:21 UTC
Created attachment 904249 [details, diff]
Add ability to specify custom *FLAGS when building Chromium

At the moment, the Chromium build system does not allow you to pass your own *FLAGS to the build system, which makes it impossible to pass optimisation flags (`-march=native`, etc.) or override incorrect target architecture definitions (as far as I know, this occasionally happens on ARM64).

I use a patch that adds this feature together with custom ebuild. 

Attached the patch.

Here are the corresponding lines in the modified ebuild:

 if ! use custom-cflags; then
     strip-flags
 fi
 myconf_gn+=" custom_cflags=[ $(echo ${CFLAGS} | tr ' ' ',' | sed 's/,/\", \"/g; s/^/\"/; s/$/\"/') ]"
 myconf_gn+=" custom_ldflags=[ $(echo ${LDFLAGS} | tr ' ' ',' | sed 's/,/\", \"/g; s/^/\"/; s/$/\"/') ]"
 myconf_gn+=" custom_rustflags=[ $(echo ${RUSTFLAGS} | sed 's/-C \([^ ]*\)/-C\1/g' | sed 's/-Z \([^ ]*\)/-Z\1/g' | tr ' ' ',' | sed 's/,/\", \"/g; s/^/\"/; s/$/\"/') ]"


It's not very pretty, but it works and that's good enough for me.

Source: https://codeberg.org/benjama/chromium-vitallium/src/commit/378a1301054aa88171b194f22c33b0721be32267/custom/9002-add-ability-to-specify-custom-flags.patch
Comment 1 Larry the Git Cow gentoo-dev 2024-10-02 07:19:15 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1137a053f17d447d92c3a76e77541c639b174118

commit 1137a053f17d447d92c3a76e77541c639b174118
Author:     Matt Jolly <kangie@gentoo.org>
AuthorDate: 2024-10-02 07:05:17 +0000
Commit:     Matt Jolly <kangie@gentoo.org>
CommitDate: 2024-10-02 07:18:15 +0000

    www-client/google-chrome: automated update (129.0.6668.89)
    
    Bug: https://bugs.gentoo.org/940530
    Signed-off-by: Matt Jolly <kangie@gentoo.org>

 www-client/google-chrome/Manifest                                       | 2 +-
 ...e-chrome-129.0.6668.70.ebuild => google-chrome-129.0.6668.89.ebuild} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
Comment 2 Matt Jolly gentoo-dev 2024-10-02 07:20:26 UTC
Sorry, mistyped the bug for the chrome binary update. I'll take a look at this when I have time.