How to set `-march=skylake-avx512` on a file correctly

24 views
Skip to first unread message

John Stiles

unread,
Nov 20, 2023, 1:07:52 PM11/20/23
to ChromiumOS Development
Hi there! I am working on some Skia optimizations (specifically in skcms, the color management package) and I've hit a stumbling block that seems to involve the ChromeOS build system.

Previously, we would put Haswell/AVX512 optimizations into the same cc file as the rest of skcms, and used __attribute__(target…) to enable it. (We ensure that we only call these functions when the CPU supports it, of course.) However, due to a bug/ABI issue in Clang, __attribute__(target…) can generate pretty lousy code in some cases (https://github.com/llvm/llvm-project/issues/64706). To counteract this, I'm splitting the architecture-specific code out into separate cc files with -march= specified directly as a build flag. This is handled here:


This works fine in most cases. Unfortunately, in Lacros and ChromeOS builds only, I get a build error because -march=x86-64 -msse3 has been tacked onto the command line after my -march flag, overriding it.


It's not obvious to me how I should work around this issue. I am not sure where the extra -march is being added or how I can neutralize it.

Any help would be most appreciated—thanks in advance! 

Mike Frysinger

unread,
Nov 20, 2023, 1:11:13 PM11/20/23
to John Stiles, chromium-dev
it sounds like you're compiling code under chromium/src/ which is a browser question, not an OS question, so you want to ask on chromium-dev@ instead
-mike

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-dev
Reply all
Reply to author
Forward
0 new messages