Hi, to debug neomutt it would be useful to have a useflag "asan" which will enable --asan configure option or add export EXTRA_CFLAGS="-fsanitize=address" export EXTRA_LDFLAGS="-fsanitize=address" What do you think? -Marc
We don't tend to add USE flags for things where they purely add a *FLAG. Is there a reason you can't do this via /etc/portage/env?
(In reply to Sam James from comment #1) > We don't tend to add USE flags for things where they purely add a *FLAG. > > Is there a reason you can't do this via /etc/portage/env? You mean setting EXTRA_CFLAGS="-fsanitize=address" EXTRA_LDFLAGS="-fsanitize=address" there? Sure this might work, but having a USE flag will also document this debugging feature that has to be enabled at compile time. I dont see a reason why this should not be a use flag, as it changes aspects of the build adding debugging capabilities. But in the end its maybe just a matter of taste...
Update: the ENV alone is not enough. You need -DUSE_ASAN in CFLAGS as well.
ASAN is something you can build anything with so documenting it just for that isn't useful but... (In reply to Marc Schiffbauer from comment #3) > Update: the ENV alone is not enough. You need -DUSE_ASAN in CFLAGS as well. this is good justification for it (as it requires package specific knowledge)
The configure script also has --ubsan Enable the Undefined Behaviour Sanitizer Would that be useful too? If so I am wondering whether the USE flag should not be names something more generic such as "sanitize" or something similar.
(In reply to Nicolas Bock from comment #5) > The configure script also has > > --ubsan Enable the Undefined Behaviour Sanitizer > > Would that be useful too? > > If so I am wondering whether the USE flag should not be names something more > generic such as "sanitize" or something similar. These flags have a huge impact on performance. At least asan, I donot know about ubsan. But I would add both asan and ubsan as local use flags and maybe add another like you suggested like "sanitize" which then has a USEDEP on asan and ubsan? I asked the developer about enabling both ubsan and asan at the same time and will uddate the bug when I have more information about it.
Thanks Marc
Done by nicolas in commit 77c0c87ee152193d718dfcf2869ca8c817e18b47 (origin/master, origin/HEAD) Author: Nicolas Bock <nicolasbock@gentoo.org> Date: Fri Nov 3 09:05:05 2023 -0600 mail-client/neomutt: Add debugging flags This change adds `asan` and `ubsan` USE flags for debugging. Signed-off-by: Nicolas Bock <nicolasbock@gentoo.org> I still think the better way here is to just check is-flagq for -fsanitize=address and enable the corresponding configure option, ditto ubsan. (See e.g. botan and elfutils). That's what we do in other packages where the configure option is actually useful (not simply setting -fsanitize=x for you, but somehow doing an additional thing).
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4de47c94f583d30b2cbb6325dc695c4184d04f2f commit 4de47c94f583d30b2cbb6325dc695c4184d04f2f Author: Nicolas Bock <nicolasbock@gentoo.org> AuthorDate: 2023-11-06 13:00:12 +0000 Commit: Nicolas Bock <nicolasbock@gentoo.org> CommitDate: 2023-11-14 04:32:18 +0000 mail-client/neomutt: Version bump 20231103 This change also addresses Sam James' suggestion regarding the two sanitize compile flags. They are now activated via CFLAGS and not USE flags. Bug: https://bugs.gentoo.org/905838 Signed-off-by: Nicolas Bock <nicolasbock@gentoo.org> mail-client/neomutt/Manifest | 1 + mail-client/neomutt/neomutt-20231103.ebuild | 174 ++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+)
Thanks!