[LINUX] Change compiler flags of bundled Clang.

17 views
Skip to first unread message

Michele Renosto

unread,
May 19, 2018, 2:50:43 PM5/19/18
to Chromium-dev
Hi, is it possible to compile with -march=native or -O3 using the bundled Clang?
Where does it gets -march=x86-64 and -O2

Allan Sandfeld Jensen

unread,
May 19, 2018, 4:40:39 PM5/19/18
to chromi...@chromium.org, compos...@hotmail.com
On Samstag, 19. Mai 2018 20:50:43 CEST Michele Renosto wrote:
> Hi, is it possible to compile with *-march=native *or *-O3* using the
> bundled Clang?
> Where does it gets* -march=x86-64* and* -O2*

They are both set in
build/config/compiler/BUILD.gn

The -march=x86-64 is always a good idea to change or just remove because it
does nothing in clang and in gcc it optimizes for AMD K8, which is not what
you want.

You can change -O2 to -O3 outside though by
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_speed" ]

This is already done for a number of modules where it is relevant.


'Allan


Reply all
Reply to author
Forward
0 new messages