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!