Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#73185 - [benchmark] package built without optimization, while requiring optimization

Attached to Project: Community Packages
Opened by Michał Janiszewski (janisozaur) - Wednesday, 29 December 2021, 09:46 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Wednesday, 05 January 2022, 11:10 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Massimiliano Torromeo (mtorromeo)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The package is built with optimization turned off. The nature of package and upstream build instructions require it is built with optimization turned on.

https://github.com/archlinux/svntogit-community/blob/packages/benchmark/trunk/PKGBUILD#L26

https://github.com/google/benchmark#debug-vs-release

I have confirmed this is really the case by modifying current pkgbuild to include `VERBOSE=1` whan `make`ing and observed logs to be missing any kind of `-O` options being passed to compiler.
This task depends upon

Closed by  Massimiliano Torromeo (mtorromeo)
Wednesday, 05 January 2022, 11:10 GMT
Reason for closing:  No response
Comment by Michał Janiszewski (janisozaur) - Wednesday, 29 December 2021, 15:43 GMT
In a separate email Massimiliano explained this is due to the optimization flags having already been set through makepkg.conf. In my test I indeed have changed makepkg.conf to showcase the issue, but I have previously modified it with additional options and assumed `-O2` present there was something I configured for my system myself.

Is there any guide on setting the cmake build types for packages and what to expect from makepkg.conf? Can this choice be documented at least in the form of a comment in the pkgbuild?
Comment by Massimiliano Torromeo (mtorromeo) - Thursday, 30 December 2021, 13:14 GMT
This is a sample of the output of `make VERBOSE=1` run on a proper chroot with default makepkg settings:

```
cd /build/benchmark/src/benchmark-1.6.0/build/src && /usr/bin/c++ -DHAVE_POSIX_REGEX -DHAVE_STD_REGEX -DHAVE_STEADY_CLOCK -Dbenchmark_main_EXPORTS -I/build/benchmark/src/benchmark-1.6.0/include -I/build/benchmark/src/benchmark-1.6.0/src -I/build/benchmark/src/benchmark-1.6.0/src/../include -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -flto -DNDEBUG -std=c++11 -Wall -Wextra -Wshadow -pedantic -pedantic-errors -fstrict-aliasing -Wno-deprecated-declarations -Wstrict-aliasing -flto -Wno-lto-type-mismatch -fPIC -MD -MT src/CMakeFiles/benchmark_main.dir/benchmark_main.cc.o -MF CMakeFiles/benchmark_main.dir/benchmark_main.cc.o.d -o CMakeFiles/benchmark_main.dir/benchmark_main.cc.o -c /build/benchmark/src/benchmark-1.6.0/src/benchmark_main.cc

```

`-O2` is clearly present in the build flags. Do you have any more evidence that the shipped package is not built with any optimization? Did you experience any issue with the package that made you to think this is the case?

Loading...