summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-08-15 22:13:28 +0100
committerSam James <sam@gentoo.org>2024-08-15 22:18:23 +0100
commit116f54058abd4fa4a5b3c16ee49a99df11883a45 (patch)
tree62c9574c8353c91211fa5b504e8dead34c22665a /eclass
parentdev-util/github-cli: fix build failure when -ggdb3 is in CFLAGS (diff)
downloadgentoo-116f54058abd4fa4a5b3c16ee49a99df11883a45.tar.gz
gentoo-116f54058abd4fa4a5b3c16ee49a99df11883a45.tar.bz2
gentoo-116f54058abd4fa4a5b3c16ee49a99df11883a45.zip
go-env.eclass: workaround debug info issues
Go can't handle some DWARF produced by GCC but nobody's been able to produce a simple testcase for it, so add a workaround where we replace -g3 with -g and -ggdb3 with -ggdb for GCC, like Ionen did in Kitty. Bug: https://bugs.gentoo.org/847991 Bug: https://bugs.gentoo.org/924436 Bug: https://bugs.gentoo.org/924496 Closes: https://bugs.gentoo.org/929219 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/go-env.eclass6
1 files changed, 6 insertions, 0 deletions
diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass
index be131133113b..a4394161cb0b 100644
--- a/eclass/go-env.eclass
+++ b/eclass/go-env.eclass
@@ -42,6 +42,12 @@ go-env_set_compile_environment() {
# XXX: Hack for checking ICE (bug #912152, gcc PR113204)
has_version -b "sys-devel/gcc[debug]" && filter-lto
+ # bug #929219
+ if tc-is-gcc ; then
+ replace-flags -g3 -g
+ replace-flags -ggdb3 -ggdb
+ fi
+
export CGO_CFLAGS="${CGO_CFLAGS:-$CFLAGS}"
export CGO_CPPFLAGS="${CGO_CPPFLAGS:-$CPPFLAGS}"
export CGO_CXXFLAGS="${CGO_CXXFLAGS:-$CXXFLAGS}"