https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/ Issue: sci-libs/vtk-9.2.2-r1 overwrites user's optimization (-O*). Discovered on: amd64 (internal ref: ci) NOTE: unless there are known issues with -O* configured by the user, the build system should not overwrite -O*.
Created attachment 843111 [details] build.log.xz build log and emerge --info (compressed because it exceeds attachment limit, use 'xzless' to read it)
Unfortunately the QA message isn't very helpful, as it doesn't show where these assumed optimizations are overridden. The output at the end of the configure step looks like it respects the users optimization flags: -- <<< Gentoo configuration >>> Build type RelWithDebInfo Install path /usr Compiler flags: C -O2 -pipe -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 C++ -O2 -pipe -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 Linker flags: Executable -Wl,-lc -Wl,-lc -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 Module -Wl,-lc -Wl,-lc -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 Shared -Wl,-lc -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -- Configuring done Flags from the provided emerge --info: CFLAGS="-O2 -pipe -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0" CXXFLAGS="-O2 -pipe -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0" This doesn't look like they are overriden by the build system. AFAIK the build system always respects the CMAKE_C{,XX}_FLAGS when adding additional values to it, with the exception of the vtkm module, which wasn't built with this setup and where I also provide a patch to fix it.
[147/3311] /usr/bin/x86_64-pc-linux-gnu-g++ -DCommonMath_EXPORTS -DVTK_IN_VTK -Dkiss_fft_scalar=double -I/var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2_build/Common/Math -I/var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2/Common/Math -I/var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2_build/Common/Core -I/var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2/Common/Core -I/var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2_build/ThirdParty/kissfft/vtkkissfft -I/var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2/ThirdParty/kissfft/vtkkissfft -isystem /var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2_build/Utilities/KWIML -isystem /var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2/Utilities/KWIML -isystem /var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2_build/Utilities/KWSys -isystem /var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2/Utilities/KWSys -isystem /var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2_build/ThirdParty/kissfft -isystem /var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2/ThirdParty/kissfft -O2 -pipe -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -std=c++11 -O0 -MD -MT Common/Math/CMakeFiles/CommonMath.dir/vtkPolynomialSolversUnivariate.cxx.o -MF Common/Math/CMakeFiles/CommonMath.dir/vtkPolynomialSolversUnivariate.cxx.o.d -o Common/Math/CMakeFiles/CommonMath.dir/vtkPolynomialSolversUnivariate.cxx.o -c /var/tmp/portage/sci-libs/vtk-9.2.2-r1/work/VTK-9.2.2/Common/Math/vtkPolynomialSolversUnivariate.cxx
This is explicitly added for that specific file only, so I assume it is needed. I couldn't find any other optimizations (O1, O3, Os) in the build log. I'm going to ask upstream whether the options is still desired as needed, it's there for several years.