Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 692786 - media-gfx/darktable: build scripts manipulate -march/-mtune compiler flags
Summary: media-gfx/darktable: build scripts manipulate -march/-mtune compiler flags
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Marek Szuba
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-23 20:27 UTC by Sławomir Nizio
Modified: 2020-06-18 16:30 UTC (History)
1 user (show)

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


Attachments
Add the new USE flag. (0001-media-gfx-darktable-add-cpudetection-USE-flag.patch,1.39 KB, patch)
2019-08-23 20:29 UTC, Sławomir Nizio
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sławomir Nizio 2019-08-23 20:27:57 UTC
It's a matter of providing BINARY_PACKAGE_BUILD.
I checked that it works by:
- checking that vzeroupper instruction is used in libdarktable.so (seems to come from avx),
- and is absent with this flag being disabled. It's on by default as CPU detection is the current and default behaviour.

I'm not sure if there's a better USE flag. Either this, maybe bindist?
Comment 1 Sławomir Nizio 2019-08-23 20:29:23 UTC
Created attachment 587886 [details, diff]
Add the new USE flag.
Comment 2 Jonas Stein gentoo-dev 2019-08-23 23:35:54 UTC
please add a more detailed explanation, what the flag does.
Comment 3 Sławomir Nizio 2019-08-24 17:05:34 UTC
During building, darktable normally does autodetection of CPU features for an optimized build.

However, it is not suitable for distributable binary packages (e.g. Sabayon ones, or plain Portage binpkgs).

I've encountered a case (Sabayon bug 5817) that the build server built it with AVX features, but user's CPU lacked that, causing the application to crash with SIGILL.


So this flag allows to build a generic package. Most people want an optimized build, so my patch makes optimized one by default.
Comment 4 Marek Szuba archtester gentoo-dev 2020-06-18 12:59:37 UTC
Personally, I really do not think darktable ebuilds should mess with this at all. It is up to the user to set their compiler flags the way THEY want! Will work on removing this logic soon.

Note to self: this affects all ebuilds we have in the tree, including the live one as of now.
Comment 5 Larry the Git Cow gentoo-dev 2020-06-18 16:30:38 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba35b96b501f53471cc61bdc9d518b1f48d17ef7

commit ba35b96b501f53471cc61bdc9d518b1f48d17ef7
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2020-06-18 16:26:54 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2020-06-18 16:29:21 +0000

    media-gfx/darktable: prevent CMake from overriding march and mtune
    
    Closes: https://bugs.gentoo.org/692786
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 media-gfx/darktable/darktable-3.0.2-r1.ebuild      |  1 +
 ...darktable-3.0.2_cmake-march-autodetection.patch | 26 ++++++++++++++++++++++
 2 files changed, 27 insertions(+)