Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 868540 - games-action/minetest: build system appends additional flags to user CXXFLAGS
Summary: games-action/minetest: build system appends additional flags to user CXXFLAGS
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: cflags
  Show dependency tree
 
Reported: 2022-09-05 04:29 UTC by Samuel Bauer
Modified: 2022-09-07 09:08 UTC (History)
2 users (show)

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


Attachments
minetest-5.6.0.ebuild.patch (file_868540.txt,398 bytes, text/plain)
2022-09-05 04:29 UTC, Samuel Bauer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Bauer 2022-09-05 04:29:24 UTC
Created attachment 803257 [details]
minetest-5.6.0.ebuild.patch

I recently saw that a bunch of flags were added after custom gentoo flags when compiling minetest.

I propose a patch for this attached there.
It still retain all upstream flags related to math optimization as I'm really not sure they should be touched.
Comment 1 Marek Szuba archtester gentoo-dev 2022-09-05 11:05:37 UTC
Your patch is too aggressive, in addition to the unwanted optimisation flags it also removes -g (which should very much be left alone for "release with DEBUG info" builds, not in the least because most of the debug symbols will normally be stripped anyway) and -DNDEBUG. Not to mention that the use of sed should be reserved for either dynamic changes such as injection of ebuild variables, or when a patch would be too large.

Technicalities aside, I'll have a look at what Minetest upstream has got to say about build flags, to determine whether we need something like USE=custom-flags, or simply ditch the ones they set by default like you suggest. Stay tuned.
Comment 2 Samuel Bauer 2022-09-05 12:00:15 UTC
I didn't notice I removed -DNDEBUG. fixed locally.

I use splitdebug feature for minetest on one of my box, so I set -ggdb3 in my CFLAGS, but build system appends -g.
User wanting debug feature should be able to set them up manually, and as said symbol will be stripped by default anyway.

other flag removed:
"-pipe"
"-O3"
"-fomit-frame-pointer"
"-funroll-loop"
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-06 08:48:08 UTC
Forcing -g is indeed a waste of resources and time as it slows down the build only for things to be thrown away. Gentoo packages normally drop it if upstream add it in.
Comment 4 Larry the Git Cow gentoo-dev 2022-09-07 09:08:09 UTC
The bug has been closed via the following commit(s):

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

commit 44c4388090c24c1878564cbb29f735f5c126ce81
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2022-09-07 09:04:53 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2022-09-07 09:08:02 +0000

    games-action/minetest: suppress upstream optimisation flags
    
    Upstream build scripts add -O3 -funroll-loops -fomit-frame-pointers to
    CXXFLAGS, and since they are appended rather than prepended they may
    override optimisation flags set by the user.
    
    Closes: https://bugs.gentoo.org/868540
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 .../files/minetest-5.6.0-no_upstream_optflags.patch       | 15 +++++++++++++++
 .../{minetest-5.6.0.ebuild => minetest-5.6.0-r1.ebuild}   |  2 ++
 2 files changed, 17 insertions(+)