Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 951052 - dev-libs/intel-metrics-library: Doesn't respect CFLAGS
Summary: dev-libs/intel-metrics-library: Doesn't respect CFLAGS
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Jan Henke
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-09 19:38 UTC by Jonas Rakebrandt
Modified: 2025-04-10 17:37 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Rakebrandt 2025-03-09 19:38:27 UTC
During the upgrade from 1.0.182 to 1.0.196 I noticed Clang throwing the following warning:

> clang: warning: argument '-Ofast' is deprecated; use '-O3 -ffast-math' for the same behavior, or '-O3' to enable only conforming optimizations [-Wdeprecated-ofast]

Turns out CMakeLists.txt sets -Ofast [1] and -flto [2] overriding the user's *FLAGS.

[1] https://github.com/intel/metrics-library/blob/metrics-library-1.0.196/CMakeLists.txt#L625
[2] https://github.com/intel/metrics-library/blob/metrics-library-1.0.196/CMakeLists.txt#L647
Comment 1 unhappy-ending 2025-04-10 17:37:05 UTC
Indeed, I have noticed this, too.

I altered the .ebuild to:

src_prepare() {
	sed -e '/-flto/d' -i CMakeLists.txt
	sed -e '/-fPIE/d' -i CMakeLists.txt
	sed -e '/-Ofast/d' -i CMakeLists.txt
	sed -e '/-Werror/d' -i CMakeLists.txt || die
	cmake_src_prepare
}

On a LLVM/Clang+libc++ system LLD was throwing out recompile with -fPIC errors so in addition to the -flto and -Ofast so I also removed -fPIE as well.